]> granicus.if.org Git - llvm/commitdiff
Re-apply r364600 with fixes.
authorLang Hames <lhames@gmail.com>
Fri, 28 Jun 2019 18:36:59 +0000 (18:36 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 28 Jun 2019 18:36:59 +0000 (18:36 +0000)
Fix: MachO/X86_64_RELOC_GOT is a 32-bit reloc, so only compare 32 bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364672 91177308-0d34-0410-b5e6-96231b3b80d8

test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s

index c1792f65b8ba1e08b7435158f2e808986225e92c..1958ae13b1ff518764b84fe838105992d05bbb37 100644 (file)
@@ -129,6 +129,18 @@ Lanon_minuend_quad:
 Lanon_minuend_long:
         .long Lanon_minuend_long - named_data + 2
 
+# Check X86_64_RELOC_GOT handling.
+# X86_64_RELOC_GOT is the data-section counterpart to X86_64_RELOC_GOTLD. It is
+# handled exactly the same way, including having an implicit PC-rel offset of -4
+# (despite this not making sense in a data section, and requiring an explicit
+# +4 addend to cancel it out and get the correct result).
+#
+# jitlink-check: *{4}test_got = (got_addr(macho_reloc.o, external_data) - test_got)[31:0]
+        .globl test_got
+        .p2align  2
+test_got:
+        .long   external_data@GOTPCREL + 4
+
 # Named quad storage target (first named atom in __data).
         .globl named_data
         .p2align  3