]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/aarch64-cortex-a53-843419-tlsrelax.s
Vendor import of lld trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / ELF / aarch64-cortex-a53-843419-tlsrelax.s
1 // REQUIRES: aarch64
2 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o
3 // RUN: ld.lld -fix-cortex-a53-843419 %t.o -o %t2
4 // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 | FileCheck %s
5
6 // The following code sequence is covered by the TLS IE to LE relaxation. It
7 // transforms the ADRP, LDR to MOVZ, MOVK. The former can trigger a
8 // cortex-a53-843419 patch, whereas the latter can not. As both
9 // relaxation and patching transform instructions very late in the
10 // link there is a possibility of them both being simultaneously
11 // applied. In this case the relaxed sequence is immune from the erratum so we
12 // prefer to keep it.
13  .text
14  .balign 4096
15  .space  4096 - 8
16  .globl _start
17  .type  _start,@function
18 _start:
19  mrs    x1, tpidr_el0
20  adrp   x0, :gottprel:v
21  ldr    x1, [x0, #:gottprel_lo12:v]
22  adrp   x0, :gottprel:v
23  ldr    x1, [x0, #:gottprel_lo12:v]
24  ret
25
26 // CHECK: _start:
27 // CHECK-NEXT:   210ff8:        41 d0 3b d5     mrs     x1, TPIDR_EL0
28 // CHECK-NEXT:   210ffc:        00 00 a0 d2     movz    x0, #0, lsl #16
29 // CHECK-NEXT:   211000:        01 08 80 f2     movk    x1, #64
30 // CHECK-NEXT:   211004:        00 00 a0 d2     movz    x0, #0, lsl #16
31 // CHECK-NEXT:   211008:        01 08 80 f2     movk    x1, #64
32 // CHECK-NEXT:   21100c:        c0 03 5f d6     ret
33
34  .type  v,@object
35  .section       .tbss,"awT",@nobits
36  .globl v
37 v:
38  .word 0