readelf Command Cheatsheet
Installation Instructions
# Using MSYS2
pacman -S binutils
# Using Chocolatey
choco install mingw-w64
# Debian/Ubuntu
sudo apt-get install binutils
# RHEL/CentOS
sudo yum install binutils
# Arch Linux
sudo pacman -S binutils
# Using Homebrew
brew install binutils
# Command might be available as 'greadelf'
Basic Header Information
Display all headers:
Show file header:
Display section headers:
Show program headers:
Display symbol table:
Show dynamic symbol table:
readelf --dyn-syms binary_file
Display symbol versioning:
Dynamic Section Information
Show dynamic section:
Display needed libraries:
readelf -d binary_file | grep " NEEDED"
Show RPATH/RUNPATH:
readelf -d binary_file | grep " RPATH\|RUNPATH"
Display relocations:
Show dynamic relocations:
readelf --dyn-rel binary_file
Display PLT relocations:
List sections:
readelf --sections binary_file
Show section contents:
readelf -x section_name binary_file
Display string tables:
readelf -p .strtab binary_file
Show notes:
Display build attributes:
Show file comments:
readelf --string-dump=.comment binary_file
Display architecture-specific info:
Show processor-specific flags:
readelf --arm-attributes binary_file
Show version info:
readelf --version-info binary_file
Display version symbols:
readelf --version-symbols binary_file
Header Details
Show ELF file type:
readelf -h binary_file | grep " Type:"
Display entry point:
readelf -h binary_file | grep " Entry point"
Display section groups:
Show group sections:
readelf --section-groups binary_file
Display unwind information:
readelf --unwind binary_file
Show archive index:
readelf --archive-index archive.a
Display hex dump of section:
readelf -x .text binary_file
Show debug sections:
Display DWARF info:
readelf --debug-dump binary_file
Show frame information:
readelf --debug-dump=frames binary_file
Check for security features:
readelf -l binary_file | grep " GNU_STACK"
Display stack canary:
readelf -s binary_file | grep " __stack_chk"
Show RELRO status:
readelf -l binary_file | grep " GNU_RELRO"
Analyze core dump:
Show core dump sections:
Display .init section:
readelf -x .init binary_file
Show .fini section:
readelf -x .fini binary_file
Wide output format:
Hex dump with ASCII:
readelf -x .data --string binary_file
Generate script-friendly output:
readelf --demangle --wide binary_file
Show all strings:
readelf -p .rodata binary_file
Display histogram:
readelf --histogram binary_file
Show archive headers:
readelf --archive-index archive.a
Display symbol size:
readelf -s --wide binary_file
Check for stripped symbols:
readelf -s binary_file | grep " Symbol table"
Analyze dynamic loader:
readelf -l binary_file | grep " Requesting"
Show segment permissions:
readelf -l binary_file | grep " FLAGS"