1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \
3 # RUN: -large-code-model -o %t/elf_lg_pic_reloc.o %s
4 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \
5 # RUN: -check %s %t/elf_lg_pic_reloc.o
7 # Test ELF large/PIC relocations.
12 # Empty main entry point.
21 # Test R_X86_64_GOTPC64 handling. We want to check that the offset of the
22 # operand is the 64-bit delta to the start of the GOT.
23 # jitlink-check: decode_operand(test_gotpc64, 1) = \
24 # jitlink-check: _GLOBAL_OFFSET_TABLE_ - test_lg_pic_GOT
25 # jitlink-check: decode_operand(test_got64, 1) = \
26 # jitlink-check: got_addr(elf_lg_pic_reloc.o, named_data) - \
27 # jitlink-check: _GLOBAL_OFFSET_TABLE_
28 .globl test_lg_pic_GOT
30 .type test_lg_pic_GOT,@function
33 leaq
.L0$pb(%rip), %rax
37 movabsq $_GLOBAL_OFFSET_TABLE_-
.L0$pb, %rcx
38 .size test_gotpc64, .-test_gotpc64
43 movabsq $named_data@GOT
, %rax
44 .size test_got64, .-test_got64
46 .size test_lg_pic_GOT, .-test_lg_pic_GOT
50 .type named_data,@object
56 .ident "clang version 10.0.0-4ubuntu1 "
57 .section ".note.GNU-stack","",@progbits