58 lines · plain
1// REQUIRES: aarch642// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o3// RUN: echo "SECTIONS { \4// RUN: .text1 0x10000 : { *(.text.01) *(.text.02) *(.text.03) } \5// RUN: .text2 0x10010000 : { *(.text.04) } } " > %t.script6// RUN: ld.lld --script %t.script -fix-cortex-a53-843419 -verbose %t.o -o %t2 \7// RUN: 2>&1 | FileCheck -check-prefix=CHECK-PRINT %s8// RUN: llvm-objdump --no-print-imm-hex --no-show-raw-insn --triple=aarch64-linux-gnu -d %t2 | FileCheck %s9 10/// %t2 is 128 Megabytes, so delete it early.11// RUN: rm %t212 13/// Test cases for Cortex-A53 Erratum 843419 that involve interactions with14/// range extension thunks. Both erratum fixes and range extension thunks need15/// precise address information and after creation alter address information.16 17 18 .section .text.01, "ax", %progbits19 .balign 409620 .globl _start21 .type _start, %function22_start:23 bl far_away24 /// Thunk to far_away, size 16-bytes goes here.25 26 .section .text.02, "ax", %progbits27 .space 4096 - 3228 29 /// Erratum sequence will only line up at address 0 modulo 0xffc when30 /// Thunk is inserted.31 .section .text.03, "ax", %progbits32 .globl t3_ff8_ldr33 .type t3_ff8_ldr, %function34t3_ff8_ldr:35 adrp x0, dat36 ldr x1, [x1, #0]37 ldr x0, [x0, :got_lo12:dat]38 ret39 40// CHECK-PRINT: detected cortex-a53-843419 erratum sequence starting at 10FF8 in unpatched output.41// CHECK: 0000000000010ff8 <t3_ff8_ldr>:42// CHECK-NEXT: adrp x0, 0x1001000043// CHECK-NEXT: ldr x1, [x1]44// CHECK-NEXT: b 0x1100845// CHECK-NEXT: ret46// CHECK: 0000000000011008 <__CortexA53843419_11000>:47// CHECK-NEXT: ldr x0, [x0, #8]48// CHECK-NEXT: b 0x1100449 .section .text.04, "ax", %progbits50 .globl far_away51 .type far_away, function52far_away:53 ret54 55 .section .data56 .globl dat57dat: .quad 058