[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:
Joshua Oreman
2009-08-02 14:01:36 -07:00
committed by Marty Connor
parent 7a5aaecda2
commit 572e61754a
4 changed files with 98 additions and 10 deletions

View File

@@ -130,6 +130,7 @@ SECTIONS {
/DISCARD/ : {
*(.comment)
*(.note)
*(.discard)
}
/*

View File

@@ -152,6 +152,7 @@ SECTIONS {
*(.eh_frame.*)
*(.rel)
*(.rel.*)
*(.discard)
}
/*

View File

@@ -101,5 +101,6 @@ SECTIONS {
*(.eh_frame.*)
*(.rel)
*(.rel.*)
*(.discard)
}
}