Dancrumb
Dancrumb

Reputation: 27539

How do I track which libraries are being dynamically loaded by an application?

I have an application (for which I do not have the source code).

I know that it is designed to dynamically load a shared library, depending on the command line parameters.

I know which library it should be loading and I've set up LD_LIBRARY_PATH to the appropriate directory.

The application works on one server without any problems, but does not work on another.

I'm trying to figure out why and it would be helpful if I could confirm that the script is looking for the library that I think it is and if I could track where it is looking.

Are there any tools that could help me? I've been googling, but most of the information I'm finding is about ldd which really only tells you about statically linked libraries.

This is in a Linux environment and the application and library are both written in C

Thanks

Upvotes: 3

Views: 500

Answers (2)

zvrba
zvrba

Reputation: 24546

As every shared library is memory-mapped into the process's address space, you can also inspect the /proc/[PID]/maps file.

Upvotes: 1

rmk
rmk

Reputation: 4455

Use strace. You will see the libraries being searched etc., which will help you figure out what is happening.

Upvotes: 3

Related Questions