Objdump

objdump is a tool to work with binary object files. It is part of the GNU binutils.

objdump can be used for disassembly, with the -d flag, eg. objdump -d executable

If the executable has been compiled with debugging information, the -S flag will intermix source and disassembled code.

The --syms flag shows symbol information.

= Example = int main {  std::cout << "hello world" << std::endl; } g++ main.cpp objdump -d a.out objdump -d a.out | head [...] 0000000000400718 <_init>: 400718:      48 83 ec 08             sub    $0x8,%rsp 40071c:      e8 cb 00 00 00          callq  4007ec  [...] objdump -M intel -d a.out | head [...] 0000000000400718 <_init>: 400718:      48 83 ec 08             sub    rsp,0x8 40071c:      e8 cb 00 00 00          call   4007ec  [...]
 * Have a file main.cpp:
 * 1) include
 * Build it:
 * disassemble it:
 * show only the first lines:
 * use another debugger format:

= See also =
 * programming-related commands
 * ldd
 * nm
 * gdb