• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: aarch64
2# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %p/Inputs/aarch64-tls-ie.s -o %tdso.o
3# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %tmain.o
4# RUN: ld.lld -shared -soname=tdso.so %tdso.o -o %tdso.so
5# RUN: ld.lld --hash-style=sysv %tmain.o %tdso.so -o %tout
6# RUN: llvm-objdump -d --no-show-raw-insn %tout | FileCheck %s
7# RUN: llvm-readobj -S -r %tout | FileCheck -check-prefix=RELOC %s
8
9# RELOC:      Section {
10# RELOC:        Index:
11# RELOC:        Name: .got
12# RELOC-NEXT:   Type: SHT_PROGBITS
13# RELOC-NEXT:   Flags [
14# RELOC-NEXT:     SHF_ALLOC
15# RELOC-NEXT:     SHF_WRITE
16# RELOC-NEXT:   ]
17# RELOC-NEXT:   Address: 0x220338
18# RELOC-NEXT:   Offset: 0x338
19# RELOC-NEXT:   Size: 16
20# RELOC-NEXT:   Link: 0
21# RELOC-NEXT:   Info: 0
22# RELOC-NEXT:   AddressAlignment: 8
23# RELOC-NEXT:   EntrySize: 0
24# RELOC-NEXT: }
25# RELOC:      Relocations [
26# RELOC-NEXT:  Section ({{.*}}) .rela.dyn {
27# RELOC-NEXT:    0x220340 R_AARCH64_TLS_TPREL64 bar 0x0
28# RELOC-NEXT:    0x220338 R_AARCH64_TLS_TPREL64 foo 0x0
29# RELOC-NEXT:  }
30# RELOC-NEXT:]
31
32## Page(0x2200B0) - Page(0x210000) = 0x10000 = 65536
33## 0x2200B0 & 0xff8 = 0xB0 = 176
34## Page(0x2200B8) - Page(0x210000) = 0x10000 = 65536
35## 0x2200B8 & 0xff8 = 0xB8 = 184
36# CHECK:     <_start>:
37# CHECK-NEXT: 210278: adrp x0, #65536
38# CHECK-NEXT: 21027c: ldr  x0, [x0, #824]
39# CHECK-NEXT: 210280: adrp x0, #65536
40# CHECK-NEXT: 210284: ldr  x0, [x0, #832]
41
42.globl _start
43_start:
44 adrp x0, :gottprel:foo
45 ldr x0, [x0, #:gottprel_lo12:foo]
46
47 adrp x0, :gottprel:bar
48 ldr x0, [x0, #:gottprel_lo12:bar]
49