brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · acbdb38 Raw
57 lines · plain
1# REQUIRES: aarch642# RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o3# RUN: ld.lld %t.o -o %t4# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s5# RUN: llvm-readobj -S -r %t | FileCheck -check-prefix=RELOC %s6 7#Local-Dynamic to Local-Exec relax creates no8#RELOC:      Relocations [9#RELOC-NEXT: ]10 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:13 14# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v1 cannot be used with -shared15# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v1 cannot be used with -shared16# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_HI12 against v2 cannot be used with -shared17# ERR: error: relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC against v2 cannot be used with -shared18 19.globl _start20_start:21 mrs x0, TPIDR_EL022 add x0, x0, :tprel_hi12:v123 add x0, x0, :tprel_lo12_nc:v124 mrs x0, TPIDR_EL025 add x0, x0, :tprel_hi12:v226 add x0, x0, :tprel_lo12_nc:v227 28# TCB size = 0x16 and foo is first element from TLS register.29#CHECK: Disassembly of section .text:30#CHECK:      <_start>:31#CHECK-NEXT:   mrs     x0, TPIDR_EL032#CHECK-NEXT:   add     x0, x0, #0, lsl #1233#CHECK-NEXT:   add     x0, x0, #1634#CHECK-NEXT:   mrs     x0, TPIDR_EL035#CHECK-NEXT:   add     x0, x0, #4095, lsl #1236#CHECK-NEXT:   add     x0, x0, #408837 38.section        .tbss,"awT",@nobits39 40.type   v1,@object41.globl  v142.p2align 243v1:44.word  045.size  v1, 446 47# The current offset from the thread pointer is 20. Raise it to just below the48# 24-bit limit.49.space (0xfffff8 - 20)50 51.type   v2,@object52.globl  v253.p2align 254v2:55.word  056.size  v2, 457