我无权访问构建命令,我的系统中只有库。
我想我可以构建一个 hardfp 可执行文件来链接它并进行测试,但我想知道是否有更简单的方法。
最佳答案
执行readelf -A library.so
:如果打印的标签列表包含Tag_ABI_VFP_args: VFP registers
,那么它是一个hardfp
二进制, 否则假设 softfp
.
例如readelf -A/lib/arm-linux-gnueabihf/libm.so.6
会产生
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_ABI_optimization_goals: Aggressive Speed
Tag_CPU_unaligned_access: v6
另一方面,readelf -A/lib/arm-linux-gnueabi/libm.so.6
产生
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_optimization_goals: Aggressive Speed
Tag_CPU_unaligned_access: v6
关于c++ - 我如何知道 ARM 库是否正在使用 hardfp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20555594/