File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/x86-64 Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ class ELFLinkGraphBuilder_x86_64 : public ELFLinkGraphBuilder<object::ELF64LE> {
159159 case ELF::R_X86_64_32:
160160 Kind = x86_64::Pointer32;
161161 break ;
162+ case ELF::R_X86_64_16:
163+ Kind = x86_64::Pointer16;
164+ break ;
162165 case ELF::R_X86_64_32S:
163166 Kind = x86_64::Pointer32Signed;
164167 break ;
Original file line number Diff line number Diff line change 1+ # RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \
2+ # RUN: -filetype=obj -o %t.o %s
3+ # RUN: llvm-jitlink -noexec -abs X=0x1234 -check=%s %t.o
4+ # RUN: not llvm-jitlink -noexec -abs X=0x12345 %t.o 2>&1 | \
5+ # RUN: FileCheck -check-prefix=CHECK-ERROR %s
6+ #
7+ # Check success and failure cases of R_X86_64_16 handling.
8+
9+ # jitlink-check: *{8}P = X
10+
11+ # CHECK-ERROR: relocation target "X" {{.*}} is out of range of Pointer16 fixup
12+
13+ .text
14+ .section .text .main,"ax" ,@progbits
15+ .globl main
16+ .p2align 4 , 0x90
17+ .type main,@function
18+ main:
19+ xorl %eax , %eax
20+ retq
21+ .Lfunc_end0:
22+ .size main, .Lfunc_end0-main
23+
24+ .type P,@object
25+ .data
26+ .globl P
27+ .p2align 1 , 0x0
28+ P:
29+ .short X # Using short here generates R_X86_64_16.
30+ .short 0
31+ .short 0
32+ .short 0
33+ .size P, 8
You can’t perform that action at this time.
0 commit comments