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 instruction
  • Machine code: Hexadecimal representation
  • Assembly: Human-readable assembly code
  • Comments: Additional information if available

Section Headers

  • Idx: Section index
  • Name: Section name
  • Size: Section size in bytes
  • VMA: Virtual memory address
  • LMA: Load memory address
  • File off: File offset
  • Algn: Alignment requirements

Symbol Table

  • Address: Symbol address
  • Flags: Symbol attributes
  • Section: Section containing symbol
  • Name: 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

See Also

  • nm - Display symbol tables
  • readelf - Display ELF file information
  • strings - Extract printable strings
  • file - Determine file type