-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JITLink][x86-64] Implement ELF::R_X86_64_16.
We already had an x86_64::Pointer16 edge kind courtesy of Sunho's COFF/x86-64 work, it just needed to be wired up.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_16.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ | ||
# RUN: -filetype=obj -o %t.o %s | ||
# RUN: llvm-jitlink -noexec -abs X=0x1234 -check=%s %t.o | ||
# RUN: not llvm-jitlink -noexec -abs X=0x12345 %t.o 2>&1 | \ | ||
# RUN: FileCheck -check-prefix=CHECK-ERROR %s | ||
# | ||
# Check success and failure cases of R_X86_64_16 handling. | ||
|
||
# jitlink-check: *{8}P = X | ||
|
||
# CHECK-ERROR: relocation target "X" {{.*}} is out of range of Pointer16 fixup | ||
|
||
.text | ||
.section .text.main,"ax",@progbits | ||
.globl main | ||
.p2align 4, 0x90 | ||
.type main,@function | ||
main: | ||
xorl %eax, %eax | ||
retq | ||
.Lfunc_end0: | ||
.size main, .Lfunc_end0-main | ||
|
||
.type P,@object | ||
.data | ||
.globl P | ||
.p2align 1, 0x0 | ||
P: | ||
.short X # Using short here generates R_X86_64_16. | ||
.short 0 | ||
.short 0 | ||
.short 0 | ||
.size P, 8 |