Linux command
readelf 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
readelf -a /path/to/binary
Example
readelf -e /path/to/binary
Example
readelf -s /path/to/binary
Example
readelf --dyn-syms /path/to/binary
Example
readelf -S /path/to/binary
Example
readelf -r /path/to/binary
Example
readelf -x .text /path/to/binary
Example
readelf -p .rodata /path/to/binary
说明
readelf displays information about one or more ELF (Executable and Linkable Format) object files. It supports both 32-bit and 64-bit ELF files and operates independently of the BFD library, providing detailed analysis of binary files.
参数
- -a, --all
- Display all information
- -h, --file-header
- Display the ELF file header
- -l, --program-headers
- Display program (segment) headers
- -S, --section-headers
- Display section headers
- -e, --headers
- Display all headers (file, program, section)
- -s, --symbols
- Display symbol table entries
- --dyn-syms
- Display dynamic symbol table
- -r, --relocs
- Display relocation sections
- -d, --dynamic
- Display dynamic section contents
- -n, --notes
- Display NOTE segments/sections
- -V, --version-info
- Display version sections
- -x _section_, --hex-dump=_section_
- Display section contents as hexadecimal bytes
- -p _section_, --string-dump=_section_
- Display section contents as printable strings
- -u, --unwind
- Display unwind table information
- -w, --debug-dump
- Display DWARF debug sections
- -I, --histogram
- Display a histogram of bucket list lengths for symbol tables
- -W, --wide
- Allow wide output (do not break lines at 80 columns)
- -C, --demangle
- Decode (demangle) low-level symbol names into user-level names
- -z, --decompress
- Decompress sections before displaying their contents
- -H, --help
- Display usage information
FAQ
What is the readelf command used for?
readelf displays information about one or more ELF (Executable and Linkable Format) object files. It supports both 32-bit and 64-bit ELF files and operates independently of the BFD library, providing detailed analysis of binary files.
How do I run a basic readelf example?
Run `readelf -a /path/to/binary` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in readelf?
Display all information