2 // RUN
: llvm-mc
-filetype
=obj
-triple
=armv7a-linux-gnueabihf
--arm-add-build-attributes
%s
-o
%t.o
3 // RUN
: ld.lld
--fix-cortex-a8
-verbose
%t.o
-o
%t2
2>&1 | FileCheck
%s
4 // RUN
: llvm-objdump
-d
--no-show-raw-insn
--start-address
=0x21ffa --stop-address
=0x22008 %t2 | FileCheck
--check-prefix
=CHECK-PATCH
%s
6 /// Test that the patch can work on an unrelocated BLX. Neither clang
or GCC
7 /// will emit these without
a relocation
, but they could
be produced by ELF
10 // CHECK
: ld.lld
: detected cortex-a8-
657419 erratum sequence starting at
21FFE in unpatched output
15 .type _start, %function
23 /// 32-bit Branch link
and exchange spans
2 4KiB regions
, preceded by
a
24 /// 32-bit non branch instruction. Expect
a patch.
26 /// Encoding for blx _start. Use
.inst.n directives to avoid a relocation.
30 // CHECK-PATCH
: 21ffa
: nop.w
31 // CHECK-PATCH-NEXT
: 21ffe
: blx
0x22004 <__CortexA8657417_21FFE
>
32 // CHECK-PATCH
: 00022004 <__CortexA8657417_21FFE
>:
33 // CHECK-PATCH-NEXT
: 22004: b 0x21000 <_start
>