[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / x86-64-tls-pie.s
blob71caa0f49803d60af7663fe19f16890c83ce7e6f
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 --check-prefix=RELOCS %s
5 # RUN: llvm-objdump -d --no-show-raw-insn --no-print-imm-hex --no-leading-addr %t1.o | FileCheck --check-prefix=DIS %s
7 # Bug 27174: R_X86_64_TPOFF32 and R_X86_64_GOTTPOFF relocations should
8 # be eliminated when building a PIE executable, as the static TLS layout
9 # is fixed.
11 # RELOCS: Relocations [
12 # RELOCS-NEXT: ]
14 # DIS: <_start>:
15 # DIS-NEXT: movq %fs:0, %rax
16 # DIS-NEXT: movl $3, (%rax)
17 # DIS-NEXT: movq %fs:0, %rdx
18 # DIS-NEXT: movq (%rip), %rcx
19 # DIS-NEXT: movl $3, (%rdx,%rcx)
20 # DIS-NEXT: movabsq 0, %rax
22 .globl _start
23 _start:
24 movq %fs:0, %rax
25 movl $3, i@TPOFF(%rax)
27 movq %fs:0, %rdx
28 movq i@GOTTPOFF(%rip), %rcx
29 movl $3, (%rdx,%rcx)
31 # This additionally tests support for R_X86_64_TPOFF64 relocations.
32 movabs i@TPOFF, %rax
34 .section .tbss.i,"awT",@nobits
35 .globl i
37 .long 0
38 .size i, 4