词条 | Direct binding |
释义 |
Direct binding is a feature of the linker and dynamic linker on Solaris and OpenSolaris. It provides a method to allow libraries to directly bind symbols to other libraries, rather than weakly bind to them and leave the dynamic linker to figure out which library contains the symbol. TheoryWhen linking a shared library or dynamic linked executable, the linker normally populates the symbol table for that library with all required symbols. It adds symbols in the current object with their offset, and leaves undefined symbols in the object unresolved. Unresolved symbols must still be known at link time, but the linker is passed shared libraries to link with and, when it finds a symbol in another library, it places a note in the output library indicating that it depends on these other shared libraries. This kind of weak linking forces the dynamic linker to resolve which library contains which symbol when the executable is run. The dynamic linker on Linux, for example, reads through the DT_NEEDED section of an ELF object and loads needed libraries; but isn't told where required symbols are. For this, it must iterate through each unresolved symbol in the object, and for each of these, iterate through each loaded library, checking until it finds a matching symbol. This can be time consuming. Direct linking works around this problem by storing an equivalent list of pointers to DT_NEEDED entries in a separate ELF section. Each pointer corresponds to a symbol in the object; thus, these pointers create a relation between a symbol and a DT_NEEDED entry. This allows the linker to locate the library specified by a particular DT_NEEDED entry and check only its symbol table for each symbol, rather than iterate through potentially every library for every symbol. References
External links
1 : OpenSolaris |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。