$linuxjunkies
>

objdump(1)

Display information from object files such as symbols, sections, disassembly, and headers.

UbuntuDebianFedoraArch

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

FlagWhat it does
-dDisplay assembler mnemonics for machine instructions in the file
-DLike -d, but disassemble all sections (not just executable ones)
-SDisplay interleaved source code and disassembly (requires debug symbols)
-tPrint the symbol table entries of the file
-TPrint dynamic symbol table entries instead of normal symbol table
-hDisplay the ELF/object file header information
-sDisplay the full contents of all sections requested
-rPrint the relocation entries of the file
-RPrint dynamic relocation entries
-M intelDisplay assembly in Intel syntax instead of AT&T syntax
-j SECTIONDisplay information only for specified section
--sourceDisplay original source code mixed with disassembly

Examples

Show the first 50 lines of disassembled code from the ls binary

objdump -d /bin/ls | head -50

List all symbols matching 'printf' in the C library

objdump -t /usr/lib/libc.so.6 | grep printf

Display 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 -100

Find all CALL instructions in Intel syntax disassembly

objdump -d -M intel ./binary | grep 'call'

Display relocation information for an object file

objdump -r ./object.o

Count the number of dynamic symbols exported by libc

objdump -T /lib/x86_64-linux-gnu/libc.so.6 | wc -l

Disassemble a binary file in Intel syntax

objdump -d ./prog | objdump -M intel -b binary -m i386 -

Related commands