2 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv7a-none-linux-gnueabi
%s
-o
%t
3 // RUN
: echo
"SECTIONS { \
4 // RUN: . = SIZEOF_HEADERS; \
5 // RUN: .text_low : { *(.text_low) *(.text_low2) } \
6 // RUN: .text_high 0x2000000 : { *(.text_high) *(.text_high2) } \
7 // RUN: } " > %t.script
8 // RUN
: ld.lld
--pic-veneer
--no-rosegment
--script
%t.script
%t -o
%t2
9 // RUN
: llvm-objdump
--no-print-imm-hex
-d
%t2 | FileCheck
%s
11 // Test that we can force generation of position independent thunks even when
12 // inputs are
not pic.
15 .section .text_low, "ax", %progbits
20 .type low_target, %function
25 .section .text_low2, "ax", %progbits
28 .type low_target2, %function
33 // CHECK
: Disassembly of section
.text_low:
35 // CHECK-NEXT
: <_start
>:
36 // CHECK-NEXT
: 94: 4770 bx
lr
37 // CHECK
: <low_target
>:
38 // CHECK-NEXT
: 96: f000 f803
bl 0xa0 <__ThumbV7PILongThunk_high_target
>
39 // CHECK-NEXT
: 9a: f000 f807
bl 0xac <__ThumbV7PILongThunk_high_target2
>
40 // CHECK-NEXT
: 9e
: d4d4
41 // CHECK
: <__ThumbV7PILongThunk_high_target
>:
42 // CHECK-NEXT
: a0
: f64f
7c55 movw
r12, #65365
43 // CHECK-NEXT
: a4
: f2c0
1cff movt
r12, #511
44 // CHECK-NEXT
: a8
: 44fc
add r12, pc
45 // CHECK-NEXT
: aa
: 4760 bx
r12
46 // CHECK
: <__ThumbV7PILongThunk_high_target2
>:
47 // CHECK-NEXT
: ac
: f64f
7c69 movw
r12, #65385
48 // CHECK-NEXT
: b0
: f2c0
1cff movt
r12, #511
49 // CHECK-NEXT
: b4
: 44fc
add r12, pc
50 // CHECK-NEXT
: b6
: 4760 bx
r12
51 // CHECK
: <low_target2
>:
52 // CHECK-NEXT
: b8
: f7ff fff2
bl 0xa0 <__ThumbV7PILongThunk_high_target
>
53 // CHECK-NEXT
: bc: f7ff fff6
bl 0xac <__ThumbV7PILongThunk_high_target2
>
56 .section .text_high, "ax", %progbits
59 .type high_target, %function
64 .section .text_high2, "ax", %progbits
67 .type high_target2, %function
72 // CHECK
: Disassembly of section
.text_high:
74 // CHECK-NEXT
: <high_target
>:
75 // CHECK-NEXT
: 2000000: f000 f802
bl 0x2000008 <__ThumbV7PILongThunk_low_target
>
76 // CHECK-NEXT
: 2000004: f000 f806
bl 0x2000014 <__ThumbV7PILongThunk_low_target2
>
77 // CHECK
: <__ThumbV7PILongThunk_low_target
>:
78 // CHECK-NEXT
: 2000008: f240
0c83 movw
r12, #131
79 // CHECK-NEXT
: 200000c
: f6cf
6c00 movt
r12, #65024
80 // CHECK-NEXT
: 2000010: 44fc
add r12, pc
81 // CHECK-NEXT
: 2000012: 4760 bx
r12
82 // CHECK
: <__ThumbV7PILongThunk_low_target2
>:
83 // CHECK-NEXT
: 2000014: f240
0c99 movw
r12, #153
84 // CHECK-NEXT
: 2000018: f6cf
6c00 movt
r12, #65024
85 // CHECK-NEXT
: 200001c
: 44fc
add r12, pc
86 // CHECK-NEXT
: 200001e
: 4760 bx
r12
87 // CHECK
: <high_target2
>:
88 // CHECK-NEXT
: 2000020: f7ff fff2
bl 0x2000008 <__ThumbV7PILongThunk_low_target
>
89 // CHECK-NEXT
: 2000024: f7ff fff6
bl 0x2000014 <__ThumbV7PILongThunk_low_target2
>