问题描述
我有一个 libTest.so 无法在某些设备上加载.logcat 绝对没用.使用 arm-linux-androideabi-readelf.exe -d libTest.so
我能够看到 libTest.so 需要的所有必需库.我将它们全部拉到本地 PC 上的同一个文件夹中.
I have a libTest.so that does not load on some devices. logcat is absolutely useless.Using arm-linux-androideabi-readelf.exe -d libTest.so
I was able to see all required libs that libTest.so needs. I pulled them all in, into the same folder on my local PC.
如何找出缺少哪些符号以及在哪个库中?我只有 NDK 的标准工具集(nm、readelf、objdump 等).我可以使用哪个工具以及如何使用它来解析我的 libTest.so 和所有依赖库,并告诉我哪个符号阻止我的库加载到目标设备上.
How can I find out which symbols is missing and in which library? I have only standard set of tools from the NDK (nm, readelf, objdump etc). Which tool and how can I use so that it parses my libTest.so and all dependent libs as well and tells me which symbol prevents my lib from loading on the target device.
推荐答案
感谢安卓开发者.我的功能请求已实现:)现在我们有了 ndk-depends 工具,它允许解决依赖关系问题.
Thanks to android developers. My feature request was implemented :)Now we have ndk-depends, a tool that allows to troubleshoot dependencies.
虽然它不做完整的符号解析.例如.如果您针对 Android-14 构建并尝试使用旧 Android 中不存在的方法,则此工具不会列出缺少的符号.这部分作为 TODO 留在 ndk-depends 中.
it doesn't do full symbol resolution though. E.g. if you build against Android-14 and try to use methods that didn't exist in old Androids, then this tool won't list missing symbols. This part was left as a TODO in ndk-depends.
这篇关于ldd 在 android 上等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!