2 // RUN
: rm
-rf
%t && split-file
%s
%t
3 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv4-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
=armv4-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
=armv4-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
=armv4-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
=armv4-none-linux-gnueabi
%t/a-near-pie | FileCheck
%s
--check-prefixes
=NEAR
13 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
-triple
=armv4eb-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
=armv4eb-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
=armv4eb-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
=armv4eb-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
=armv4eb-none-linux-gnueabi
%t/a-near-pie | FileCheck
%s
--check-prefixes
=NEAR
23 /// On Armv4 there is no blx instruction so long branch
/exchange looks slightly
31 .section .low, "ax", %progbits
34 .type _start,%function
40 // FAR-LABEL
: <_start
>:
41 // FAR-NEXT
: 1000000: bl 0x1000008 <__ARMv5LongLdrPcThunk_target
> @ imm
= #0
42 // FAR-NEXT
: mov pc
, lr
44 // FAR-NEXT
: <__ARMv5LongLdrPcThunk_target
>:
45 // FAR-NEXT
: 1000008: ldr pc
, [pc
, #-4] @ 0x100000c <__ARMv5LongLdrPcThunk_target+0x4>
46 // FAR-NEXT
: 100000c
: 00 00 00 06 .word 0x06000000
48 // FAR-EB-LABEL
: <_start
>:
49 // FAR-EB-NEXT
: 1000000: bl 0x1000008 <__ARMv5LongLdrPcThunk_target
> @ imm
= #0
50 // FAR-EB-NEXT
: mov pc
, lr
52 // FAR-EB-NEXT
: <__ARMv5LongLdrPcThunk_target
>:
53 // FAR-EB-NEXT
: 1000008: ldr pc
, [pc
, #-4] @ 0x100000c <__ARMv5LongLdrPcThunk_target+0x4>
54 // FAR-EB-NEXT
: 100000c
: 06 00 00 00 .word 0x06000000
56 // FAR-PIE-LABEL
: <_start
>:
57 // FAR-PIE-NEXT
: 1000000: bl 0x1000008 <__ARMv4PILongThunk_target
> @ imm
= #0
58 // FAR-PIE-NEXT
: mov pc
, lr
60 // FAR-PIE-NEXT
: <__ARMv4PILongThunk_target
>:
61 // FAR-PIE-NEXT
: 1000008: ldr
r12, [pc
] @
0x1000010 <__ARMv4PILongThunk_target+
0x8>
62 // FAR-PIE-NEXT
: add pc
, pc
, r12
63 // FAR-PIE-NEXT
: 1000010: ec ff ff
04 .word 0x04ffffec
65 // FAR-EB-PIE-LABEL
: <_start
>:
66 // FAR-EB-PIE-NEXT
: 1000000: bl 0x1000008 <__ARMv4PILongThunk_target
> @ imm
= #0
67 // FAR-EB-PIE-NEXT
: mov pc
, lr
69 // FAR-EB-PIE-NEXT
: <__ARMv4PILongThunk_target
>:
70 // FAR-EB-PIE-NEXT
: 1000008: ldr
r12, [pc
] @
0x1000010 <__ARMv4PILongThunk_target+
0x8>
71 // FAR-EB-PIE-NEXT
: add pc
, pc
, r12
72 // FAR-EB-PIE-NEXT
: 1000010: 04 ff ff ec
.word 0x04ffffec
74 // NEAR-LABEL
: <_start
>:
75 // NEAR-NEXT
: 1000000: bl 0x1000008 <target
> @ imm
= #0
76 // NEAR-NEXT
: mov pc
, lr
78 .section .high, "ax", %progbits
81 .type target,%function
85 // FAR-LABEL
: <target
>:
86 // FAR-NEXT
: 6000000: mov pc
, lr
88 // FAR-EB-LABEL
: <target
>:
89 // FAR-EB-NEXT
: 6000000: mov pc
, lr
91 // FAR-PIE-LABEL
: <target
>:
92 // FAR-PIE-NEXT
: 6000000: mov pc
, lr
94 // FAR-EB-PIE-LABEL
: <target
>:
95 // FAR-EB-PIE-NEXT
: 6000000: mov pc
, lr
97 // NEAR-LABEL
: <target
>:
98 // NEAR-LABEL
: 1000008: mov pc
, lr
103 .low 0x01000000 : { *(.low) }
104 .high 0x06000000 : { *(.high) }
110 .all 0x01000000 : { *(.low) *(.high) }