How do you list all of a program's dependencies (libraries) and configs even if it gets argv given to it which changes the dependencies let's say?
Asked
Active
Viewed 518 times
1 Answers
2
If your program uses the GNU C library’s dynamic linker (ld.so
), you can run it and trace all the libraries it loads by setting LD_DEBUG=libs
:
LD_DEBUG=libs yourcommand --args
This will allow you to determine whether changing the program’s arguments changes the libraries it loads.
Note that any libraries shown by ldd /path/to/yourcommand
will always be loaded, that won’t vary based on program arguments. Libraries loaded using dlopen
can vary, and this will show up using this technique.
If you want to find out what configuration files are read, use strace
:
strace -e open yourcommand --args

Stephen Kitt
- 434,908