1 @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \
2 @ RUN: | llvm-readobj -s -sd -sr | FileCheck %s
4 @ Check the .fnstart directive and the .fnend directive.
6 @ The .fnstart directive and .fnend directive should create an entry in
7 @ exception handling table. For example, if the function is defined in .text
8 @ section, then there should be an entry in .ARM.exidx section.
23 @-------------------------------------------------------------------------------
24 @ Check the .text section.
25 @-------------------------------------------------------------------------------
29 @-------------------------------------------------------------------------------
30 @ Check the index of .text section. This will be used in .ARM.exidx.
31 @-------------------------------------------------------------------------------
34 @ CHECK: Type: SHT_PROGBITS (0x1)
35 @ CHECK: Flags [ (0x6)
36 @ CHECK: SHF_ALLOC (0x2)
37 @ CHECK: SHF_EXECINSTR (0x4)
39 @ CHECK: SectionData (
40 @ CHECK: 0000: 1EFF2FE1 |../.|
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 @-------------------------------------------------------------------------------
50 @ CHECK: Name: .ARM.exidx
51 @ CHECK: Type: SHT_ARM_EXIDX (0x70000001)
52 @ CHECK: Flags [ (0x82)
53 @ CHECK: SHF_ALLOC (0x2)
54 @ CHECK: SHF_LINK_ORDER (0x80)
57 @-------------------------------------------------------------------------------
58 @ Check the linked section of the EXIDX section. This should be the index
59 @ of the .text section.
60 @-------------------------------------------------------------------------------
63 @-------------------------------------------------------------------------------
64 @ The first word should be the offset to .text. The second word should be
65 @ 0xB0B0B080, which means compact model 0 is used (0x80) and the rest of the
66 @ word is filled with FINISH opcode (0xB0).
67 @-------------------------------------------------------------------------------
68 @ CHECK: SectionData (
69 @ CHECK: 0000: 00000000 B0B0B080 |........|
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 to
77 @ add an relocation to __aeabi_unwind_cpp_pr0.
78 @-------------------------------------------------------------------------------
79 @ CHECK: Relocations [
80 @ CHECK: 0x0 R_ARM_PREL31 .text 0x0
81 @ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0