2 # RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s
5 # RUN: llvm-readobj -S -r %t | FileCheck -check-prefix=RELOC %s
7 #Local-Dynamic to Local-Exec relax creates no
11 ## Reject local-exec TLS relocations for -shared.
12 # RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
14 # ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v1 cannot be used with -shared
15 # ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v1 cannot be used with -shared
16 # ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v2 cannot be used with -shared
17 # ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v2 cannot be used with -shared
22 add x0
, x0
, :tprel_hi12
:v1
23 add x0
, x0
, :tprel_lo12_nc
:v1
25 add x0
, x0
, :tprel_hi12
:v2
26 add x0
, x0
, :tprel_lo12_nc
:v2
28 # TCB size = 0x16 and foo is first element from TLS register.
29 #CHECK: Disassembly of section .text:
31 #CHECK-NEXT: mrs x0, TPIDR_EL0
32 #CHECK-NEXT: add x0, x0, #0, lsl #12
33 #CHECK-NEXT: add x0, x0, #16
34 #CHECK-NEXT: mrs x0, TPIDR_EL0
35 #CHECK-NEXT: add x0, x0, #4095, lsl #12
36 #CHECK-NEXT: add x0, x0, #4088
38 .section .tbss,"awT",@nobits
47 # The current offset from the thread pointer is 20. Raise it to just below the
49 .space (0xfffff8 - 20)