2 // RUN
: llvm-mc
-filetype
=obj
-triple
=armv7a-linux-gnueabihf
--arm-add-build-attributes
%s
-o
%t.o
3 // RUN
: echo
"SECTIONS { \
4 // RUN: .text0 0x011006 : { *(.text.00) } \
5 // RUN: .text1 0x110000 : { *(.text.01) *(.text.02) *(.text.03) \
6 // RUN: *(.text.04) } \
7 // RUN: .text2 0x210000 : { *(.text.05) } } " > %t.script
8 // RUN
: ld.lld
--script
%t.script
--fix-cortex-a8
--shared
-verbose
%t.o
-o
%t2
2>&1
9 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
%t2 | FileCheck
%s
11 /// Test cases for Cortex-a8 Erratum
657417 that involve interactions with
12 /// range extension thunks. Both erratum fixes
and range extension thunks need
13 /// precise information
and after creation alter address information.
16 .section .text.00, "ax", %progbits
21 .section .text.01, "ax", %progbits
24 .type _start, %function
27 /// Thunk to far_away
and state change needed
, size
12-bytes goes here.
28 // CHECK
: 00110004 <__ThumbV7PILongThunk_far_away
>:
29 // CHECK-NEXT
: 110004: movw
r12, #65524
30 // CHECK-NEXT
: movt
r12, #15
31 // CHECK-NEXT
: add r12, pc
34 .section .text.02, "ax", %progbits
37 .section .text.03, "ax", %progbits
40 /// After thunk is added this branch will line up across
2 4 KiB regions
41 /// and will trigger
a patch.
45 /// Expect erratum patch inserted here
46 // CHECK
: 00110ffa
<target
>:
47 // CHECK-NEXT
: 110ffa
: nop.w
48 // CHECK-NEXT
: bl 0x111004 <__CortexA8657417_110FFE
>
49 // CHECK
: 00111004 <__CortexA8657417_110FFE
>:
50 // CHECK-NEXT
: 111004: b.w
0x110ffa <target
>
52 /// Expect range extension thunk here.
53 // CHECK
: 00111008 <__ThumbV7PILongThunk_early
>:
54 // CHECK-NEXT
: 111008: b.w
0x11006 <early
>
56 .section .text.04, "ax", %progbits
57 /// The erratum patch will push this branch out of range
, so another
58 /// range extension thunk will
be needed.
60 // CHECK
: 11100c
: beq.w
0x111008 <__ThumbV7PILongThunk_early
>
62 .section .text.05, "ax", %progbits
65 .type far_away, %function