Skip to content

objdump

17 commands

Displays information about object files: headers, sections, symbols and disassembly. Part of GNU binutils.

  • disassembly
  • ELF
  • binutils

Install objdump

sudo apt install binutils

Headers4

objdump -f <binary>

File header: architecture, flags and entry point.

Link
objdump -h <binary>

Section headers with sizes, addresses and flags.

Link
objdump -x <binary>

All headers, including program headers and dynamic section.

Link
objdump -p <binary>

Private headers; filtered to NEEDED it lists required shared libraries.

Link

Symbols3

objdump -t <binary>

The symbol table (empty if the binary is stripped).

Link
objdump -T <binary>

Dynamic symbols — imported and exported functions.

Link
objdump -R <binary>

Dynamic relocations, including GOT entries.

Link

Disassembly7

objdump -d <binary>

Disassembles executable sections.

Link
objdump -d -M intel <binary>

Intel syntax.

Link
objdump -d --disassemble=<symbol> <binary>

Only one function.

Link
objdump -S <binary>

Interleaves source code when debug info exists.

Link
objdump -D <binary>

Disassembles every section, including data.

Link
objdump -d --start-address=<a> --stop-address=<b> <binary>

A specific address range.

Link
objdump -D -b binary -m <arch> <file>

Disassembles raw bytes such as shellcode.

Link

Data3

objdump -s -j <section> <binary>

Hex and ASCII dump of one section.

Link
objdump -d <binary> | grep -c "call"

Counts call instructions — a crude complexity measure.

Link
objdump -d ./<file>.o | grep -Po "\s\K[a-f0-9]{2}(?=\s)" | tr -d "\n"

Extracts opcode bytes from an object file as a hex string.

Link