objdump: Usage, Options & Common CI Errors
objdump disassembles binaries and dumps their sections, symbols, and headers.
objdump is the Swiss-army inspector for compiled output. In CI it answers "what architecture is this object?" and "did the compiler actually emit this code?", which is how you catch cross-compile and ABI mismatches.
What it does
objdump displays information from object files: disassembly (-d), section headers (-h), the symbol table (-t), dynamic symbols (-T), and relocations (-r). It understands many architectures and file formats via libbfd.
Common usage
objdump -d app.o # disassemble code
objdump -t app.o # symbol table
objdump -h app # section headers
objdump -T libfoo.so # dynamic symbol table
objdump -d -C app | less # demangled disassemblyOptions
| Flag | What it does |
|---|---|
| -d / -D | Disassemble code / all sections |
| -t / -T | Symbol table / dynamic symbol table |
| -h | Section headers and sizes |
| -r / -R | Relocation entries |
| -C | Demangle C++ names |
Common errors in CI
"File format not recognized" means objdump (or its libbfd) does not know this file - often a wrong-architecture object from a cross-compile, or not an object at all. To diagnose a "skipping incompatible" linker warning, objdump -f or readelf -h reveals the target machine (e.g. x86-64 vs aarch64). The host objdump may not disassemble a foreign arch; use the target-prefixed binutils (e.g. arm-none-eabi-objdump) instead.