diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-01-09 14:43:33 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-01-09 14:43:33 +0000 |
commit | 3ba0f3c0fb4474f4fc63c57cb7f533b97adf3064 (patch) | |
tree | 6465493c214953cc5112f9064025e3b90b0b77b8 /llvm/test/tools/llvm-objdump/X86 | |
parent | b61910bbe89b70ab5f0f415445a05d35164e33e5 (diff) | |
download | bcm5719-llvm-3ba0f3c0fb4474f4fc63c57cb7f533b97adf3064.tar.gz bcm5719-llvm-3ba0f3c0fb4474f4fc63c57cb7f533b97adf3064.zip |
[llvm-objdump] - Print symbol addressed when dumping disassembly output (-d)
When GNU objdump dumps the input with -d it prints the symbol addresses,
for example:
0000000000000031 <foo>:
31: 00 00 add %al,(%rax)
...
llvm-objdump currently does not do that.
Patch changes the behavior to match the GNU objdump.
That is useful for implementing -z/--disassemble-zeroes (D56083),
it allows omitting first zero bytes and keep the information
about the symbol address in the output.
Differential revision: https://reviews.llvm.org/D56123
llvm-svn: 350726
Diffstat (limited to 'llvm/test/tools/llvm-objdump/X86')
-rw-r--r-- | llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s b/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s new file mode 100644 index 00000000000..9c5b23ecc0b --- /dev/null +++ b/llvm/test/tools/llvm-objdump/X86/print-symbol-addr.s @@ -0,0 +1,29 @@ +// RUN: llvm-mc %s -filetype=obj -triple=x86_64-pc-linux -o %t.o + +// Check we print the address of `foo` and `bar`. +// RUN: llvm-objdump -d %t.o | FileCheck %s +// CHECK: Disassembly of section .text: +// CHECK-NEXT: 0000000000000000 foo: +// CHECK-NEXT: 0: {{.*}} nop +// CHECK-NEXT: 1: {{.*}} nop +// CHECK: 0000000000000002 bar: +// CHECK-NEXT: 2: {{.*}} nop + +// Check we do not print the addresses with -no-leading-addr. +// RUN: llvm-objdump -d -no-leading-addr %t.o | FileCheck %s --check-prefix=NOADDR +// NOADDR: Disassembly of section .text: +// NOADDR-NEXT: {{^}}foo: +// NOADDR-NEXT: {{.*}} nop +// NOADDR-NEXT: {{.*}} nop +// NOADDR: {{^}}bar: +// NOADDR-NEXT: {{.*}} nop + +.text +.globl foo +.type foo, @function +foo: + nop + nop + +bar: + nop |