1 /// Test the Arm state R_ARM_CALL
and R_ARM_JUMP24 relocation to Arm state destinations.
2 /// R_ARM_CALL is used for branch
and link
(BL)
3 /// R_ARM_JUMP24 is used for unconditional
and conditional branches
(B and B<cc
>)
4 /// Relocations defined in https
://github.com
/ARM-software
/abi-aa
/blob
/main
/aaelf32
/aaelf32.rst
5 /// Addend
A is always
-8 to cancel out Arm state PC-bias of
8 bytes
8 // RUN
: llvm-mc
-filetype
=obj
-triple
=armv7a-none-linux-gnueabi
%s
-o
%t
9 // RUN
: echo
"SECTIONS { \
11 // RUN: .callee1 : { *(.callee_low) } \
12 // RUN: .caller : { *(.text) } \
13 // RUN: .callee2 : { *(.callee_high) } } " > %t.script
14 // RUN
: ld.lld
--defsym
=far
=0x201001c --script
%t.script
%t -o
%t2
15 // RUN
: llvm-objdump
-d
--no-show-raw-insn
--triple
=armv7a-none-linux-gnueabi
%t2 | FileCheck
%s
18 .section .callee_low, "ax",%progbits
20 .type callee_low,%function
24 .section .text, "ax",%progbits
27 .type _start,%function
40 .section .callee_high, "ax",%progbits
42 .type callee_high,%function
46 // CHECK
: 00010000 <_start
>:
47 // CHECK-NEXT
: 10000: bl 0xb4 <callee_low
>
48 // CHECK-NEXT
: 10004: b 0xb4 <callee_low
>
49 // CHECK-NEXT
: 10008: beq 0xb4 <callee_low
>
50 // CHECK-NEXT
: 1000c
: bl 0x10028 <callee_high
>
51 // CHECK-NEXT
: 10010: b 0x10028 <callee_high
>
52 // CHECK-NEXT
: 10014: bne 0x10028 <callee_high
>
54 // CHECK-NEXT
: 10018: bl 0x201001c
55 // CHECK-NEXT
: 1001c
: b 0x201001c
56 // CHECK-NEXT
: 10020: bgt 0x201001c
57 // CHECK-NEXT
: 10024: bx
lr