83 lines · plain
1@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \2@ RUN: | llvm-readobj -S --sd --sr - | FileCheck %s3 4@ Check the .fnstart directive and the .fnend directive.5 6@ The .fnstart directive and .fnend directive should create an entry in7@ exception handling table. For example, if the function is defined in .text8@ section, then there should be an entry in .ARM.exidx section.9 10 .syntax unified11 12 .text13 .globl func114 .align 215 .type func1,%function16 .fnstart17func1:18 bx lr19 .fnend20 21 22 23@-------------------------------------------------------------------------------24@ Check the .text section.25@-------------------------------------------------------------------------------26@ CHECK: Sections [27@ CHECK: Section {28 29@-------------------------------------------------------------------------------30@ Check the index of .text section. This will be used in .ARM.exidx.31@-------------------------------------------------------------------------------32@ CHECK: Index: 233@ CHECK-NEXT: Name: .text34@ CHECK: Type: SHT_PROGBITS (0x1)35@ CHECK: Flags [ (0x6)36@ CHECK: SHF_ALLOC (0x2)37@ CHECK: SHF_EXECINSTR (0x4)38@ CHECK: ]39@ CHECK: SectionData (40@ CHECK: 0000: 1EFF2FE1 |../.|41@ CHECK: )42@ CHECK: }43 44 45@-------------------------------------------------------------------------------46@ Check the name of the EXIDX section. For the function in the .text section,47@ this should be .ARM.exidx. It is incorrect to see .ARM.exidx.text here.48@-------------------------------------------------------------------------------49@ CHECK: Section {50@ CHECK: Name: .ARM.exidx51@ CHECK: Type: SHT_ARM_EXIDX (0x70000001)52@ CHECK: Flags [ (0x82)53@ CHECK: SHF_ALLOC (0x2)54@ CHECK: SHF_LINK_ORDER (0x80)55@ CHECK: ]56 57@-------------------------------------------------------------------------------58@ Check the linked section of the EXIDX section. This should be the index59@ of the .text section.60@-------------------------------------------------------------------------------61@ CHECK: Link: 262 63@-------------------------------------------------------------------------------64@ The first word should be the offset to .text. The second word should be65@ 0xB0B0B080, which means compact model 0 is used (0x80) and the rest of the66@ word is filled with FINISH opcode (0xB0).67@-------------------------------------------------------------------------------68@ CHECK: SectionData (69@ CHECK: 0000: 00000000 B0B0B080 |........|70@ CHECK: )71@ CHECK: }72@ CHECK: ]73 74@-------------------------------------------------------------------------------75@ The first word should be relocated to the code address in .text section.76@ Besides, since this function is using compact model 0, thus we have to77@ add an relocation to __aeabi_unwind_cpp_pr0.78@-------------------------------------------------------------------------------79@ CHECK: Relocations [80@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr081@ CHECK: 0x0 R_ARM_PREL31 .text82@ CHECK: ]83