可通过readelf指令,分析文.a .so .bin 文件是在什么系统上编译的,文件格式是32位还是64位,数据是大端还是小端,运行在 arm 上还是 x86上
1:格式读取说明
通过 readelf -a libbrd.a 读取文件的格式内容
File: libbrd.a(brd_audio.o)
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: ARM
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 10924 (bytes into file)
Flags: 0x5000000, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 22
Section header string table index: 21
2:关键内容说明
2.1 Class
ELF32:说明该文件格式是32位系统格式
2.2 Data
2’s complement, little endian:说明数据格式位为小端
2.3 Machine
ARM:说明当前文件运行在 arm架构 的系统上