[leftover-crazy@leftover-crazy 6nd]$ arm-2440-linux-gnueabi-objdump -h test.o test2.o test test.o: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .text 0000007c 00000000 00000000 00000034 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 .data 00000000 00000000 00000000 000000b0 2**0 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 00000000 00000000 000000b0 2**0 ALLOC 3 .ARM.attributes 00000014 00000000 00000000 000000b0 2**0 CONTENTS, READONLY test2.o: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .text 0000004c 00000000 00000000 00000034 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 .data 00000004 00000000 00000000 00000080 2**2 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 00000000 00000000 00000084 2**0 ALLOC 3 .rodata 00000038 00000000 00000000 00000084 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .comment 00000025 00000000 00000000 000000bc 2**0 CONTENTS, READONLY 5 .note.GNU-stack 00000000 00000000 00000000 000000e1 2**0 CONTENTS, READONLY 6 .ARM.attributes 00000028 00000000 00000000 000000e1 2**0 CONTENTS, READONLY test: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .text 000000c8 30000000 30000000 00008000 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .rodata 00000038 300000c8 300000c8 000080c8 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .data 00000004 30008100 30008100 00008100 2**2 CONTENTS, ALLOC, LOAD, DATA 3 .ARM.attributes 00000026 00000000 00000000 00008104 2**0 CONTENTS, READONLY
再来看看一个工具是readelf 这是elf映像分析工具
Usage: readelf <option(s)> elf-file(s) Display information about the contents of ELF format files -a --all 全部 Equivalent to: -h -l -S -s -r -d -V -A -I -h --file-header 文件头 Display the ELF file header -l --program-headers 程序 Display the program headers --segments An alias for --program-headers -S --section-headers 段头 Display the sections --sections An alias for --section-headers -e --headers 全部头 Equivalent to: -h -l -S -s --syms 符号表 Display the symbol table --symbols An alias for --syms -n --notes 内核注释 Display the core notes (if present) -r --relocs 重定位 Display the relocations (if present) -u --unwind Display the unwind info (if present) -d --dynamic 动态段 Display the dynamic segment (if present) -V --version-info 版本 Display the version sections (if present) -A --arch-specific CPU构架 Display architecture specific information (if any). -D --use-dynamic 动态段 Use the dynamic section info when displaying symbols -x --hex-dump=<number> 显示 段内内容Dump the contents of section <number> -w[liaprmfFso] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]
ELF 文件结构分析 (1):http://www.rainsts.net/article.asp?id=886
ELF 文件结构分析 (2):http://www.rainsts.net/article.asp?id=887
ELF 文件结构分析 (3):http://www.rainsts.net/article.asp?id=888
ELF 文件结构分析 (4):http://www.rainsts.net/article.asp?id=889
ELF 文件结构分析 (5):http://www.rainsts.net/article.asp?id=890
ELF 文件结构分析 (6):http://www.rainsts.net/article.asp?id=891