Linker and Libraries Guide

The Use of -Bsymbolic

The link-editors -Bsymbolic option provides a means of binding symbol references to their global definitions within a shared object. This option is somewhat historic, in that it was primarily designed for use in creating the runtime linker itself.

The practice of defining an object's interface and reducing non-public symbols to local is a preferable mechanism of reducing runtime relocation costs over using the -Bsymbolic option (see "Reducing Symbol Scope"). In fact the use of -Bsymbolic can often result in some non-intuitive side effects.

If a symbolically bound symbol is interposed upon, then references to the symbol from outside of the symbolically bound object will bind to the interposer, whereas the object itself is already bound internally. Essentially two symbols with the same name are now being referenced from within the process. A symbolically bound data symbol that results in a copy relocation (see "Copy Relocations") creates the same interposition situation.


Note -

Symbolically bound shared objects are identified by the .dynamic entry DT_SYMBOLIC. This tag is informational only; the runtime linker processes symbol lookups from these objects in the same manner as any other object. Any symbolic binding is assumed to have been created at the link-edit phase.