Linux – Is there an automatic way to find out shared object dependencies?

Is there an automatic way to find out shared object dependencies?… here is a solution to the problem.

Is there an automatic way to find out shared object dependencies?

Brief:
I’m looking for something that will list all Unresolved dependencies in SO, taking into account SOs in its dependencies.

Long:

I’m converting a lot of statically compiled code to a shared object in Linux – apart from trial and error when trying to load it, is there an easy way to determine what other SOs my recently compiled SO depends on?

I’m sure there’s a better way, but I haven’t found it yet.

I found “ldd”, but it only lists the dependencies that SO says.
I also use “nm” to determine when an SO fails to load to verify that other SOs contain it.

Solution

I

don’t have the code for you, but I can point it :

It’s just a graphical issue. You should use objdump -T to dump a dynamic symbol table for a given binary or shared object. You’ll see a lot of line output, and the flags might be a bit confusing, but the important part is that these symbols are *UND* or they will have segment names (.text etc.).

Any time you see *UND*, it means that it is an undefined symbol that must be resolved. The defined symbol is the target of the resolution.

With that, plus a little Python, you should be able to find what you need.

Related Problems and Solutions