[PATCH] D112843: [aarch64/mac] Correctly disassemble @TLVPPAGE(OFF) relocs
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 9 07:41:39 PST 2021
thakis updated this revision to Diff 385816.
thakis marked an inline comment as done.
thakis added a comment.
Herald added a subscriber: rupprecht.
Herald added a reviewer: jhenderson.
move test
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112843/new/
https://reviews.llvm.org/D112843
Files:
llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
llvm/test/MC/AArch64/arm64-tls-modifiers-darwin.s
llvm/test/tools/llvm-objdump/MachO/Inputs/macho-tlv.o
llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test
Index: llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test
@@ -0,0 +1,18 @@
+; %p/Inputs/macho-tlv.o was created with
+; `llvm-mc -triple=arm64-apple-ios7.0 -filetype=obj tlv.s` with this tlv.s:
+; adrp x2, _var at TLVPPAGE
+; ldr x0, [x15, _var at TLVPPAGEOFF]
+; add x30, x0, _var at TLVPPAGEOFF
+
+; RUN: llvm-objdump -r %p/Inputs/macho-tlv.o \
+; RUN: | FileCheck %s --check-prefix=CHECK-OBJ
+; RUN: llvm-otool -tV %p/Inputs/macho-tlv.o \
+; RUN: | FileCheck %s --check-prefix=CHECK-DIS
+
+; CHECK-OBJ: 8 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
+; CHECK-OBJ: 4 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
+; CHECK-OBJ: 0 ARM64_RELOC_TLVP_LOAD_PAGE21 _var
+
+; CHECK-DIS: 0000000000000000 adrp x2, _var at TLVPPAGE
+; CHECK-DIS-NEXT: 0000000000000004 ldr x0, [x15, _var at TLVPPAGEOFF]
+; CHECK-DIS-NEXT: 0000000000000008 add x30, x0, _var at TLVPPAGEOFF
Index: llvm/test/MC/AArch64/arm64-tls-modifiers-darwin.s
===================================================================
--- llvm/test/MC/AArch64/arm64-tls-modifiers-darwin.s
+++ llvm/test/MC/AArch64/arm64-tls-modifiers-darwin.s
@@ -1,5 +1,4 @@
; RUN: llvm-mc -triple=arm64-apple-ios7.0 %s -o - | FileCheck %s
-; RUN: llvm-mc -triple=arm64-apple-ios7.0 -filetype=obj %s -o - | llvm-objdump -r - | FileCheck %s --check-prefix=CHECK-OBJ
adrp x2, _var at TLVPPAGE
ldr x0, [x15, _var at TLVPPAGEOFF]
@@ -7,7 +6,3 @@
; CHECK: adrp x2, _var at TLVPPAG
; CHECK: ldr x0, [x15, _var at TLVPPAGEOFF]
; CHECK: add x30, x0, _var at TLVPPAGEOFF
-
-; CHECK-OBJ: 8 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
-; CHECK-OBJ: 4 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
-; CHECK-OBJ: 0 ARM64_RELOC_TLVP_LOAD_PAGE21 _var
Index: llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
===================================================================
--- llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
+++ llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
@@ -34,7 +34,9 @@
case LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF:
return MCSymbolRefExpr::VK_GOTPAGEOFF;
case LLVMDisassembler_VariantKind_ARM64_TLVP:
+ return MCSymbolRefExpr::VK_TLVPPAGE;
case LLVMDisassembler_VariantKind_ARM64_TLVOFF:
+ return MCSymbolRefExpr::VK_TLVPPAGEOFF;
default:
llvm_unreachable("bad LLVMDisassembler_VariantKind");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112843.385816.patch
Type: text/x-patch
Size: 2504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211109/30e2bb16/attachment.bin>
More information about the llvm-commits
mailing list