On Mon, Mar 31, 2008 at 10:51:00PM +0200, Mike Hommey wrote:
According to ld(1): -Bsymbolic-functionsWhen creating a shared library, bind references to global function symbols to the definition within the shared library, if any. This option is only meaningful on ELF platforms which support shared libraries.A little bit OT, but does this have the same result as what is done here ?
No, this renames the symbol and sets the visibility to hidden. nm would mark this symbol with a "t" instead of a "T". This prevents external users from linking against this symbol, since it is not globally visible. In other words, this is much like the "static" specifier, but specific to the entire library, instead of just to that object file.
LD_PRELOAD would still be able to override it, because by default, ELF shared libraries use relocations that must be serviced by ld.so. However, if -Bsymbolic-functions were used, those functions would already be relocated, speeding up link time, but preventing LD_PRELOAD from working, since no relocation ever occurs for that symbol.
-- brian m. carlson / brian with sandals: Houston, Texas, US +1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only troff on top of XML: http://crustytoothpaste.ath.cx/~bmc/code/thwack OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Description: Digital signature