33 lines · plain
1// REQUIRES: x862 3// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o4// RUN: ld.lld -shared --pack-dyn-relocs=android %t.o -o %t.so5// RUN: llvm-readobj -r %t.so | FileCheck %s6 7// Bug 37841: Symbol::getVA must work on TLS symbols during the layout loop in8// finalizeSections. This test uses an atypical IE access in a shared object to9// access a local TLS symbol, because a more typical access would avoid the10// bug.11 12 .globl foo13foo:14 movq tlsvar@GOTTPOFF(%rip), %rcx15 movq tlsvar2@GOTTPOFF(%rip), %r3116 addq tlsvar3@GOTTPOFF(%rip), %rcx, %r1617 18 19 .section .tdata,"awT",@progbits20 .space 0x123421tlsvar:22 .word 4223tlsvar2:24 .word 4225tlsvar3:26 .word 4227 28// CHECK: Section ({{.+}}) .rela.dyn {29// CHECK-NEXT: R_X86_64_TPOFF64 - 0x123430// CHECK-NEXT: R_X86_64_TPOFF64 - 0x123631// CHECK-NEXT: R_X86_64_TPOFF64 - 0x123832// CHECK-NEXT: }33