[linker] Expand and correct symbol requirement macros
authorJoshua Oreman <oremanj@rwcr.net>
Sun, 2 Aug 2009 21:01:36 +0000 (14:01 -0700)
committerJoshua Oreman <oremanj@rwcr.net>
Wed, 5 Aug 2009 05:16:06 +0000 (22:16 -0700)
commit1d79217179cd9100cf319d4d5172e26e382c60c8
tree8e2c87eb0fa9dc7ce74aa76887a49d25c5e87a18
parentf42b2932f8cd55583a9e024ad4cf7484f17fb7fa
[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.
src/arch/i386/scripts/i386-kir.lds
src/arch/i386/scripts/i386.lds
src/arch/x86/scripts/efi.lds
src/include/compiler.h