Search code examples
linuxbinarygnuobjdump

Prevent objdump from truncating hex output


Using objdump -dF or just objdump -d, I experience that objdump truncates output:

0000000000400561 <.wm_split0> (File Offset: 0x561):
  400561:   01 00                   add    %eax,(%rax)
    ...

0000000000400565 <.end_0> (File Offset: 0x565):

Here it only displays two of the 4 bytes from position 0x400561 to 0x400565.

I know the rest of the bytes are 0x00 in this case, but I have some tools that currently depends on four bytes being present.

How do I make objdump display hex for all addresses?


Solution

  • You can use the following objdump option when disassembling:

    -z, --disassemble-zeroes       Do not skip blocks of zeroes when disassembling