summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-08-03 20:17:10 +0000
committerLang Hames <lhames@gmail.com>2019-08-03 20:17:10 +0000
commit3daccaac8a6b261eaedf76e6eac6011295b08d7e (patch)
treeeb1fb1d915a3df96e9ab2c7bcb7fcfa8ce92b045 /llvm/test/ExecutionEngine
parentb31229af4f4a5aa3c0a14b38341d449f8e988242 (diff)
downloadbcm5719-llvm-3daccaac8a6b261eaedf76e6eac6011295b08d7e.tar.gz
bcm5719-llvm-3daccaac8a6b261eaedf76e6eac6011295b08d7e.zip
[JITLink] Add support for MachO/x86-64 UNSIGNED relocs with length=2.
MachO/x86-64 UNSIGNED relocs are almost always 64-bit (length=3), but UNSIGNED relocs of length=2 are allowed if the target resides in the low 32-bits. This patch adds support for such relocations in JITLink (previously they would have triggered an unsupported relocation error). llvm-svn: 367764
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s29
1 files changed, 19 insertions, 10 deletions
diff --git a/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s b/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s
index 1958ae13b1f..0fb1285db98 100644
--- a/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s
+++ b/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s
@@ -154,22 +154,31 @@ named_data:
named_data_alt_entry:
.quad 0
-# Check X86_64_RELOC_UNSIGNED / extern handling by putting the address of a
-# local named function in a pointer variable.
+# Check X86_64_RELOC_UNSIGNED / quad / extern handling by putting the address of
+# a local named function into a quad symbol.
#
-# jitlink-check: *{8}named_func_addr = named_func
- .globl named_func_addr
+# jitlink-check: *{8}named_func_addr_quad = named_func
+ .globl named_func_addr_quad
.p2align 3
-named_func_addr:
+named_func_addr_quad:
.quad named_func
-# Check X86_64_RELOC_UNSIGNED / non-extern handling by putting the address of a
-# local anonymous function in a pointer variable.
+# Check X86_64_RELOC_UNSIGNED / long / extern handling by putting the address of
+# an external function (defined to reside in the low 4Gb) into a long symbol.
#
-# jitlink-check: *{8}anon_func_addr = section_addr(macho_reloc.o, __text)
- .globl anon_func_addr
+# jitlink-check: *{8}named_func_addr_long = external_func
+ .globl named_func_addr_long
+ .p2align 2
+named_func_addr_long:
+ .long external_func
+
+# Check X86_64_RELOC_UNSIGNED / quad / non-extern handling by putting the
+# address of a local anonymous function into a quad symbol.
+#
+# jitlink-check: *{8}anon_func_addr_quad = section_addr(macho_reloc.o, __text)
+ .globl anon_func_addr_quad
.p2align 3
-anon_func_addr:
+anon_func_addr_quad:
.quad Lanon_func
# X86_64_RELOC_SUBTRACTOR Quad/Long in named storage with anonymous minuend
OpenPOWER on IntegriCloud