When ld-linux resolves a symbol it searches through the shared libraries in a particular order and stops when it finds a shared library with a matching symbol.
What determines the order it searches through the libraries? Does it make a difference if the unresolved symbol is in the main program or in another shared library?
How could I determine the search order programatically without calling external programs like ldd?
From http://www.muppetlabs.com/~breadbox/software/ELF.txt (as mentioned by sarnold):
When resolving symbolic references, the dynamic linker examines the symbol tables with a breadth-first search. That is, it first looks at the symbol table of the executable program itself, then at the symbol tables of the DT_NEEDED entries (in order), then at the second level DT_NEEDED entries, and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With