File: aarch64-tls-ie.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (45 lines) | stat: -rw-r--r-- 1,353 bytes parent folder | download | duplicates (14)
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: