181 lines · plain
1@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \2@ RUN: | llvm-readobj -S --sd --sr --symbols - > %t3@ RUN: FileCheck %s < %t4@ RUN: FileCheck --check-prefix=RELOC %s < %t5 6@ Check the combination of .section, .fnstart, and .fnend directives.7 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.11 12@ For the functions in custom section specified by .section directives,13@ the EXIDX should be generated in ".ARM.exidx[[SECTION_NAME]]", and the EXTAB14@ should be generated in ".ARM.extab[[SECTION_NAME]]".15 16 .syntax unified17 18@-------------------------------------------------------------------------------19@ .TEST1 section20@-------------------------------------------------------------------------------21 .section .TEST122 .globl func123 .align 224 .type func1,%function25 .fnstart26func1:27 bx lr28 .personality __gxx_personality_v029 .handlerdata30 .fnend31 32 33@-------------------------------------------------------------------------------34@ TEST2 section (without the dot in the beginning)35@-------------------------------------------------------------------------------36 .section TEST237 .globl func238 .align 239 .type func2,%function40 .fnstart41func2:42 bx lr43 .personality __gxx_personality_v044 .handlerdata45 .fnend46 47 48@-------------------------------------------------------------------------------49@ Check the .TEST1 section.50@-------------------------------------------------------------------------------51@ CHECK: Sections [52@ CHECK: Section {53@ CHECK: Index: 354@ CHECK-NEXT: Name: .TEST155@ CHECK: SectionData (56@ CHECK: 0000: 1EFF2FE1 |../.|57@ CHECK: )58@ CHECK: }59 60@-------------------------------------------------------------------------------61@ Check the .ARM.extab.TEST1 section, the EXTAB of .TEST1 section.62@-------------------------------------------------------------------------------63@ CHECK: Section {64@ CHECK: Name: .ARM.extab.TEST165@ CHECK: SectionData (66@ CHECK: 0000: 00000000 B0B0B000 |........|67@ CHECK: )68@ CHECK: }69 70@ RELOC: Section {71@ RELOC: Name: .rel.ARM.extab.TEST172@ RELOC: Relocations [73@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v074@ RELOC: ]75@ RELOC: }76 77 78@-------------------------------------------------------------------------------79@ Check the.ARM.exidx.TEST1 section, the EXIDX of .TEST1 section.80@-------------------------------------------------------------------------------81@ CHECK: Section {82@ CHECK: Name: .ARM.exidx.TEST183 84@-------------------------------------------------------------------------------85@ This section should linked with .TEST1 section.86@-------------------------------------------------------------------------------87@ CHECK: Link: 388 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.TEST192@ section.93@-------------------------------------------------------------------------------94@ CHECK: SectionData (95@ CHECK: 0000: 00000000 00000000 |........|96@ CHECK: )97@ CHECK: }98 99@ RELOC: Section {100@ RELOC: Name: .rel.ARM.exidx.TEST1101@ RELOC: Relocations [102@ RELOC: 0x0 R_ARM_PREL31 .TEST1103@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1104@ RELOC: ]105@ RELOC: }106 107 108@-------------------------------------------------------------------------------109@ Check the TEST2 section (without the dot in the beginning)110@-------------------------------------------------------------------------------111@ CHECK: Section {112@ CHECK: Index: 8113@ CHECK-NEXT: Name: TEST2114@ CHECK: SectionData (115@ CHECK: 0000: 1EFF2FE1 |../.|116@ CHECK: )117@ CHECK: }118 119@-------------------------------------------------------------------------------120@ Check the .ARM.extabTEST2 section, the EXTAB of TEST2 section.121@-------------------------------------------------------------------------------122@ CHECK: Section {123@ CHECK: Name: .ARM.extabTEST2124@ CHECK: SectionData (125@ CHECK: 0000: 00000000 B0B0B000 |........|126@ CHECK: )127@ CHECK: }128 129@ RELOC: Section {130@ RELOC: Name: .rel.ARM.extabTEST2131@ RELOC: Relocations [132@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0133@ RELOC: ]134@ RELOC: }135 136 137@-------------------------------------------------------------------------------138@ Check the .ARM.exidxTEST2 section, the EXIDX of TEST2 section.139@-------------------------------------------------------------------------------140@ CHECK: Section {141@ CHECK: Name: .ARM.exidxTEST2142 143@-------------------------------------------------------------------------------144@ This section should linked with TEST2 section.145@-------------------------------------------------------------------------------146@ CHECK: Link: 8147 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.extabTEST2151@ section.152@-------------------------------------------------------------------------------153@ CHECK: SectionData (154@ CHECK: 0000: 00000000 00000000 |........|155@ CHECK: )156@ CHECK: }157 158@ RELOC: Section {159@ RELOC: Name: .rel.ARM.exidxTEST2160@ RELOC: Relocations [161@ RELOC: 0x0 R_ARM_PREL31 TEST2162@ RELOC: 0x4 R_ARM_PREL31 .ARM.extabTEST2163@ RELOC: ]164@ RELOC: }165 166 167 168@-------------------------------------------------------------------------------169@ Check the symbols and the sections they belong to170@-------------------------------------------------------------------------------171@ CHECK: Symbols [172@ CHECK: Symbol {173@ CHECK: Name: func1174@ CHECK: Section: .TEST1175@ CHECK: }176@ CHECK: Symbol {177@ CHECK: Name: func2178@ CHECK: Section: TEST2179@ CHECK: }180@ CHECK: ]181