[lld] e7fffa6 - [llvm-objdump] Prefix memory operand addresses with '0x'
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 00:27:19 PDT 2021
Author: Igor Kudrin
Date: 2021-06-28T14:25:21+07:00
New Revision: e7fffa6f032b58d2cf04b05c3992c5195c2dfd56
URL: https://github.com/llvm/llvm-project/commit/e7fffa6f032b58d2cf04b05c3992c5195c2dfd56
DIFF: https://github.com/llvm/llvm-project/commit/e7fffa6f032b58d2cf04b05c3992c5195c2dfd56.diff
LOG: [llvm-objdump] Prefix memory operand addresses with '0x'
This helps to avoid ambiguity when the address contains only digits 0..9.
Differential Revision: https://reviews.llvm.org/D104909
Added:
Modified:
lld/test/ELF/symver.s
lld/test/ELF/wrap-no-real.s
lld/test/ELF/x86-64-gotpc-offset.s
lld/test/ELF/x86-64-gotpc-relax-nopic.s
lld/test/ELF/x86-64-plt.s
lld/test/ELF/x86-x32-plt.s
lld/test/MachO/dso-handle.s
lld/test/MachO/dylink-ordinal.s
lld/test/MachO/static-link.s
lld/test/MachO/tapi-link.s
lld/test/MachO/tlv-dylib.s
lld/test/MachO/weak-binding.s
lld/test/MachO/x86-64-reloc-signed.s
llvm/test/MC/X86/tlsdesc-64.s
llvm/test/MC/X86/tlsdesc-x32.s
llvm/test/tools/llvm-objdump/X86/disassemble-align.s
llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml
llvm/tools/llvm-objdump/llvm-objdump.cpp
Removed:
################################################################################
diff --git a/lld/test/ELF/symver.s b/lld/test/ELF/symver.s
index 7111f4264f3d0..81f10f0017fc9 100644
--- a/lld/test/ELF/symver.s
+++ b/lld/test/ELF/symver.s
@@ -75,9 +75,9 @@
# DIS3-COUNT-3: int3
# DIS3-NEXT: callq 0x1390 <foo at plt>
# DIS3-LABEL: <foo at plt>:
-# DIS3-NEXT: jmpq *{{.*}}(%rip) # 34a8
+# DIS3-NEXT: jmpq *{{.*}}(%rip) # 0x34a8
# DIS3-LABEL: <foo at plt>:
-# DIS3-NEXT: jmpq *{{.*}}(%rip) # 34b0
+# DIS3-NEXT: jmpq *{{.*}}(%rip) # 0x34b0
## Then, test the interaction with versioned definitions in shared objects.
diff --git a/lld/test/ELF/wrap-no-real.s b/lld/test/ELF/wrap-no-real.s
index 4bcde9cf24d5f..75df54be61ba5 100644
--- a/lld/test/ELF/wrap-no-real.s
+++ b/lld/test/ELF/wrap-no-real.s
@@ -9,9 +9,9 @@
// RUN: llvm-readelf -s -x .got %t | FileCheck --check-prefix=READELF --implicit-check-not=__real_ %s
// CHECK: <_start>:
-// CHECK-NEXT: movq {{.*}}(%rip), %rax # 2021a8
-// CHECK-NEXT: movq {{.*}}(%rip), %rbx # 2021a8
-// CHECK-NEXT: movq {{.*}}(%rip), %rcx # 2021b0
+// CHECK-NEXT: movq {{.*}}(%rip), %rax # 0x2021a8
+// CHECK-NEXT: movq {{.*}}(%rip), %rbx # 0x2021a8
+// CHECK-NEXT: movq {{.*}}(%rip), %rcx # 0x2021b0
// READELF: 0000000000011000 0 NOTYPE GLOBAL DEFAULT ABS foo
// READELF: 0000000000011010 0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo
@@ -23,9 +23,9 @@
// RUN: llvm-readelf -s -x .got %t2 | FileCheck --check-prefix=READELF --implicit-check-not=__real_ %s
// CHECK2: <_start>:
-// CHECK2-NEXT: movq {{.*}}(%rip), %rax # 2022e0
-// CHECK2-NEXT: movq {{.*}}(%rip), %rbx # 2022e0
-// CHECK2-NEXT: movq {{.*}}(%rip), %rcx # 2022e8
+// CHECK2-NEXT: movq {{.*}}(%rip), %rax # 0x2022e0
+// CHECK2-NEXT: movq {{.*}}(%rip), %rbx # 0x2022e0
+// CHECK2-NEXT: movq {{.*}}(%rip), %rcx # 0x2022e8
.global _start
_start:
diff --git a/lld/test/ELF/x86-64-gotpc-offset.s b/lld/test/ELF/x86-64-gotpc-offset.s
index 60b007608b96e..2e6ace5ea87f4 100644
--- a/lld/test/ELF/x86-64-gotpc-offset.s
+++ b/lld/test/ELF/x86-64-gotpc-offset.s
@@ -7,8 +7,8 @@
# CHECK-NEXT: {{^}} [[#%x,ADDR:]] {{.*}} 00000000
# CHECK: leal {{.*}}(%rip), %eax # {{.*}} <foo>
-# CHECK-NEXT: movl {{.*}}(%rip), %eax # [[#ADDR+4]]
-# CHECK-NEXT: movq {{.*}}(%rip), %rax # [[#ADDR+1]]
+# CHECK-NEXT: movl {{.*}}(%rip), %eax # 0x[[#ADDR+4]]
+# CHECK-NEXT: movq {{.*}}(%rip), %rax # 0x[[#ADDR+1]]
## movl foo at GOTPCREL(%rip), %eax
movl 0(%rip), %eax
diff --git a/lld/test/ELF/x86-64-gotpc-relax-nopic.s b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
index 81d25f9ecafb6..cd12be86c7406 100644
--- a/lld/test/ELF/x86-64-gotpc-relax-nopic.s
+++ b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
@@ -16,13 +16,13 @@
# DISASM: Disassembly of section .text:
# DISASM-EMPTY:
# DISASM-NEXT: <_start>:
-# DISASM-NEXT: 2011c8: adcl {{.*}}(%rip), %eax # 202240
-# DISASM-NEXT: addl {{.*}}(%rip), %ebx # 202240
-# DISASM-NEXT: andl {{.*}}(%rip), %ecx # 202240
-# DISASM-NEXT: cmpl {{.*}}(%rip), %edx # 202240
-# DISASM-NEXT: orl {{.*}}(%rip), %edi # 202240
-# DISASM-NEXT: sbbl {{.*}}(%rip), %esi # 202240
-# DISASM-NEXT: subl {{.*}}(%rip), %ebp # 202240
+# DISASM-NEXT: 2011c8: adcl {{.*}}(%rip), %eax # 0x202240
+# DISASM-NEXT: addl {{.*}}(%rip), %ebx # 0x202240
+# DISASM-NEXT: andl {{.*}}(%rip), %ecx # 0x202240
+# DISASM-NEXT: cmpl {{.*}}(%rip), %edx # 0x202240
+# DISASM-NEXT: orl {{.*}}(%rip), %edi # 0x202240
+# DISASM-NEXT: sbbl {{.*}}(%rip), %esi # 0x202240
+# DISASM-NEXT: subl {{.*}}(%rip), %ebp # 0x202240
# DISASM-NEXT: xorl $0x203248, %r8d
# DISASM-NEXT: testl $0x203248, %r15d
# DISASM-NEXT: 201200: adcq $0x203248, %rax
@@ -65,24 +65,24 @@
# DISASM-PIC: Disassembly of section .text:
# DISASM-PIC-EMPTY:
# DISASM-PIC-NEXT: <_start>:
-# DISASM-PIC-NEXT: 1268: adcl {{.*}}(%rip), %eax # 2380
-# DISASM-PIC-NEXT: addl {{.*}}(%rip), %ebx # 2380
-# DISASM-PIC-NEXT: andl {{.*}}(%rip), %ecx # 2380
-# DISASM-PIC-NEXT: cmpl {{.*}}(%rip), %edx # 2380
-# DISASM-PIC-NEXT: orl {{.*}}(%rip), %edi # 2380
-# DISASM-PIC-NEXT: sbbl {{.*}}(%rip), %esi # 2380
-# DISASM-PIC-NEXT: subl {{.*}}(%rip), %ebp # 2380
-# DISASM-PIC-NEXT: xorl {{.*}}(%rip), %r8d # 2380
-# DISASM-PIC-NEXT: testl %r15d, {{.*}}(%rip) # 2380
-# DISASM-PIC-NEXT: 12a0: adcq {{.*}}(%rip), %rax # 2380
-# DISASM-PIC-NEXT: addq {{.*}}(%rip), %rbx # 2380
-# DISASM-PIC-NEXT: andq {{.*}}(%rip), %rcx # 2380
-# DISASM-PIC-NEXT: cmpq {{.*}}(%rip), %rdx # 2380
-# DISASM-PIC-NEXT: orq {{.*}}(%rip), %rdi # 2380
-# DISASM-PIC-NEXT: sbbq {{.*}}(%rip), %rsi # 2380
-# DISASM-PIC-NEXT: subq {{.*}}(%rip), %rbp # 2380
-# DISASM-PIC-NEXT: xorq {{.*}}(%rip), %r8 # 2380
-# DISASM-PIC-NEXT: testq %r15, {{.*}}(%rip) # 2380
+# DISASM-PIC-NEXT: 1268: adcl {{.*}}(%rip), %eax # 0x2380
+# DISASM-PIC-NEXT: addl {{.*}}(%rip), %ebx # 0x2380
+# DISASM-PIC-NEXT: andl {{.*}}(%rip), %ecx # 0x2380
+# DISASM-PIC-NEXT: cmpl {{.*}}(%rip), %edx # 0x2380
+# DISASM-PIC-NEXT: orl {{.*}}(%rip), %edi # 0x2380
+# DISASM-PIC-NEXT: sbbl {{.*}}(%rip), %esi # 0x2380
+# DISASM-PIC-NEXT: subl {{.*}}(%rip), %ebp # 0x2380
+# DISASM-PIC-NEXT: xorl {{.*}}(%rip), %r8d # 0x2380
+# DISASM-PIC-NEXT: testl %r15d, {{.*}}(%rip) # 0x2380
+# DISASM-PIC-NEXT: 12a0: adcq {{.*}}(%rip), %rax # 0x2380
+# DISASM-PIC-NEXT: addq {{.*}}(%rip), %rbx # 0x2380
+# DISASM-PIC-NEXT: andq {{.*}}(%rip), %rcx # 0x2380
+# DISASM-PIC-NEXT: cmpq {{.*}}(%rip), %rdx # 0x2380
+# DISASM-PIC-NEXT: orq {{.*}}(%rip), %rdi # 0x2380
+# DISASM-PIC-NEXT: sbbq {{.*}}(%rip), %rsi # 0x2380
+# DISASM-PIC-NEXT: subq {{.*}}(%rip), %rbp # 0x2380
+# DISASM-PIC-NEXT: xorq {{.*}}(%rip), %r8 # 0x2380
+# DISASM-PIC-NEXT: testq %r15, {{.*}}(%rip) # 0x2380
.data
.type bar, @object
diff --git a/lld/test/ELF/x86-64-plt.s b/lld/test/ELF/x86-64-plt.s
index 53a082ed1b5ec..9309f5e0320b8 100644
--- a/lld/test/ELF/x86-64-plt.s
+++ b/lld/test/ELF/x86-64-plt.s
@@ -33,17 +33,17 @@
# DISASM1: Disassembly of section .plt:
# DISASM1-EMPTY:
# DISASM1-NEXT: <.plt>:
-# DISASM1-NEXT: 2012e0: pushq 8450(%rip) # 2033e8
-# DISASM1-NEXT: jmpq *8452(%rip) # 2033f0
+# DISASM1-NEXT: 2012e0: pushq 8450(%rip) # 0x2033e8
+# DISASM1-NEXT: jmpq *8452(%rip) # 0x2033f0
# DISASM1-NEXT: nopl (%rax)
# DISASM1-EMPTY:
# DISASM1-NEXT: <bar at plt>:
-# DISASM1-NEXT: 2012f0: jmpq *8450(%rip) # 2033f8
+# DISASM1-NEXT: 2012f0: jmpq *8450(%rip) # 0x2033f8
# DISASM1-NEXT: pushq $0
# DISASM1-NEXT: jmp 0x2012e0 <.plt>
# DISASM1-EMPTY:
# DISASM1-NEXT: <weak at plt>:
-# DISASM1-NEXT: 201300: jmpq *8442(%rip) # 203400
+# DISASM1-NEXT: 201300: jmpq *8442(%rip) # 0x203400
# DISASM1-NEXT: pushq $1
# DISASM1-NEXT: jmp 0x2012e0 <.plt>
# DISASM1-NOT: {{.}}
@@ -51,17 +51,17 @@
# DISASM2: Disassembly of section .plt:
# DISASM2-EMPTY:
# DISASM2-NEXT: <.plt>:
-# DISASM2-NEXT: 1310: pushq 8434(%rip) # 3408
-# DISASM2-NEXT: jmpq *8436(%rip) # 3410
+# DISASM2-NEXT: 1310: pushq 8434(%rip) # 0x3408
+# DISASM2-NEXT: jmpq *8436(%rip) # 0x3410
# DISASM2-NEXT: nopl (%rax)
# DISASM2-EMPTY:
# DISASM2-NEXT: <bar at plt>:
-# DISASM2-NEXT: 1320: jmpq *8434(%rip) # 3418
+# DISASM2-NEXT: 1320: jmpq *8434(%rip) # 0x3418
# DISASM2-NEXT: pushq $0
# DISASM2-NEXT: jmp 0x1310 <.plt>
# DISASM2-EMPTY:
# DISASM2-NEXT: <weak at plt>:
-# DISASM2-NEXT: 1330: jmpq *8426(%rip) # 3420
+# DISASM2-NEXT: 1330: jmpq *8426(%rip) # 0x3420
# DISASM2-NEXT: pushq $1
# DISASM2-NEXT: jmp 0x1310 <.plt>
# DISASM2-NOT: {{.}}
diff --git a/lld/test/ELF/x86-x32-plt.s b/lld/test/ELF/x86-x32-plt.s
index 145c15dfe164e..8c6569fffa41c 100644
--- a/lld/test/ELF/x86-x32-plt.s
+++ b/lld/test/ELF/x86-x32-plt.s
@@ -23,17 +23,17 @@
# DISASM: Disassembly of section .plt:
# DISASM-EMPTY:
# DISASM-NEXT: <.plt>:
-# DISASM-NEXT: 2011e0: pushq 8346(%rip) # 203280
-# DISASM-NEXT: jmpq *8348(%rip) # 203288
+# DISASM-NEXT: 2011e0: pushq 8346(%rip) # 0x203280
+# DISASM-NEXT: jmpq *8348(%rip) # 0x203288
# DISASM-NEXT: nopl (%rax)
# DISASM-EMPTY:
# DISASM-NEXT: <bar at plt>:
-# DISASM-NEXT: 2011f0: jmpq *8346(%rip) # 203290
+# DISASM-NEXT: 2011f0: jmpq *8346(%rip) # 0x203290
# DISASM-NEXT: pushq $0
# DISASM-NEXT: jmp 0x2011e0 <.plt>
# DISASM-EMPTY:
# DISASM-NEXT: <weak at plt>:
-# DISASM-NEXT: 201200: jmpq *8338(%rip) # 203298
+# DISASM-NEXT: 201200: jmpq *8338(%rip) # 0x203298
# DISASM-NEXT: pushq $1
# DISASM-NEXT: jmp 0x2011e0 <.plt>
# DISASM-NOT: {{.}}
diff --git a/lld/test/MachO/dso-handle.s b/lld/test/MachO/dso-handle.s
index 16fc535cf8b07..2104d1dcf75ae 100644
--- a/lld/test/MachO/dso-handle.s
+++ b/lld/test/MachO/dso-handle.s
@@ -3,13 +3,13 @@
# RUN: %lld -lSystem %t.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
-# CHECK: leaq {{.*}} # 100000000
-# CHECK-NEXT: leaq {{.*}} # 100000000
+# CHECK: leaq {{.*}} # 0x100000000
+# CHECK-NEXT: leaq {{.*}} # 0x100000000
# RUN: %lld -dylib %t.o -o %t.dylib
# RUN: llvm-objdump -d --no-show-raw-insn --rebase --section-headers %t.dylib | FileCheck %s --check-prefix=DYLIB-CHECK
-# DYLIB-CHECK: leaq {{.*}} # 0
-# DYLIB-CHECK-NEXT: leaq {{.*}} # 0
+# DYLIB-CHECK: leaq {{.*}} # 0x0
+# DYLIB-CHECK-NEXT: leaq {{.*}} # 0x0
# DYLIB-LABEL: Sections:
# DYLIB: __data 00000008 [[#%x,DATA:]] DATA
diff --git a/lld/test/MachO/dylink-ordinal.s b/lld/test/MachO/dylink-ordinal.s
index 26a988f312669..9dcdaccf7cb9f 100644
--- a/lld/test/MachO/dylink-ordinal.s
+++ b/lld/test/MachO/dylink-ordinal.s
@@ -10,8 +10,8 @@
# CHECK: callq 0x[[#%x,FOO_OFF:]]
# CHECK-NEXT: callq 0x[[#%x,BAR_OFF:]]
-# CHECK: [[#%x,BAR_OFF]]: jmpq {{.*}} # [[#%x,BAR_BIND:]]
-# CHECK: [[#%x,FOO_OFF]]: jmpq {{.*}} # [[#%x,FOO_BIND:]]
+# CHECK: [[#%x,BAR_OFF]]: jmpq {{.*}} # 0x[[#%x,BAR_BIND:]]
+# CHECK: [[#%x,FOO_OFF]]: jmpq {{.*}} # 0x[[#%x,FOO_BIND:]]
# CHECK-LABEL: Lazy bind table:
# CHECK-DAG: __DATA __la_symbol_ptr 0x[[#%x,FOO_BIND]] Foo _foo
diff --git a/lld/test/MachO/static-link.s b/lld/test/MachO/static-link.s
index 1306aa60a8b02..b3e197cda80df 100644
--- a/lld/test/MachO/static-link.s
+++ b/lld/test/MachO/static-link.s
@@ -15,7 +15,7 @@
# CHECK: Disassembly of section __TEXT,__text
# CHECK-LABEL: <_main>:
-# CHECK: leaq {{.*}}(%rip), %rsi # [[ADDR]] <_goodbye_world>
+# CHECK: leaq {{.*}}(%rip), %rsi # 0x[[ADDR]] <_goodbye_world>
.section __TEXT,__text
.global _main
diff --git a/lld/test/MachO/tapi-link.s b/lld/test/MachO/tapi-link.s
index 786aca68c8905..8e073b844f7df 100644
--- a/lld/test/MachO/tapi-link.s
+++ b/lld/test/MachO/tapi-link.s
@@ -14,7 +14,7 @@
# RUN: llvm-objdump --bind --no-show-raw-insn -d -r %t/with-reexport | FileCheck %s
# CHECK: Disassembly of section __TEXT,__text:
-# CHECK: movq {{.*}} # [[ADDR:[0-9a-f]+]]
+# CHECK: movq {{.*}} # 0x[[ADDR:[0-9a-f]+]]
# CHECK: Bind table:
# CHECK-DAG: __DATA_CONST __got 0x[[ADDR]] pointer 0 libSystem ___nan
diff --git a/lld/test/MachO/tlv-dylib.s b/lld/test/MachO/tlv-dylib.s
index c41f152eb16fa..7a083615492f8 100644
--- a/lld/test/MachO/tlv-dylib.s
+++ b/lld/test/MachO/tlv-dylib.s
@@ -17,9 +17,9 @@
# RUN: %lld -lSystem -L%t -ltlv %t/test.o -o %t/test
# RUN: llvm-objdump --bind -d --no-show-raw-insn %t/test | FileCheck %s
-# CHECK: movq [[#]](%rip), %rax # [[#%x, FOO:]]
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%x, BAR:]]
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%x, BAZ:]]
+# CHECK: movq [[#]](%rip), %rax # 0x[[#%x, FOO:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%x, BAR:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%x, BAZ:]]
# CHECK-LABEL: Bind table:
# CHECK-DAG: __DATA __thread_ptrs 0x{{0*}}[[#%x, FOO]] pointer 0 libtlv _foo
diff --git a/lld/test/MachO/weak-binding.s b/lld/test/MachO/weak-binding.s
index 2b39b0ed19502..11b7562c69e97 100644
--- a/lld/test/MachO/weak-binding.s
+++ b/lld/test/MachO/weak-binding.s
@@ -19,12 +19,12 @@
# CHECK-NEXT: {{[0-9a-f]+}} {{[0-9a-f ]*[1-9a-f]+[0-9a-f ]*}}
# CHECK: <_main>:
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%X,WEAK_DY_GOT_ADDR:]]
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%X,WEAK_EXT_GOT_ADDR:]]
-# CHECK-NEXT: leaq [[#]](%rip), %rax # [[#%X,WEAK_INT_GOT_ADDR:]]
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%X,WEAK_TLV_ADDR:]]
-# CHECK-NEXT: movq [[#]](%rip), %rax # [[#%X,WEAK_DY_TLV_ADDR:]]
-# CHECK-NEXT: leaq [[#]](%rip), %rax # [[#%X,WEAK_INT_TLV_ADDR:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%X,WEAK_DY_GOT_ADDR:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%X,WEAK_EXT_GOT_ADDR:]]
+# CHECK-NEXT: leaq [[#]](%rip), %rax # 0x[[#%X,WEAK_INT_GOT_ADDR:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%X,WEAK_TLV_ADDR:]]
+# CHECK-NEXT: movq [[#]](%rip), %rax # 0x[[#%X,WEAK_DY_TLV_ADDR:]]
+# CHECK-NEXT: leaq [[#]](%rip), %rax # 0x[[#%X,WEAK_INT_TLV_ADDR:]]
# CHECK-NEXT: callq 0x{{[0-9a-f]*}}
# CHECK-NEXT: callq 0x{{[0-9a-f]*}}
# CHECK-NEXT: callq 0x{{[0-9a-f]*}}
diff --git a/lld/test/MachO/x86-64-reloc-signed.s b/lld/test/MachO/x86-64-reloc-signed.s
index 74c59529b98ad..fd12b9bff7010 100644
--- a/lld/test/MachO/x86-64-reloc-signed.s
+++ b/lld/test/MachO/x86-64-reloc-signed.s
@@ -12,18 +12,18 @@
# CHECK-LABEL: Disassembly of section
# CHECK: <_main>:
-# CHECK-NEXT: movl {{.*}} # [[#S]]
+# CHECK-NEXT: movl {{.*}} # 0x[[#S]]
# CHECK-NEXT: callq {{.*}}
-# CHECK-NEXT: movl {{.*}} # [[#S + 2]]
+# CHECK-NEXT: movl {{.*}} # 0x[[#S + 2]]
# CHECK-NEXT: callq {{.*}}
-# CHECK-NEXT: movb {{.*}} # [[#S]]
+# CHECK-NEXT: movb {{.*}} # 0x[[#S]]
# CHECK-NEXT: callq {{.*}}
# CHECK: <__not_text>:
-# CHECK-NEXT: movl {{.*}} # [[#FOO + 8]]
+# CHECK-NEXT: movl {{.*}} # 0x[[#FOO + 8]]
# CHECK-NEXT: callq {{.*}}
-# CHECK-NEXT: movl {{.*}} # [[#FOO + 8 + 2]]
+# CHECK-NEXT: movl {{.*}} # 0x[[#FOO + 8 + 2]]
# CHECK-NEXT: callq {{.*}}
-# CHECK-NEXT: movb {{.*}} # [[#FOO + 8]]
+# CHECK-NEXT: movb {{.*}} # 0x[[#FOO + 8]]
# CHECK-NEXT: callq {{.*}}
.section __TEXT,__text
diff --git a/llvm/test/MC/X86/tlsdesc-64.s b/llvm/test/MC/X86/tlsdesc-64.s
index eaec13785b3a5..ebe1710c3e869 100644
--- a/llvm/test/MC/X86/tlsdesc-64.s
+++ b/llvm/test/MC/X86/tlsdesc-64.s
@@ -9,7 +9,7 @@
# SYM: TLS GLOBAL DEFAULT UND a
-# CHECK: 0: leaq (%rip), %rax # 7 <{{.*}}>
+# CHECK: 0: leaq (%rip), %rax # 0x7 <{{.*}}>
# CHECK-NEXT: 0000000000000003: R_X86_64_GOTPC32_TLSDESC a-0x4
# CHECK-NEXT: 7: callq *(%rax)
# CHECK-NEXT: 0000000000000007: R_X86_64_TLSDESC_CALL a
diff --git a/llvm/test/MC/X86/tlsdesc-x32.s b/llvm/test/MC/X86/tlsdesc-x32.s
index a9884fb5e2ee2..836a3c5527f85 100644
--- a/llvm/test/MC/X86/tlsdesc-x32.s
+++ b/llvm/test/MC/X86/tlsdesc-x32.s
@@ -9,7 +9,7 @@
# SYM: TLS GLOBAL DEFAULT UND a
-# CHECK: 0: 40 8d 05 00 00 00 00 leal (%rip), %eax # 7 <{{.*}}>
+# CHECK: 0: 40 8d 05 00 00 00 00 leal (%rip), %eax # 0x7 <{{.*}}>
# CHECK-NEXT: 00000003: R_X86_64_GOTPC32_TLSDESC a-0x4
# CHECK-NEXT: 7: 67 ff 10 callq *(%eax)
# CHECK-NEXT: 00000007: R_X86_64_TLSDESC_CALL a
diff --git a/llvm/test/tools/llvm-objdump/X86/disassemble-align.s b/llvm/test/tools/llvm-objdump/X86/disassemble-align.s
index 17809d88bfbf4..d3ccc59e64ecc 100644
--- a/llvm/test/tools/llvm-objdump/X86/disassemble-align.s
+++ b/llvm/test/tools/llvm-objdump/X86/disassemble-align.s
@@ -10,14 +10,14 @@
# Instructions are expected to be aligned if the instruction in hex is not too long.
# CHECK: 0: c3 |retq
-# CHECK-NEXT: 1: 48 8b 05 56 34 12 00 |movq|0x123456(%rip), %rax # 12345e <.text+0x12345e>
+# CHECK-NEXT: 1: 48 8b 05 56 34 12 00 |movq|0x123456(%rip), %rax # 0x12345e <.text+0x12345e>
# CHECK-NEXT: 8: 48 b8 54 55 55 55 55 55 55 55|movabsq|$0x5555555555555554, %rax # imm = 0x5555555555555554
# CHECK-NEXT: 12: 8f ea 00 12 4c 02 40 00 00 00 00 |lwpval|$0x0, 0x40(%rdx,%rax), %r15d
# CHECK-NEXT: 1d: 8f ea 00 12 04 25 f0 1c f0 1c 00 00 00 00 |lwpins|$0x0, 0x1cf01cf0, %r15d
# CHECK-NEXT: 2b: ff ff |<unknown>
# NORAW: 0: |retq
-# NORAW-NEXT: 1: |movq|0x123456(%rip), %rax # 12345e <.text+0x12345e>
+# NORAW-NEXT: 1: |movq|0x123456(%rip), %rax # 0x12345e <.text+0x12345e>
# NORAW-NEXT: 8: |movabsq|$0x5555555555555554, %rax # imm = 0x5555555555555554
# NORAW-NEXT: 12: |lwpval|$0x0, 0x40(%rdx,%rax), %r15d
# NORAW-NEXT: 1d: |lwpins|$0x0, 0x1cf01cf0, %r15d
diff --git a/llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s b/llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
index e913f5f6a3454..3012b0de69d24 100644
--- a/llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
+++ b/llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
@@ -2,7 +2,7 @@
# CHECK: <PR48901>:
# TODO: Should display data16 prefixes.
-# CHECK-NEXT: 0: 66 48 8d 3d 00 00 00 00 leaq (%rip), %rdi # 8 <PR48901+0x8>
+# CHECK-NEXT: 0: 66 48 8d 3d 00 00 00 00 leaq (%rip), %rdi # 0x8 <PR48901+0x8>
# CHECK-NEXT: 8: 66 66 48 e8 00 00 00 00 callq 0x10 <PR48901+0x10>
# CHECK-EMPTY:
diff --git a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml
index a7ec7a2997e5f..b0845fcb6b587 100644
--- a/llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml
+++ b/llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml
@@ -7,7 +7,7 @@
# EXEC-LABEL: <third>:
# EXEC-NEXT: 4005: e8 12 34 56 78 callq 0x7856741c <data1+0x7856241c>
# EXEC-LABEL: <fourth>:
-# EXEC-NEXT: 400a: 8b 05 f0 0f 00 00 movl 4080(%rip), %eax # 5000 <data1>
+# EXEC-NEXT: 400a: 8b 05 f0 0f 00 00 movl 4080(%rip), %eax # 0x5000 <data1>
--- !ELF
FileHeader:
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 0fd388da37713..c75d0e482dbc3 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1444,7 +1444,7 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj,
PrintTarget = true;
// Do not print real address when symbolizing.
if (!SymbolizeOperands)
- FOS << " # " << Twine::utohexstr(Target);
+ FOS << " # 0x" << Twine::utohexstr(Target);
}
if (PrintTarget) {
// In a relocatable object, the target's section must reside in
More information about the llvm-commits
mailing list