Ryan Prichard | 1c33d14 | 2018-09-18 00:24:48 | [diff] [blame] | 1 | // REQUIRES: x86 |
| 2 | |
| 3 | // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o |
| 4 | // RUN: ld.lld -shared --pack-dyn-relocs=android %t.o -o %t.so |
Fangrui Song | b159906 | 2019-05-01 05:49:01 | [diff] [blame^] | 5 | // RUN: llvm-readobj -r %t.so | FileCheck %s |
Ryan Prichard | 1c33d14 | 2018-09-18 00:24:48 | [diff] [blame] | 6 | |
| 7 | // Bug 37841: Symbol::getVA must work on TLS symbols during the layout loop in |
| 8 | // finalizeSections. This test uses an atypical IE access in a shared object to |
| 9 | // access a local TLS symbol, because a more typical access would avoid the |
| 10 | // bug. |
| 11 | |
| 12 | .globl foo |
| 13 | foo: |
| 14 | movq tlsvar@GOTTPOFF(%rip), %rcx |
| 15 | |
| 16 | .section .tdata,"awT",@progbits |
| 17 | .space 0x1234 |
| 18 | tlsvar: |
| 19 | .word 42 |
| 20 | |
| 21 | // CHECK: Section ({{.+}}) .rela.dyn { |
| 22 | // CHECK-NEXT: R_X86_64_TPOFF64 - 0x1234 |
| 23 | // CHECK-NEXT: } |