- the environment variable LD_LIBRARY_PATH
- a global file /etc/ld.so.conf or its cache /etc/ld.so.cache
- the RPATH and RUNPATH information in the executables header
- some hardwired default paths like /lib and /usr/lib
RPATH and RUNPATH information is created at link time.
This is how to extract and display RPATH and RUNPATH from a given binary files:
Solaris:
/usr/ccs/bin/dump -Lv <binary> | egrep 'RPATH|RUNPATH'
Linux:
/usr/bin/objdump -p <binary> | egrep 'RPATH|RUNPATH'
I just discovered the utility eu-readelf -d which comes with the package elfutils. It does the same as objdump but looks more thorough.
ReplyDelete