mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 23:15:10 +03:00
[linker] Expand and correct symbol requirement macros
REQUIRE_SYMBOL() formerly used a formulation of symbol requirement that would allow a link to succeed despite lacking a required symbol, because it did not introduce any relocations. Fix by renaming it to REQUEST_SYMBOL() (since the soft-requirement behavior can be useful) and add a REQUIRE_SYMBOL() that truly requires. Add EXPORT_SYMBOL() and IMPORT_SYMBOL() for REQUEST_SYMBOL()-like behavior that allows one to make use of the symbol, by combining a weak external on the symbol itself with a REQUEST_SYMBOL() of a second symbol. Signed-off-by: Marty Connor <mdc@etherboot.org>
This commit is contained in:
committed by
Marty Connor
parent
7a5aaecda2
commit
572e61754a
@@ -130,6 +130,7 @@ SECTIONS {
|
||||
/DISCARD/ : {
|
||||
*(.comment)
|
||||
*(.note)
|
||||
*(.discard)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -152,6 +152,7 @@ SECTIONS {
|
||||
*(.eh_frame.*)
|
||||
*(.rel)
|
||||
*(.rel.*)
|
||||
*(.discard)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -101,5 +101,6 @@ SECTIONS {
|
||||
*(.eh_frame.*)
|
||||
*(.rel)
|
||||
*(.rel.*)
|
||||
*(.discard)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user