2 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv6-none-linux-gnueabi
%s
-o
%t
3 // RUN
: echo
"SECTIONS { \
4 // RUN: .callee1 0x100004 : { *(.callee_low) } \
5 // RUN: .caller 0x500000 : { *(.text) } \
6 // RUN: .callee2 0x900004 : { *(.callee_high) } } " > %t.script
7 // RUN
: ld.lld
%t --script
%t.script
-o
%t2
8 // RUN
: llvm-objdump
-d
--triple
=armv6-none-linux-gnueabi
%t2 | FileCheck
%s
10 // On older Arm Architectures such as v5
and v6 the Thumb
BL and BLX relocation
11 // uses
a slightly different encoding that has
a lower range. These relocations
12 // are at the extreme range of what is permitted.
18 .type _start,%function
24 .section .callee_low, "ax", %progbits
26 .type thumbfunc, %function
29 // CHECK
: Disassembly of section
.callee1:
31 // CHECK-NEXT
: <thumbfunc
>:
32 // CHECK-NEXT
: 100004: 4770 bx
lr
34 // CHECK-NEXT
: Disassembly of section
.caller:
36 // CHECK-NEXT
: <_start
>:
37 // CHECK-NEXT
: 500000: f400 f800
bl 0x100004 <thumbfunc
>
38 // CHECK-NEXT
: 500004: f3ff effe blx
0x900004 <armfunc
>
39 // CHECK-NEXT
: 500008: 4770 bx
lr
41 .section .callee_high, "ax", %progbits
44 .type armfunc, %function
47 // CHECK
: Disassembly of section
.callee2:
49 // CHECK-NEXT
: <armfunc
>:
50 // CHECK-NEXT
: 900004: e12fff1e bx
lr