[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / x86-64-tls-pie.s
blob5ef0f54f435d0ce173e9363a52403b276c347781
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-cloudabi %s -o %t1.o
3 # RUN: ld.lld -pie %t1.o -o %t
4 # RUN: llvm-readobj -r %t | FileCheck %s
6 # Bug 27174: R_X86_64_TPOFF32 and R_X86_64_GOTTPOFF relocations should
7 # be eliminated when building a PIE executable, as the static TLS layout
8 # is fixed.
10 # CHECK: Relocations [
11 # CHECK-NEXT: ]
13 .globl _start
14 _start:
15 movq %fs:0, %rax
16 movl $3, i@TPOFF(%rax)
18 movq %fs:0, %rdx
19 movq i@GOTTPOFF(%rip), %rcx
20 movl $3, (%rdx,%rcx)
22 .section .tbss.i,"awT",@nobits
23 .globl i
25 .long 0
26 .size i, 4