0

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?

Sir Muffington
  • 1,286
  • 3
  • 8
  • 23

1 Answers1

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