73 lines · plain
1// REQUIRES: aarch642// RUN: llvm-mc -filetype=obj -triple=aarch64-pc-linux %s -o %t.o3// RUN: ld.lld --hash-style=sysv -shared %t.o -o %t.so4// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s5// RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=REL %s6 7 .text8 adrp x0, :tlsdesc:a9 ldr x1, [x0, :tlsdesc_lo12:a]10 add x0, x0, :tlsdesc_lo12:a11 .tlsdesccall a12 blr x113 14// Create relocation against local TLS symbols where linker should15// create target specific dynamic TLSDESC relocation where addend is16// the symbol VMA in tls block.17 18// CHECK: 10298: adrp x0, 0x2000019// CHECK-NEXT: 1029c: ldr x1, [x0, #856]20// CHECK-NEXT: 102a0: add x0, x0, #85621// CHECK-NEXT: 102a4: blr x122 23 adrp x0, :tlsdesc:local124 ldr x1, [x0, :tlsdesc_lo12:local1]25 add x0, x0, :tlsdesc_lo12:local126 .tlsdesccall a27 blr x128 29// CHECK: 102a8: adrp x0, 0x2000030// CHECK-NEXT: 102ac: ldr x1, [x0, #872]31// CHECK-NEXT: 102b0: add x0, x0, #87232// CHECK-NEXT: 102b4: blr x133 34 adrp x0, :tlsdesc:local235 ldr x1, [x0, :tlsdesc_lo12:local2]36 add x0, x0, :tlsdesc_lo12:local237 .tlsdesccall a38 blr x139 40// CHECK: 102b8: adrp x0, 0x2000041// CHECK-NEXT: 102bc: ldr x1, [x0, #888]42// CHECK-NEXT: 102c0: add x0, x0, #88843// CHECK-NEXT: 102c4: blr x144 45 .section .tbss,"awT",@nobits46 .type local1,@object47 .p2align 248local1:49 .word 050 .size local1, 451 52 .type local2,@object53 .p2align 354local2:55 .xword 056 .size local2, 857 58 59// 0x1000 + 4096 + 160 = 0x20A060// 0x1000 + 4096 + 176 = 0x20B061// 0x1000 + 4096 + 144 = 0x209062 63// R_AARCH64_TLSDESC - 0x0 -> start of tls block64// R_AARCH64_TLSDESC - 0x8 -> align (sizeof (local1), 8)65 66// REL: Relocations [67// REL-NEXT: Section (4) .rela.dyn {68// REL-NEXT: 0x20368 R_AARCH64_TLSDESC - 0x069// REL-NEXT: 0x20378 R_AARCH64_TLSDESC - 0x870// REL-NEXT: 0x20358 R_AARCH64_TLSDESC a 0x071// REL-NEXT: }72// REL-NEXT: ]73