When GNU objdump dumps the input with -d it prints the symbol addresses,
0000000000000031 <foo>: 31: 00 00 add %al,(%rax) ... 0000000000000035 <bar>: ...
when llvm-objdump dumps the same object, it doesn't do that:
foo: ... 39: 00 00 addb %al, (%rax) bar: ... 39: 00 00 addb %al, (%rax) 3b: 00 00 addb %al, (%rax)
The reason to do the same is the following:
I am working on a D56083, which implements -z/--disassemble-zeroes.
Normally the disassembly output will skip blocks of zeroes. Currently, by default GNU objdump
skip them, but llvm-objdump does not. And the issue is shown in the sample above.
If we omit the bytes at the beginning of the section (see bar above), then the first
address (0x0000000000000035) is not printed and it is inconvenient and makes the output
not so useful as we do not see the start address of the symbol then.
So I suggest to follow the GNU objdump behavior and also print the address unless the
-no-leading-addr flag is set.