[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / arm-exidx-relocatable.s
blob447a276d7611092b40cb6e09467194de919d48f0
1 // REQUIRES: arm
2 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
3 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/arm-exidx-cantunwind.s -o %tcantunwind
4 // Check that relocatable link maintains SHF_LINK_ORDER
5 // RUN: ld.lld -r %t %tcantunwind -o %t4
6 // RUN: llvm-readobj -S %t4 | FileCheck %s
8 // RUN: llvm-mc -filetype=obj -triple=armv7aeb-none-linux-gnueabi -mcpu=cortex-a8 %s -o %t
9 // RUN: llvm-mc -filetype=obj -triple=armv7aeb-none-linux-gnueabi -mcpu=cortex-a8 %S/Inputs/arm-exidx-cantunwind.s -o %tcantunwind
10 // Check that relocatable link maintains SHF_LINK_ORDER for big endian
11 // RUN: ld.lld -r %t %tcantunwind -o %t4
12 // RUN: llvm-readobj -S %t4 | FileCheck %s
13 // RUN: ld.lld --be8 -r %t %tcantunwind -o %t4
14 // RUN: llvm-readobj -S %t4 | FileCheck %s
16 // Each assembler created .ARM.exidx section has the SHF_LINK_ORDER flag set
17 // with the sh_link containing the section index of the executable section
18 // containing the function it describes. To maintain this property in
19 // relocatable links we pass through the .ARM.exidx section, the section it
20 // it has a sh_link to, and the associated relocation sections uncombined.
22 .syntax unified
23 .section .text, "ax",%progbits
24 .globl _start
25 _start:
26 .fnstart
27 bx lr
28 .cantunwind
29 .fnend
31 .section .text.f1, "ax", %progbits
32 .globl f1
33 f1:
34 .fnstart
35 bx lr
36 .cantunwind
37 .fnend
39 .section .text.f2, "ax", %progbits
40 .globl f2
41 f2:
42 .fnstart
43 bx lr
44 .cantunwind
45 .fnend
46 .globl f3
47 f3:
48 .fnstart
49 bx lr
50 .cantunwind
51 .fnend
53 // CHECK: Index: 1
54 // CHECK-NEXT: Name: .text
56 // CHECK: Name: .ARM.exidx
57 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
58 // CHECK-NEXT: Flags [ (0x82)
59 // CHECK-NEXT: SHF_ALLOC (0x2)
60 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
61 // CHECK-NEXT: ]
62 // CHECK-NEXT: Address
63 // CHECK-NEXT: Offset:
64 // CHECK-NEXT: Size: 24
65 // CHECK-NEXT: Link: 1
68 // CHECK: Index: 4
69 // CHECK-NEXT: Name: .text.f1
71 // CHECK: Name: .ARM.exidx.text.f1
72 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
73 // CHECK-NEXT: Flags [ (0x82)
74 // CHECK-NEXT: SHF_ALLOC (0x2)
75 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
76 // CHECK-NEXT: ]
77 // CHECK-NEXT: Address
78 // CHECK-NEXT: Offset:
79 // CHECK-NEXT: Size: 8
80 // CHECK-NEXT: Link: 4
83 // CHECK: Index: 7
84 // CHECK-NEXT: Name: .text.f2
86 // CHECK: Name: .ARM.exidx.text.f2
87 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
88 // CHECK-NEXT: Flags [ (0x82)
89 // CHECK-NEXT: SHF_ALLOC (0x2)
90 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
91 // CHECK-NEXT: ]
92 // CHECK-NEXT: Address
93 // CHECK-NEXT: Offset:
94 // CHECK-NEXT: Size: 16
95 // CHECK-NEXT: Link: 7
98 // CHECK: Index: 10
99 // CHECK-NEXT: Name: .func1
101 // CHECK: Name: .ARM.exidx.func1
102 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
103 // CHECK-NEXT: Flags [ (0x82)
104 // CHECK-NEXT: SHF_ALLOC (0x2)
105 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
106 // CHECK-NEXT: ]
107 // CHECK-NEXT: Address
108 // CHECK-NEXT: Offset:
109 // CHECK-NEXT: Size: 8
110 // CHECK-NEXT: Link: 10
113 // CHECK: Index: 13
114 // CHECK-NEXT: Name: .func2
116 // CHECK: Name: .ARM.exidx.func2
117 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
118 // CHECK-NEXT: Flags [ (0x82)
119 // CHECK-NEXT: SHF_ALLOC (0x2)
120 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
121 // CHECK-NEXT: ]
122 // CHECK-NEXT: Address
123 // CHECK-NEXT: Offset:
124 // CHECK-NEXT: Size: 8
125 // CHECK-NEXT: Link: 13
128 // CHECK: Index: 16
129 // CHECK-NEXT: Name: .func3
131 // CHECK: Name: .ARM.exidx.func3
132 // CHECK-NEXT: Type: SHT_ARM_EXIDX (0x70000001)
133 // CHECK-NEXT: Flags [ (0x82)
134 // CHECK-NEXT: SHF_ALLOC (0x2)
135 // CHECK-NEXT: SHF_LINK_ORDER (0x80)
136 // CHECK-NEXT: ]
137 // CHECK-NEXT: Address
138 // CHECK-NEXT: Offset:
139 // CHECK-NEXT: Size: 8
140 // CHECK-NEXT: Link: 16