objdump
Display information about object files, executables, and libraries
Syntax
objdump [options] objfile...
Basic Usage
Display file headers
objdump -f program
Shows the file header information of the specified executable.
Display section headers
objdump -h program
Disassemble executable
objdump -d program
Display all headers
objdump -x program
Common Options
-a, --archive-headers: Display archive header information-d, --disassemble: Disassemble sections with instructions-D, --disassemble-all: Disassemble all sections-f, --file-headers: Display file header information-h, --section-headers: Display section headers-H, --help: Display help information-j, --section: Only display information for specified section-l, --line-numbers: Include line numbers and filenames-p, --private-headers: Display object format specific information-r, --reloc: Display relocation entries-R, --dynamic-reloc: Display dynamic relocation entries-s, --full-contents: Display full contents of sections-S, --source: Intermix source code with disassembly-t, --syms: Display symbol table-T, --dynamic-syms: Display dynamic symbol table-x, --all-headers: Display all available header information
Practical Examples
Basic disassembly
objdump -d program
Disassembly with source code
objdump -S program
Show symbol table
objdump -t program
Show section headers
objdump -h program
Show file headers
objdump -f program
Show all headers
objdump -x program
Show specific section
objdump -j .text -d program
Show relocation information
objdump -r program
Show full section contents
objdump -s program
Show archive information
objdump -a library.a
Understanding Output
Disassembly Output
Disassembly shows:
Address: Memory address of instructionMachine code: Hexadecimal representationAssembly: Human-readable assembly codeComments: Additional information if available
Section Headers
Idx: Section indexName: Section nameSize: Section size in bytesVMA: Virtual memory addressLMA: Load memory addressFile off: File offsetAlgn: Alignment requirements
Symbol Table
Address: Symbol addressFlags: Symbol attributesSection: Section containing symbolName: Symbol name
Best Practices
Use Cases
- Debugging binary files and executables
- Reverse engineering and analysis
- Understanding program structure
- Analyzing compiler output
- Security research and vulnerability analysis
Important Notes
- Debug information may be stripped from release builds
- Disassembly can be complex for optimized code
- Some sections may not be disassemblable
- Output format varies by architecture
- Use appropriate options for your analysis needs