1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=i386-unknown-linux-gnu -position-independent \
3 # RUN: -filetype=obj -o %t/elf_sm_pic_reloc_got.o %s
4 # RUN: llvm-jitlink -noexec \
5 # RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6 # RUN: -check %s %t/elf_sm_pic_reloc_got.o
8 # Test ELF small/PIC GOT relocations.
19 # Test GOT32 handling.
21 # We want to check both the offset to the GOT entry and its contents.
22 # jitlink-check: decode_operand(test_got, 4) = got_addr(elf_sm_pic_reloc_got.o, named_data1) - _GLOBAL_OFFSET_TABLE_
23 # jitlink-check: *{4}(got_addr(elf_sm_pic_reloc_got.o, named_data1)) = named_data1
25 # jitlink-check: decode_operand(test_got+6, 4) = got_addr(elf_sm_pic_reloc_got.o, named_data2) - _GLOBAL_OFFSET_TABLE_
26 # jitlink-check: *{4}(got_addr(elf_sm_pic_reloc_got.o, named_data2)) = named_data2
30 .type test_got,@function
32 leal named_data1@GOT
, %eax
33 leal named_data2@GOT
, %eax
34 .size test_got, .-test_got
38 # Test GOTOFF64 handling.
39 # jitlink-check: decode_operand(test_gotoff, 1) = named_func - _GLOBAL_OFFSET_TABLE_
42 .type test_gotoff,@function
44 mov $named_func@GOTOFF
, %eax
45 .size test_gotoff, .-test_gotoff
50 .type named_func,@function
53 .size named_func, .-named_func
58 .type named_data1,@object
64 .type named_data2,@object