I am trying to dump the full paths of the shared libraries that are imported by an ELF file (
readelf --dyn-syms /usr/bin/ls I get the name of the libraries, but not where they are located on the filesystem:
101: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]@LIBSELINUX_1.0 (4)
objdump -T /usr/bin/ls I get even more information (including function names):
0000000000000000 DF *UND* 0000000000000000 (LIBSELINUX_1.0) getfilecon
This is useful information, but how can I extract the location of the library on disk?
I could run the file and see what it opens via
lsof, but is there any way to do this without running the file?