- readelf:Linux 下专门针对 ELF 文件格式的解析器;
0. binutils
- gnu binutils 一套二进制工具的集合,主要包含:ld(gnu linker)、as(gnu assembler),此外还包括:
- addr2line:Converts addresses into filenames and line numbers.
- ar:A utility for creating, modifying and extracting from archives.
- c++filt:Filter to demangle encoded C++ symbols.
- dlltool:A new, faster, ELF only linker, still in beta test.
- gold:A new, faster, ELF only linker, still in beta test.
- gprof:Displays profiling information.
- nlmconv:Converts object code into an NLM.
- nm:Lists symbols from object files.
- objcopy:Copies and translates object files.
- objdump:Displays information from object files.
- ranlib:Generates an index to the contents of an archive.
- readelf:Displays information from any ELF format object file.
- size:Lists printable strings from files.
- strip:Discards symbols.
- windmc:A Windows compatible(兼容的) message compiler.
- windres:A compiler for Windows resource files.
1. objdump
objdump:顾名思义,查看显示 obj(目标文件)的内部结构;
$ gcc -c hello.c # -c 表示只编译不链接;$ objdump -h hello.o