如何获取.so文件的依赖项列表? [英] How to get dependencies list for .so file?

查看:98
本文介绍了如何获取.so文件的依赖项列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,我正在为Android(手臂)编译libFoo.so.我不确定它链接到了什么STL实现(有选项).我如何获取依赖项(如.so列表)以了解应使用System.load(...)/loadLibrary(...)提供和加载的文件?

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(...)?

推荐答案

您可以使用objdump工具并过滤掉相关部分.在这种情况下,例如arm-linux-androideabi-objdump -p libFoo.so | grep NEEDED.

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.

通常建议的ldd工具也可以执行此操作,但是它会尝试查找将要加载的所有文件,并且在交叉编译环境中并不总是可用.

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.

这篇关于如何获取.so文件的依赖项列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆