objdump(1)
Display information from object files such as symbols, sections, disassembly, and headers.
Synopsis
objdump [OPTION]... FILE...Description
objdump examines one or more object files and displays selected information about them in human-readable form. It can show disassembled machine code, symbol tables, section headers, relocation information, and other metadata embedded in compiled binaries, libraries, and object files.
Commonly used to analyze binaries for debugging, reverse engineering, security research, and understanding code generation. Works with ELF, COFF, PE, and other executable formats supported by binutils.
Common options
| Flag | What it does |
|---|---|
-d | Display assembler mnemonics for machine instructions in the file |
-D | Like -d, but disassemble all sections (not just executable ones) |
-S | Display interleaved source code and disassembly (requires debug symbols) |
-t | Print the symbol table entries of the file |
-T | Print dynamic symbol table entries instead of normal symbol table |
-h | Display the ELF/object file header information |
-s | Display the full contents of all sections requested |
-r | Print the relocation entries of the file |
-R | Print dynamic relocation entries |
-M intel | Display assembly in Intel syntax instead of AT&T syntax |
-j SECTION | Display information only for specified section |
--source | Display original source code mixed with disassembly |
Examples
Show the first 50 lines of disassembled code from the ls binary
objdump -d /bin/ls | head -50List all symbols matching 'printf' in the C library
objdump -t /usr/lib/libc.so.6 | grep printfDisplay headers and show the sizes of main code and data sections
objdump -h ./myprogram | grep -E '\.text|\.data|\.bss'Show disassembly of .text section mixed with source code (if available)
objdump -S -j .text ./myprogram | head -100Find all CALL instructions in Intel syntax disassembly
objdump -d -M intel ./binary | grep 'call'Display relocation information for an object file
objdump -r ./object.oCount the number of dynamic symbols exported by libc
objdump -T /lib/x86_64-linux-gnu/libc.so.6 | wc -lDisassemble a binary file in Intel syntax
objdump -d ./prog | objdump -M intel -b binary -m i386 -