File: aarch64-tls-ie.s

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (45 lines) | stat: -rw-r--r-- 1,353 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# REQUIRES: aarch64
# RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
# RUN: ld.lld -shared %t.o -o %t.so
# RUN: llvm-readobj -d -r %t.so | FileCheck %s --check-prefix=IE-REL
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t.so | FileCheck %s --check-prefix=IE

# RUN: ld.lld %t.o -o %t
# RUN: llvm-readobj -d -r %t | FileCheck %s --check-prefix=LE-REL
# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefix=LE

# IE-REL:      FLAGS STATIC_TLS
# IE-REL:      .rela.dyn {
# IE-REL-NEXT:   0x20390 R_AARCH64_TLS_TPREL64 - 0xC
# IE-REL-NEXT:   0x20388 R_AARCH64_TLS_TPREL64 a 0x0
# IE-REL-NEXT: }

# IE:          adrp    x0, 0x20000
# IE-NEXT:     ldr     x0, [x0, #0x388]
# IE-NEXT:     adrp    x1, 0x20000
# IE-NEXT:     ldr     x1, [x1, #0x390]

# LE-REL-NOT:  FLAGS
# LE-REL:      Relocations [
# LE-REL-NEXT: ]

## TP is followed by a gap of 2 words, followed by alignment padding (empty in this case), then the static TLS blocks.
## a's offset is 16+8=24.
# LE:          movz    x0, #0, lsl #16
# LE-NEXT:     movk    x0, #24
# LE-NEXT:     movz    x1, #0, lsl #16
# LE-NEXT:     movk    x1, #28

.globl _start
_start:
  adrp x0, :gottprel:a
  ldr x0, [x0, #:gottprel_lo12:a]
  adrp x1, :gottprel:b
  ldr x1, [x1, #:gottprel_lo12:b]

.section .tbss,"awT",%nobits
.globl a
.zero 8
a:
.zero 4
b: