brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 736bbe2 Raw
34 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf --arm-add-build-attributes %s -o %t.o3// RUN: ld.lld --fix-cortex-a8 -verbose %t.o -o %t2 2>&1 | FileCheck %s4// RUN: llvm-objdump -d --no-show-raw-insn --start-address=0x21ffa --stop-address=0x22008 %t2 | FileCheck --check-prefix=CHECK-PATCH %s5 6/// Test that the patch can work on an unrelocated BLX. Neither clang or GCC7/// will emit these without a relocation, but they could be produced by ELF8/// processing tools.9 10// CHECK: ld.lld: detected cortex-a8-657419 erratum sequence starting at 21FFE in unpatched output11 12 .syntax unified13 .text14 15 .type _start, %function16 .balign 409617 .global _start18 .arm19_start:20 bx lr21 .space 408622 .thumb23/// 32-bit Branch link and exchange spans 2 4KiB regions, preceded by a24/// 32-bit non branch instruction. Expect a patch.25 nop.w26/// Encoding for blx _start. Use .inst.n directives to avoid a relocation.27 .inst.n 0xf7ff28 .inst.n 0xe80029 30// CHECK-PATCH:         21ffa:          nop.w31// CHECK-PATCH-NEXT:    21ffe:          blx     0x22004 <__CortexA8657417_21FFE>32// CHECK-PATCH:      00022004 <__CortexA8657417_21FFE>:33// CHECK-PATCH-NEXT:    22004:          b       0x21000 <_start>34