Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get dependencies list for .so file?

Let's say i'm having libFoo.so compiled for android (arm). I'm not sure what STL implementation it was linked to (there are options). How can i get dependencies (as .so list) for it to understand what files i should provide and load using System.load(...)/loadLibrary(...)?

like image 548
4ntoine Avatar asked Nov 15 '15 05:11

4ntoine


1 Answers

You can use the objdump tool and filter out the relevant part. In this case, e.g. arm-linux-androideabi-objdump -p libFoo.so | grep NEEDED.

The ldd tool as suggested normally also does this, but it tries to actually find all the files that would be loaded, and it is not always available in cross-compilation environments.

like image 74
mstorsjo Avatar answered Oct 20 '22 04:10

mstorsjo