2 // RUN
: llvm-mc
-filetype
=obj
-triple
=armv7a-linux-gnueabihf
--arm-add-build-attributes
%s
-o
%t.o
3 // RUN
: echo
"SECTIONS { \
4 // RUN: .plt 0x2000 : { *(.plt) *(.plt.*) } \
5 // RUN: .text : { *(.text) } \
8 // RUN
: ld.lld
--script
%t.script
--fix-cortex-a8
--shared
-verbose
%t.o
-o
%t2
9 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--start-address
=0x2020 --stop-address
=0x202c --no-show-raw-insn
%t2 | FileCheck
--check-prefix
=CHECK-PLT
%s
10 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--start-address
=0x2ffa --stop-address
=0x3008 --no-show-raw-insn
%t2 | FileCheck
%s
12 /// If we patch
a branch instruction that is indirected via the PLT then we
13 /// must make sure the patch goes via the PLT
15 // CHECK-PLT
: 2020: add r12, pc
, #0, #12
16 // CHECK-PLT-NEXT
: 2024: add r12, r12, #4096
17 // CHECK-PLT-NEXT
: 2028: ldr pc
, [r12, #68]!
23 .type external, %function
35 // CHECK
: 00002ffa
<source
>:
36 // CHECK-NEXT
: 2ffa
: nop.w
37 // CHECK-NEXT
: 2ffe
: blx
0x3004 <__CortexA8657417_2FFE
>
38 // CHECK
: 00003004 <__CortexA8657417_2FFE
>:
39 // CHECK-NEXT
: 3004: b 0x2020