60 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \3# RUN: -filetype=obj -large-code-model -o %t/elf_lg_pic_reloc.o %s4# RUN: llvm-jitlink -noexec \5# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \6# RUN: -check %s %t/elf_lg_pic_reloc.o7#8# Test ELF large/PIC relocations.9 10 .text11 .file "testcase.c"12 13 # Empty main entry point.14 .globl main15 .p2align 4, 0x9016 .type main,@function17main:18 retq19 20 .size main, .-main21 22# Test R_X86_64_GOTPC64 handling. We want to check that the offset of the23# operand is the 64-bit delta to the start of the GOT.24# jitlink-check: decode_operand(test_gotpc64, 1) = \25# jitlink-check: _GLOBAL_OFFSET_TABLE_ - test_lg_pic_GOT26# jitlink-check: decode_operand(test_got64, 1) = \27# jitlink-check: got_addr(elf_lg_pic_reloc.o, named_data) - \28# jitlink-check: _GLOBAL_OFFSET_TABLE_29 .globl test_lg_pic_GOT30 .p2align 4, 0x9031 .type test_lg_pic_GOT,@function32test_lg_pic_GOT:33.L0$pb:34 leaq .L0$pb(%rip), %rax35 36 .globl test_gotpc6437test_gotpc64:38 movabsq $_GLOBAL_OFFSET_TABLE_-.L0$pb, %rcx39 .size test_gotpc64, .-test_gotpc6440 41 addq %rax, %rcx42 .globl test_got6443test_got64:44 movabsq $named_data@GOT, %rax45 .size test_got64, .-test_got6446 47 .size test_lg_pic_GOT, .-test_lg_pic_GOT48 49 .data50 51 .type named_data,@object52 .p2align 353named_data:54 .quad 4255 .size named_data, 856 57 .ident "clang version 10.0.0-4ubuntu1 "58 .section ".note.GNU-stack","",@progbits59 .addrsig60