summaryrefslogtreecommitdiff
path: root/test/ExecutionEngine
diff options
context:
space:
mode:
authorFrederich Munch <colsebas@hotmail.com>2018-02-21 17:18:20 +0000
committerFrederich Munch <colsebas@hotmail.com>2018-02-21 17:18:20 +0000
commit2bbb2bdf2e80a1eccbd3f69dbd27b7bff2ea0f3f (patch)
treeb632210f637f11567cfac1f5a5797f4279c74bbb /test/ExecutionEngine
parentbde3a9181191e8525fbdcdc2890eaf33e63fc87d (diff)
Handle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF
Summary: IMAGE_REL_AMD64_ADDR32NB relocations are currently set to zero in all cases. This patch sets the relocation to the correct value when possible and shows an error when not. Reviewers: enderby, lhames, compnerd Reviewed By: compnerd Subscribers: LepelTsmok, compnerd, martell, llvm-commits Differential Revision: https://reviews.llvm.org/D30709 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine')
-rw-r--r--test/ExecutionEngine/RuntimeDyld/X86/COFF_x86_64_IMGREL.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ExecutionEngine/RuntimeDyld/X86/COFF_x86_64_IMGREL.s b/test/ExecutionEngine/RuntimeDyld/X86/COFF_x86_64_IMGREL.s
new file mode 100644
index 00000000000..8f7e2043218
--- /dev/null
+++ b/test/ExecutionEngine/RuntimeDyld/X86/COFF_x86_64_IMGREL.s
@@ -0,0 +1,26 @@
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: llvm-mc -triple=x86_64-pc-win32 -filetype=obj -o %t/COFF_x86_64_IMGREL.o %s
+# RUN: llvm-rtdyld -triple=x86_64-pc-win32 -verify -check=%s %t/COFF_x86_64_IMGREL.o
+.text
+ .def F;
+ .scl 2;
+ .type 32;
+ .endef
+ .globl __constdata
+
+.section .rdata, "dr", discard, __constdata
+ .align 8
+ __constdata:
+ .quad 0
+
+.text
+ .globl F
+ .align 16, 0x90
+
+F: # @F
+# rtdyld-check: decode_operand(inst1, 3) = section_addr(COFF_x86_64_IMGREL.o, .text)+0
+inst1:
+ mov %ebx, F@IMGREL
+# rtdyld-check: decode_operand(inst2, 3) = section_addr(COFF_x86_64_IMGREL.o, .rdata)+5
+inst2:
+ mov %ebx, (__constdata@imgrel+5)