1 # Test reading an ExceptionRecord which is referenced in different ways:
2 # - Relocation against base of .xdata record, immediate offset in .pdata
4 # - Relocation against symbol in .xdata, no immediate offset in .pdata
6 # - Combination of the two above (unlikely to occur in the wild, but for
7 # testing the consistency of the code)
9 # RUN: yaml2obj %s -o %t.obj
10 # RUN: llvm-readobj --unwind %t.obj | FileCheck %s
12 # CHECK: UnwindInformation [
13 # CHECK-NEXT: RuntimeFunction {
14 # CHECK-NEXT: Function: func (0x0)
15 # CHECK-NEXT: ExceptionRecord: .xdata (0x0)
16 # CHECK-NEXT: ExceptionData {
17 # CHECK-NEXT: FunctionLength: 4
18 # CHECK-NEXT: Version: 0
19 # CHECK-NEXT: ExceptionData: No
20 # CHECK-NEXT: EpiloguePacked: No
21 # CHECK-NEXT: EpilogueScopes: 0
22 # CHECK-NEXT: ByteCodeLength: 4
23 # CHECK-NEXT: Prologue [
24 # CHECK-NEXT: 0xd400 ; str x19, [sp, #-8]!
25 # CHECK-NEXT: 0xe4 ; end
27 # CHECK-NEXT: EpilogueScopes [
31 # CHECK-NEXT: RuntimeFunction {
32 # CHECK-NEXT: Function: func2 (0x4)
33 # CHECK-NEXT: ExceptionRecord: .xdata +0x8 (0x8)
34 # CHECK-NEXT: ExceptionData {
35 # CHECK-NEXT: FunctionLength: 4
36 # CHECK-NEXT: Version: 0
37 # CHECK-NEXT: ExceptionData: No
38 # CHECK-NEXT: EpiloguePacked: No
39 # CHECK-NEXT: EpilogueScopes: 0
40 # CHECK-NEXT: ByteCodeLength: 4
41 # CHECK-NEXT: Prologue [
42 # CHECK-NEXT: 0xdc01 ; str d8, [sp, #8]
43 # CHECK-NEXT: 0xe4 ; end
45 # CHECK-NEXT: EpilogueScopes [
49 # CHECK-NEXT: RuntimeFunction {
50 # CHECK-NEXT: Function: func3 (0x8)
51 # CHECK-NEXT: ExceptionRecord: func3_xdata (0x10)
52 # CHECK-NEXT: ExceptionData {
53 # CHECK-NEXT: FunctionLength: 4
54 # CHECK-NEXT: Version: 0
55 # CHECK-NEXT: ExceptionData: No
56 # CHECK-NEXT: EpiloguePacked: No
57 # CHECK-NEXT: EpilogueScopes: 0
58 # CHECK-NEXT: ByteCodeLength: 4
59 # CHECK-NEXT: Prologue [
60 # CHECK-NEXT: 0xe1 ; mov fp, sp
61 # CHECK-NEXT: 0xe4 ; end
63 # CHECK-NEXT: EpilogueScopes [
67 # CHECK-NEXT: RuntimeFunction {
68 # CHECK-NEXT: Function: func4 (0xC)
69 # CHECK-NEXT: ExceptionRecord: func3_xdata +0x8 (0x18)
70 # CHECK-NEXT: ExceptionData {
71 # CHECK-NEXT: FunctionLength: 4
72 # CHECK-NEXT: Version: 0
73 # CHECK-NEXT: ExceptionData: No
74 # CHECK-NEXT: EpiloguePacked: No
75 # CHECK-NEXT: EpilogueScopes: 0
76 # CHECK-NEXT: ByteCodeLength: 4
77 # CHECK-NEXT: Prologue [
78 # CHECK-NEXT: 0x81 ; stp x29, x30, [sp, #-16]!
79 # CHECK-NEXT: 0xe4 ; end
81 # CHECK-NEXT: EpilogueScopes [
89 Machine: IMAGE_FILE_MACHINE_ARM64
93 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
95 SectionData: F38F1FF8E80700FDFD030091FD7BBFA9
97 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
99 SectionData: 01000008D400E4E301000008DC01E4E301000008E1E4E3E30100000881E4E3E3
101 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
103 SectionData: '0000000000000000000000000800000000000000000000000000000008000000'
107 Type: IMAGE_REL_ARM64_ADDR32NB
110 Type: IMAGE_REL_ARM64_ADDR32NB
113 Type: IMAGE_REL_ARM64_ADDR32NB
116 Type: IMAGE_REL_ARM64_ADDR32NB
119 Type: IMAGE_REL_ARM64_ADDR32NB
121 SymbolName: func3_xdata
122 Type: IMAGE_REL_ARM64_ADDR32NB
125 Type: IMAGE_REL_ARM64_ADDR32NB
127 SymbolName: func3_xdata
128 Type: IMAGE_REL_ARM64_ADDR32NB
133 SimpleType: IMAGE_SYM_TYPE_NULL
134 ComplexType: IMAGE_SYM_DTYPE_NULL
135 StorageClass: IMAGE_SYM_CLASS_STATIC
138 NumberOfRelocations: 0
139 NumberOfLinenumbers: 0
145 SimpleType: IMAGE_SYM_TYPE_NULL
146 ComplexType: IMAGE_SYM_DTYPE_NULL
147 StorageClass: IMAGE_SYM_CLASS_STATIC
150 NumberOfRelocations: 0
151 NumberOfLinenumbers: 0
157 SimpleType: IMAGE_SYM_TYPE_NULL
158 ComplexType: IMAGE_SYM_DTYPE_NULL
159 StorageClass: IMAGE_SYM_CLASS_STATIC
162 NumberOfRelocations: 8
163 NumberOfLinenumbers: 0
169 SimpleType: IMAGE_SYM_TYPE_NULL
170 ComplexType: IMAGE_SYM_DTYPE_NULL
171 StorageClass: IMAGE_SYM_CLASS_STATIC
175 SimpleType: IMAGE_SYM_TYPE_NULL
176 ComplexType: IMAGE_SYM_DTYPE_NULL
177 StorageClass: IMAGE_SYM_CLASS_STATIC
181 SimpleType: IMAGE_SYM_TYPE_NULL
182 ComplexType: IMAGE_SYM_DTYPE_NULL
183 StorageClass: IMAGE_SYM_CLASS_STATIC
187 SimpleType: IMAGE_SYM_TYPE_NULL
188 ComplexType: IMAGE_SYM_DTYPE_NULL
189 StorageClass: IMAGE_SYM_CLASS_STATIC
193 SimpleType: IMAGE_SYM_TYPE_NULL
194 ComplexType: IMAGE_SYM_DTYPE_NULL
195 StorageClass: IMAGE_SYM_CLASS_STATIC