xref: /llvm-project/lld/test/ELF/arm-symbol-ordering-file.s (revision 2324c2e3c3110cd077bb537eaa5b686a6b97c8e7)
1# REQUIRES: arm
2
3# RUN: split-file %s %t
4
5# RUN: llvm-mc -filetype=obj -triple=armv7-unknown-linux %t/small.s -o %t.small.o
6# RUN: llvm-mc -filetype=obj -triple=armv7-unknown-linux %t/large.s -o %t.large.o
7# RUN: llvm-objcopy --set-section-flags .bar=alloc,readonly %t.large.o %t.large.RO.o
8
9# RUN: echo ordered > %t_order.txt
10
11# RUN: ld.lld --symbol-ordering-file %t_order.txt %t.small.o -o %t2.small.out
12# RUN: ld.lld --symbol-ordering-file %t_order.txt %t.large.o -o %t2.large.out
13# RUN: ld.lld --symbol-ordering-file %t_order.txt %t.large.RO.o -o %t2.large.RO.out
14# RUN: llvm-nm -n %t2.small.out | FileCheck --check-prefix=SMALL %s
15# RUN: llvm-nm -n %t2.large.out | FileCheck --check-prefix=LARGE %s
16# RUN: llvm-nm -n %t2.large.RO.out | FileCheck --check-prefix=SMALL %s
17# RUN: rm -f %t.*.o %t2.*.out
18
19# SMALL: ordered
20# SMALL-NEXT: unordered1
21# SMALL-NEXT: unordered2
22# SMALL-NEXT: unordered3
23# SMALL-NEXT: unordered4
24
25# LARGE: unordered1
26# LARGE-NEXT: unordered2
27# LARGE-NEXT: ordered
28# LARGE-NEXT: unordered3
29# LARGE-NEXT: unordered4
30
31#--- small.s
32.section .foo,"ax",%progbits,unique,1
33unordered1:
34.zero 1
35
36.section .foo,"ax",%progbits,unique,2
37unordered2:
38.zero 1
39
40.section .foo,"ax",%progbits,unique,3
41unordered3:
42.zero 2
43
44.section .foo,"ax",%progbits,unique,4
45unordered4:
46.zero 4
47
48.section .foo,"ax",%progbits,unique,5
49ordered:
50.zero 1
51
52#--- large.s
53.section .bar,"ax",%progbits,unique,1
54unordered1:
55.zero 0xC00000
56
57.section .bar,"ax",%progbits,unique,2
58unordered2:
59.zero 0xC00000
60
61.section .bar,"ax",%progbits,unique,3
62unordered3:
63.zero 0xC00000
64
65.section .bar,"ax",%progbits,unique,4
66unordered4:
67.zero 0xC00000
68
69.section .bar,"ax",%progbits,unique,5
70ordered:
71.zero 8
72