如何确定Android .so文件(即armeabi或armeabi-v7a)的ABI? [英] How to determine ABI of Android .so file (i.e. armeabi or armeabi-v7a)?

查看:418
本文介绍了如何确定Android .so文件(即armeabi或armeabi-v7a)的ABI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个第三方供应商提供的.so文件,该文件将包含在我的Android应用程序中.我无权访问源代码,也不能(轻松地)与供应商联系.

I have a .so file provided by a third-party vendor that is to be included in my Android application. I do not have access to the source code nor can I (easily) contact the vendor.

我是否可以通过检查.so文件来确定它是否针对 armeabi armeabi-v7a ABI进行编译?

Is there a way for me to figure out by examining the .so file whether or not it was compiled targeting the armeabi or armeabi-v7a ABI?

我问的原因有两个.首先,我更喜欢针对armeabi-v7a ABI进行编译,以实现比armeabi更高的性能.知道这一点将使我有信心获得最佳性能.另外,我想命名.so文件所在的目录(即,将文件夹"armeabi"或"armeabi-v7a"命名为与它针对的ABI相对应).

I'm asking for two reasons. First, I prefer for it to have been compiled targeting the armeabi-v7a ABI to get the improved performance compared to armeabi; knowing this will give me confidence that I'm getting the best possible performance. Also, I would like to name the directory in which the .so files live appropriately (i.e. name the folder "armeabi" or "armeabi-v7a" corresponding to the ABI that it was compiled targeting).

推荐答案

我最终使用Android NDK中的arm-linux-androideabi-objdump程序反汇编了.so文件.在反汇编的代码中,我找到了vmaxnm.f32指令,该指令存在于armeabi-v7a指令集中,而在 not 中却没有.基于此,我得出结论,.so是针对armeabi-v7a编译的.我可能还应该寻找其他指令,但是我对ARM指令集一点都不熟悉.我很幸运,这一操作相当明显(因为这是浮点运算,这是armeabi和armeabi-v7a之间的主要区别之一).感谢发布者的想法.

I ended up disassembling the .so files using the arm-linux-androideabi-objdump program from the Android NDK. In the disassembled code I found the vmaxnm.f32 instruction, which is present in the armeabi-v7a instruction set but not in armeabi. Based on that I concluded that the .so was compiled targeting armeabi-v7a. There are probably other instructions that I could have looked for but I'm not at all familiar with the ARM instruction set to be able to tell. I got lucky that this one was fairly obvious (being that it is a floating point operation, one of the major differences between armeabi and armeabi-v7a). Thanks for the ideas to those who posted.

这篇关于如何确定Android .so文件(即armeabi或armeabi-v7a)的ABI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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