GCC / ELF - where does my symbol come from?

There is an executable file that is dynamically linked to the number of shared objects. How to determine which symbol belongs to one (imported into the executable file)?

If there is more than one possibility, can I strengthen ld and see where it comes from?

+4
source share
4 answers
+5
source

Like Charlie, ldd can do what you are looking for.

+5
source

If you can link the executable, the easiest way to find out where links and definitions come from is to use the ld -y flag. For instance:

 $ cat tc int main() { printf("Hello\n"); return 0; } $ gcc tc -Wl,-yprintf /lib/libc.so.6: definition of printf 

If you cannot reload the executable, run ldd on it, and then run 'nm -D' in all the libraries listed in order, and grep for the character you are interested in.

+3
source
 $LD_DEBUG=bindings my_program 

This will print all character bindings on the console.

+1
source

All Articles