22// RUN: rm -rf %t && split-file %s %t && cd %t
33// RUN: llvm-mc -filetype=obj -triple=armv7-none-eabi code.s -o code.o
44// RUN: ld.lld -T unsigned1.ld code.o -o unsigned1.elf
5- // RUN: llvm-objdump --triple=armv7 -d unsigned1.elf | FileCheck %s --check-prefix=UNSIGNED1
5+ // RUN: llvm-objdump --triple=armv7 --no-show-raw-insn - d unsigned1.elf | FileCheck %s --check-prefix=UNSIGNED1
66// RUN: ld.lld -T unsigned2.ld code.o -o unsigned2.elf
7- // RUN: llvm-objdump --triple=armv7 -d unsigned2.elf | FileCheck %s --check-prefix=UNSIGNED2
7+ // RUN: llvm-objdump --triple=armv7 --no-show-raw-insn - d unsigned2.elf | FileCheck %s --check-prefix=UNSIGNED2
88// RUN: ld.lld -T signed1.ld code.o -o signed1.elf
9- // RUN: llvm-objdump --triple=armv7 -d signed1.elf | FileCheck %s --check-prefix=SIGNED1
9+ // RUN: llvm-objdump --triple=armv7 --no-show-raw-insn - d signed1.elf | FileCheck %s --check-prefix=SIGNED1
1010// RUN: ld.lld -T signed2.ld code.o -o signed2.elf
11- // RUN: llvm-objdump --triple=armv7 -d signed2.elf | FileCheck %s --check-prefix=SIGNED2
11+ // RUN: llvm-objdump --triple=armv7 --no-show-raw-insn - d signed2.elf | FileCheck %s --check-prefix=SIGNED2
1212
13- // The aim of this test is to ensure that a BL instruction near one end of the
14- // address space can reach a function at the extreme other end, directly, using
15- // a branch offset that makes the address wrap round. We check this at both the
16- // unsigned wraparound point (one address near 0 and the other near 0xFFFFFFFF)
17- // and the signed wraparound point (addresses either side of 0x80000000),
18- // crossing the boundary in both directions. In all four cases we expect a
19- // direct branch with no veneer.
13+ /// The aim of this test is to ensure that a BL instruction near one end of the
14+ /// address space can reach a function at the extreme other end, directly,
15+ /// using a branch offset that makes the address wrap round. We check this at
16+ /// both the unsigned wraparound point (one address near 0 and the other near
17+ /// 0xFFFFFFFF) and the signed wraparound point (addresses either side of
18+ /// 0x80000000), crossing the boundary in both directions. In all four cases we
19+ /// expect a direct branch with no veneer.
2020
2121// UNSIGNED1: Disassembly of section .text.lowaddr:
22- // UNSIGNED1: 00010000 <func>:
23- // UNSIGNED1: 10000: e12fff1e bx lr
22+ // UNSIGNED1: <func>:
23+ // UNSIGNED1: 10000: bx lr
2424//
2525// UNSIGNED1: Disassembly of section .text.highaddr:
26- // UNSIGNED1: ffff0000 <_start>:
27- // UNSIGNED1: ffff0000: eb007ffe bl 0x10000
28- // UNSIGNED1: ffff0004: e12fff1e bx lr
26+ // UNSIGNED1: <_start>:
27+ // UNSIGNED1: ffff0000: bl 0x10000
28+ // UNSIGNED1-NEXT: bx lr
2929
3030// UNSIGNED2: Disassembly of section .text.lowaddr:
31- // UNSIGNED2: 00010000 <_start>:
32- // UNSIGNED2: 10000: ebff7ffe bl 0xffff0000
33- // UNSIGNED2: 10004: e12fff1e bx lr
31+ // UNSIGNED2: <_start>:
32+ // UNSIGNED2: 10000: bl 0xffff0000
33+ // UNSIGNED2-NEXT : bx lr
3434//
3535// UNSIGNED2: Disassembly of section .text.highaddr:
36- // UNSIGNED2: ffff0000 <func>:
37- // UNSIGNED2: ffff0000: e12fff1e bx lr
36+ // UNSIGNED2: <func>:
37+ // UNSIGNED2: ffff0000: bx lr
3838
3939// SIGNED1: Disassembly of section .text.posaddr:
40- // SIGNED1: 7fff0000 <_start>:
41- // SIGNED1: 7fff0000: eb007ffe bl 0x80010000
42- // SIGNED1: 7fff0004: e12fff1e bx lr
40+ // SIGNED1: <_start>:
41+ // SIGNED1: 7fff0000: bl 0x80010000
42+ // SIGNED1-NEXT : bx lr
4343//
4444// SIGNED1: Disassembly of section .text.negaddr:
45- // SIGNED1: 80010000 <func>:
46- // SIGNED1: 80010000: e12fff1e bx lr
45+ // SIGNED1: <func>:
46+ // SIGNED1: 80010000: bx lr
4747
4848// SIGNED2: Disassembly of section .text.posaddr:
49- // SIGNED2: 7fff0000 <func>:
50- // SIGNED2: 7fff0000: e12fff1e bx lr
49+ // SIGNED2: <func>:
50+ // SIGNED2: 7fff0000: bx lr
5151//
5252// SIGNED2: Disassembly of section .text.negaddr:
53- // SIGNED2: 80010000 <_start>:
54- // SIGNED2: 80010000: ebff7ffe bl 0x7fff0000
55- // SIGNED2: 80010004: e12fff1e bx lr
53+ // SIGNED2: <_start>:
54+ // SIGNED2: 80010000: bl 0x7fff0000
55+ // SIGNED2-NEXT : bx lr
5656
5757//--- code.s
5858
@@ -72,47 +72,31 @@ _start:
7272//--- unsigned1.ld
7373
7474ENTRY(_start)
75- PHDRS {
76- lowaddr PT_LOAD FLAGS(0x1 | 0x4 );
77- highaddr PT_LOAD FLAGS(0x1 | 0x4 );
78- }
7975SECTIONS {
80- .text .lowaddr 0x00010000 : { *(.text .callee) } :lowaddr
81- .text .highaddr 0xffff0000 : { *(.text .caller) } :highaddr
76+ .text .lowaddr 0x00010000 : AT( 0x00010000 ) { *(.text .callee) }
77+ .text .highaddr 0xffff0000 : AT( 0xffff0000 ) { *(.text .caller) }
8278}
8379
8480//--- unsigned2.ld
8581
8682ENTRY(_start)
87- PHDRS {
88- lowaddr PT_LOAD FLAGS(0x1 | 0x4 );
89- highaddr PT_LOAD FLAGS(0x1 | 0x4 );
90- }
9183SECTIONS {
92- .text .lowaddr 0x00010000 : { *(.text .caller) } :lowaddr
93- .text .highaddr 0xffff0000 : { *(.text .callee) } :highaddr
84+ .text .lowaddr 0x00010000 : AT( 0x00010000 ) { *(.text .caller) }
85+ .text .highaddr 0xffff0000 : AT( 0xffff0000 ) { *(.text .callee) }
9486}
9587
9688//--- signed1.ld
9789
9890ENTRY(_start)
99- PHDRS {
100- posaddr PT_LOAD FLAGS(0x1 | 0x4 );
101- negaddr PT_LOAD FLAGS(0x1 | 0x4 );
102- }
10391SECTIONS {
104- .text .posaddr 0x7fff0000 : { *(.text .caller) } :posaddr
105- .text .negaddr 0x80010000 : { *(.text .callee) } :negaddr
92+ .text .posaddr 0x7fff0000 : AT( 0x7fff0000 ) { *(.text .caller) }
93+ .text .negaddr 0x80010000 : AT( 0x80010000 ) { *(.text .callee) }
10694}
10795
10896//--- signed2.ld
10997
11098ENTRY(_start)
111- PHDRS {
112- posaddr PT_LOAD FLAGS(0x1 | 0x4 );
113- negaddr PT_LOAD FLAGS(0x1 | 0x4 );
114- }
11599SECTIONS {
116- .text .posaddr 0x7fff0000 : { *(.text .callee) } :posaddr
117- .text .negaddr 0x80010000 : { *(.text .caller) } :negaddr
100+ .text .posaddr 0x7fff0000 : AT( 0x7fff0000 ) { *(.text .callee) }
101+ .text .negaddr 0x80010000 : AT( 0x80010000 ) { *(.text .caller) }
118102}
0 commit comments