2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: ld.lld -shared %t.o -o %t.so
4 # RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s
5 # RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=REL %s
6 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s
8 # SEC: .got PROGBITS 0000000000002348 000348 000010 00 WA 0 0 8
10 ## Dynamic relocations for non-preemptable symbols in a shared object have section index 0.
12 # REL-NEXT: 0x2348 R_X86_64_TPOFF64 - 0x0
13 # REL-NEXT: 0x2350 R_X86_64_TPOFF64 - 0x4
16 ## &.got[0] - 0x127f = 0x2348 - 0x127f = 4297
17 ## &.got[1] - 0x1286 = 0x2350 - 0x1286 = 4298
18 ## &.got[2] - 0x128e = 0x2348 - 0x128e = 4282
19 ## &.got[3] - 0x1296 = 0x2350 - 0x1296 = 4282
21 # CHECK: 1278: addq 4297(%rip), %rax
22 # CHECK-NEXT: 127f: addq 4298(%rip), %rax
23 # CHECK-NEXT: 1286: addq 4282(%rip), %r16
24 # CHECK-NEXT: 128e: addq 4282(%rip), %r16
26 addq foo@GOTTPOFF
(%rip
), %rax
27 addq bar@GOTTPOFF
(%rip
), %rax
28 addq foo@GOTTPOFF
(%rip
), %r16
29 addq bar@GOTTPOFF
(%rip
), %r16
32 .section .tbss,"awT",@nobits