3

As I know we can define the search path for additional non standard libraries using export LD_LIBRAY_PATH.

How can I see the list of these additional libraries after setting LD_LIBRARY_PATH?

1

With ls:

(IFS=:; set -f; ls -l $LD_LIBRARY_PATH)

Notice that there's no guarantee that a binary will not ignore your LD_LIBRARY_PATH; On linux, the DT_RPATH attribute from the ELF binary (but not DT_RUNPATH) will override LD_LIBRARY_PATH. See man 8 ld.so for all the details.

Also, the "paths" from LD_LIBRARY_PATH may contain $ORIGIN, $LIB or $PLAFORM tokens that will be expanded by the dynamic linker depending on the path of the program and its format.

The only way to automatically determine what libraries will be used by a program is to run ldd your_program. But don't do that with random binaries; it may be as dangerous as actually exec'ing the program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.