2 // RUN
: rm
-rf
%t && split-file
%s
%t
3 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv4t-none-linux-gnueabi
%t/a.s
-o
%t/a.o
4 // RUN
: ld.lld
%t/a.o
--script
%t/far.lds
-o
%t/a-far
5 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4t-none-linux-gnueabi
%t/a-far | FileCheck
%s
--check-prefixes
=FAR
6 // RUN
: ld.lld
%t/a.o
--script
%t/near.lds
-o
%t/a-near
7 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4t-none-linux-gnueabi
%t/a-near | FileCheck
%s
--check-prefixes
=NEAR
8 // RUN
: ld.lld
%t/a.o
-pie
--script
%t/far.lds
-o
%t/a-far-pie
9 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4t-none-linux-gnueabi
%t/a-far-pie | FileCheck
%s
--check-prefixes
=FAR-PIE
10 // RUN
: ld.lld
%t/a.o
-pie
--script
%t/near.lds
-o
%t/a-near-pie
11 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4t-none-linux-gnueabi
%t/a-near-pie | FileCheck
%s
--check-prefixes
=NEAR
13 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv4teb-none-linux-gnueabi
%t/a.s
-o
%t/a.o
14 // RUN
: ld.lld
%t/a.o
--script
%t/far.lds
-o
%t/a-far
15 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4teb-none-linux-gnueabi
%t/a-far | FileCheck
%s
--check-prefixes
=FAR-EB
16 // RUN
: ld.lld
%t/a.o
--script
%t/near.lds
-o
%t/a-near
17 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4teb-none-linux-gnueabi
%t/a-near | FileCheck
%s
--check-prefixes
=NEAR
18 // RUN
: ld.lld
%t/a.o
-pie
--script
%t/far.lds
-o
%t/a-far-pie
19 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4teb-none-linux-gnueabi
%t/a-far-pie | FileCheck
%s
--check-prefixes
=FAR-EB-PIE
20 // RUN
: ld.lld
%t/a.o
-pie
--script
%t/near.lds
-o
%t/a-near-pie
21 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
--triple
=armv4teb-none-linux-gnueabi
%t/a-near-pie | FileCheck
%s
--check-prefixes
=NEAR
23 /// On Armv4T there is no blx instruction so long branch
/exchange looks slightly
31 .section .low, "ax", %progbits
34 .type _start,%function
42 .type thumb_start,%function
48 // FAR-LABEL
: <_start
>:
49 // FAR-NEXT
: 1000000: bl 0x1000010 <__ARMv5LongLdrPcThunk_target
> @ imm
= #8
52 // FAR-LABEL
: <thumb_start
>:
53 // FAR-NEXT
: 1000008: bl 0x1000018 <__Thumbv4ABSLongThunk_thumb_target
> @ imm
= #12
55 // FAR-NEXT
: bmi
0xffffba @ imm
= #-88
57 // FAR-NEXT
: <__ARMv5LongLdrPcThunk_target
>:
58 // FAR-NEXT
: 1000010: ldr pc
, [pc
, #-4] @ 0x1000014 <__ARMv5LongLdrPcThunk_target+0x4>
59 // FAR-NEXT
: 1000014: 00 00 00 06 .word 0x06000000
61 // FAR-NEXT
: <__Thumbv4ABSLongThunk_thumb_target
>:
62 // FAR-NEXT
: 1000018: bx pc
63 // FAR-NEXT
: b 0x1000018 <__Thumbv4ABSLongThunk_thumb_target
> @ imm
= #-6
64 // FAR-NEXT
: 100001c
: ldr
r12, [pc
] @
0x1000024 <__Thumbv4ABSLongThunk_thumb_target+
0xc>
66 // FAR-NEXT
: 1000024: 05 00 00 06 .word 0x06000005
68 // FAR-EB-LABEL
: <_start
>:
69 // FAR-EB-NEXT
: 1000000: bl 0x1000010 <__ARMv5LongLdrPcThunk_target
> @ imm
= #8
72 // FAR-EB-LABEL
: <thumb_start
>:
73 // FAR-EB-NEXT
: 1000008: bl 0x1000018 <__Thumbv4ABSLongThunk_thumb_target
> @ imm
= #12
75 // FAR-EB-NEXT
: bmi
0xffffba @ imm
= #-88
77 // FAR-EB-NEXT
: <__ARMv5LongLdrPcThunk_target
>:
78 // FAR-EB-NEXT
: 1000010: ldr pc
, [pc
, #-4] @ 0x1000014 <__ARMv5LongLdrPcThunk_target+0x4>
79 // FAR-EB-NEXT
: 1000014: 06 00 00 00 .word 0x06000000
81 // FAR-EB-NEXT
: <__Thumbv4ABSLongThunk_thumb_target
>:
82 // FAR-EB-NEXT
: 1000018: bx pc
83 // FAR-EB-NEXT
: b 0x1000018 <__Thumbv4ABSLongThunk_thumb_target
> @ imm
= #-6
84 // FAR-EB-NEXT
: 100001c
: ldr
r12, [pc
] @
0x1000024 <__Thumbv4ABSLongThunk_thumb_target+
0xc>
85 // FAR-EB-NEXT
: bx
r12
86 // FAR-EB-NEXT
: 1000024: 06 00 00 05 .word 0x06000005
88 // FAR-PIE-LABEL
: <_start
>:
89 // FAR-PIE-NEXT
: 1000000: bl 0x1000010 <__ARMv4PILongThunk_target
> @ imm
= #8
90 // FAR-PIE-NEXT
: bx
lr
92 // FAR-PIE-NEXT
: <thumb_start
>:
93 // FAR-PIE-NEXT
: 1000008: bl 0x100001c <__Thumbv4PILongThunk_thumb_target
> @ imm
= #16
94 // FAR-PIE-NEXT
: bx
lr
95 // FAR-PIE-NEXT
: bmi
0xffffba @ imm
= #-88
97 // FAR-PIE-NEXT
: <__ARMv4PILongThunk_target
>:
98 // FAR-PIE-NEXT
: 1000010: ldr
r12, [pc
] @
0x1000018 <__ARMv4PILongThunk_target+
0x8>
99 // FAR-PIE-NEXT
: add pc
, pc
, r12
100 // FAR-PIE-NEXT
: 1000018: e4 ff ff
04 .word 0x04ffffe4
102 // FAR-PIE-NEXT
: <__Thumbv4PILongThunk_thumb_target
>:
103 // FAR-PIE-NEXT
: 100001c
: bx pc
104 // FAR-PIE-NEXT
: b 0x100001c <__Thumbv4PILongThunk_thumb_target
> @ imm
= #-6
105 // FAR-PIE-NEXT
: 1000020: ldr
r12, [pc
, #4] @ 0x100002c <__Thumbv4PILongThunk_thumb_target+0x10>
106 // FAR-PIE-NEXT
: add r12, pc
, r12
107 // FAR-PIE-NEXT
: bx
r12
108 // FAR-PIE-NEXT
: 100002c
: d9 ff ff
04 .word 0x04ffffd9
110 // FAR-EB-PIE-LABEL
: <_start
>:
111 // FAR-EB-PIE-NEXT
: 1000000: bl 0x1000010 <__ARMv4PILongThunk_target
> @ imm
= #8
112 // FAR-EB-PIE-NEXT
: bx
lr
114 // FAR-EB-PIE-NEXT
: <thumb_start
>:
115 // FAR-EB-PIE-NEXT
: 1000008: bl 0x100001c <__Thumbv4PILongThunk_thumb_target
> @ imm
= #16
116 // FAR-EB-PIE-NEXT
: bx
lr
117 // FAR-EB-PIE-NEXT
: bmi
0xffffba @ imm
= #-88
119 // FAR-EB-PIE-NEXT
: <__ARMv4PILongThunk_target
>:
120 // FAR-EB-PIE-NEXT
: 1000010: ldr
r12, [pc
] @
0x1000018 <__ARMv4PILongThunk_target+
0x8>
121 // FAR-EB-PIE-NEXT
: add pc
, pc
, r12
122 // FAR-EB-PIE-NEXT
: 1000018: 04 ff ff e4
.word 0x04ffffe4
124 // FAR-EB-PIE-NEXT
: <__Thumbv4PILongThunk_thumb_target
>:
125 // FAR-EB-PIE-NEXT
: 100001c
: bx pc
126 // FAR-EB-PIE-NEXT
: b 0x100001c <__Thumbv4PILongThunk_thumb_target
> @ imm
= #-6
127 // FAR-EB-PIE-NEXT
: 1000020: ldr
r12, [pc
, #4] @ 0x100002c <__Thumbv4PILongThunk_thumb_target+0x10>
128 // FAR-EB-PIE-NEXT
: add r12, pc
, r12
129 // FAR-EB-PIE-NEXT
: bx
r12
130 // FAR-EB-PIE-NEXT
: 100002c
: 04 ff ff d9
.word 0x04ffffd9
132 // NEAR-LABEL
: <_start
>:
133 // NEAR-NEXT
: 1000000: bl 0x1000010 <target
> @ imm
= #8
136 // NEAR-LABEL
: <thumb_start
>:
137 // NEAR-NEXT
: 1000008: bl 0x1000014 <thumb_target
> @ imm
= #8
140 .section .high, "ax", %progbits
143 .type target,%function
149 .type thumb_target,%function
153 // FAR-LABEL
: <target
>:
154 // FAR-NEXT
: 6000000: bx
lr
156 // FAR-LABEL
: <thumb_target
>:
157 // FAR-NEXT
: 6000004: bx
lr
159 // FAR-PIE-LABEL
: <target
>:
160 // FAR-PIE-NEXT
: 6000000: bx
lr
162 // FAR-PIE-LABEL
: <thumb_target
>:
163 // FAR-PIE-NEXT
: 6000004: bx
lr
165 // NEAR-LABEL
: <target
>:
166 // NEAR-LABEL
: 1000010: bx
lr
168 // NEAR-NEXT
: <thumb_target
>:
169 // NEAR-NEXT
: 1000014: bx
lr
175 .low 0x01000000 : { *(.low) }
176 .high 0x06000000 : { *(.high) }
182 .all 0x01000000 : { *(.low) *(.high) }