1 @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \
2 @ RUN: | llvm-readobj -s -sd -sr -t > %t
3 @ RUN: FileCheck %s < %t
4 @ RUN: FileCheck --check-prefix=RELOC %s < %t
6 @ Check the combination of .section, .fnstart, and .fnend directives.
8 @ For the functions in .text section, the exception handling index (EXIDX)
9 @ should be generated in .ARM.exidx, and the exception handling table (EXTAB)
10 @ should be generated in .ARM.extab.
12 @ For the functions in custom section specified by .section directives,
13 @ the EXIDX should be generated in ".ARM.exidx[[SECTION_NAME]]", and the EXTAB
14 @ should be generated in ".ARM.extab[[SECTION_NAME]]".
18 @-------------------------------------------------------------------------------
20 @-------------------------------------------------------------------------------
28 .personality __gxx_personality_v0
33 @-------------------------------------------------------------------------------
34 @ TEST2 section (without the dot in the beginning)
35 @-------------------------------------------------------------------------------
43 .personality __gxx_personality_v0
48 @-------------------------------------------------------------------------------
49 @ Check the .TEST1 section.
50 @-------------------------------------------------------------------------------
54 @ CHECK-NEXT: Name: .TEST1
55 @ CHECK: SectionData (
56 @ CHECK: 0000: 1EFF2FE1 |../.|
60 @-------------------------------------------------------------------------------
61 @ Check the .ARM.extab.TEST1 section, the EXTAB of .TEST1 section.
62 @-------------------------------------------------------------------------------
64 @ CHECK: Name: .ARM.extab.TEST1
65 @ CHECK: SectionData (
66 @ CHECK: 0000: 00000000 B0B0B000 |........|
71 @ RELOC: Name: .rel.ARM.extab.TEST1
72 @ RELOC: Relocations [
73 @ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
78 @-------------------------------------------------------------------------------
79 @ Check the.ARM.exidx.TEST1 section, the EXIDX of .TEST1 section.
80 @-------------------------------------------------------------------------------
82 @ CHECK: Name: .ARM.exidx.TEST1
84 @-------------------------------------------------------------------------------
85 @ This section should linked with .TEST1 section.
86 @-------------------------------------------------------------------------------
89 @-------------------------------------------------------------------------------
90 @ The first word should be relocated to the code address in .TEST1 section.
91 @ The second word should be relocated to the EHTAB entry in .ARM.extab.TEST1
93 @-------------------------------------------------------------------------------
94 @ CHECK: SectionData (
95 @ CHECK: 0000: 00000000 00000000 |........|
100 @ RELOC: Name: .rel.ARM.exidx.TEST1
101 @ RELOC: Relocations [
102 @ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0
103 @ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0
108 @-------------------------------------------------------------------------------
109 @ Check the TEST2 section (without the dot in the beginning)
110 @-------------------------------------------------------------------------------
113 @ CHECK-NEXT: Name: TEST2
114 @ CHECK: SectionData (
115 @ CHECK: 0000: 1EFF2FE1 |../.|
119 @-------------------------------------------------------------------------------
120 @ Check the .ARM.extabTEST2 section, the EXTAB of TEST2 section.
121 @-------------------------------------------------------------------------------
123 @ CHECK: Name: .ARM.extabTEST2
124 @ CHECK: SectionData (
125 @ CHECK: 0000: 00000000 B0B0B000 |........|
130 @ RELOC: Name: .rel.ARM.extabTEST2
131 @ RELOC: Relocations [
132 @ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
137 @-------------------------------------------------------------------------------
138 @ Check the .ARM.exidxTEST2 section, the EXIDX of TEST2 section.
139 @-------------------------------------------------------------------------------
141 @ CHECK: Name: .ARM.exidxTEST2
143 @-------------------------------------------------------------------------------
144 @ This section should linked with TEST2 section.
145 @-------------------------------------------------------------------------------
148 @-------------------------------------------------------------------------------
149 @ The first word should be relocated to the code address in TEST2 section.
150 @ The second word should be relocated to the EHTAB entry in .ARM.extabTEST2
152 @-------------------------------------------------------------------------------
153 @ CHECK: SectionData (
154 @ CHECK: 0000: 00000000 00000000 |........|
159 @ RELOC: Name: .rel.ARM.exidxTEST2
160 @ RELOC: Relocations [
161 @ RELOC: 0x0 R_ARM_PREL31 TEST2 0x0
162 @ RELOC: 0x4 R_ARM_PREL31 .ARM.extabTEST2 0x0
168 @-------------------------------------------------------------------------------
169 @ Check the symbols and the sections they belong to
170 @-------------------------------------------------------------------------------
174 @ CHECK: Section: .TEST1
178 @ CHECK: Section: TEST2