1 # RUN: yaml2obj %s -o %t.obj
3 # RUN: lld-link /out:%t.exe /entry:main %t.obj
4 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=HEADER %s
5 # RUN: llvm-objdump --unwind-info %t.exe | FileCheck --check-prefix=UNWIND %s
7 # RUN: lld-link /merge:.pdata=.rdata /out:%t.exe /entry:main %t.obj
8 # RUN: llvm-readobj --file-headers --sections %t.exe | FileCheck -check-prefix=HEADER-MERGE %s
10 # HEADER: ExceptionTableRVA: 0x3000
12 # FIXME: llvm-readobj currently does not understand files with .pdata merged
13 # into .rdata. But we can at least check that the section headers look correct.
15 # HEADER-MERGE: ExceptionTableRVA: 0x2004
16 # HEADER-MERGE-NEXT: ExceptionTableSize: 0x30
17 # HEADER-MERGE: Name: .rdata
18 # HEADER-MERGE-NEXT: VirtualSize: 0x78
19 # HEADER-MERGE-NEXT: VirtualAddress: 0x2000
21 # UNWIND: Function Table:
22 # UNWIND: Start Address: 0x1000
23 # UNWIND: End Address: 0x101b
24 # UNWIND: Unwind Info Address: 0x2004
26 # UNWIND: Flags: 1 UNW_ExceptionHandler
27 # UNWIND: Size of prolog: 18
28 # UNWIND: Number of Codes: 8
29 # UNWIND: Frame register: RBX
30 # UNWIND: Frame offset: 0
31 # UNWIND: Unwind Codes:
32 # UNWIND: 0x12: UOP_SetFPReg
33 # UNWIND: 0x0f: UOP_PushNonVol RBX
34 # UNWIND: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
35 # UNWIND: 0x09: UOP_SaveNonVol RSI [0x0010]
36 # UNWIND: 0x04: UOP_AllocSmall 24
37 # UNWIND: 0x00: UOP_PushMachFrame w/o error code
38 # UNWIND: Function Table:
39 # UNWIND: Start Address: 0x1012
40 # UNWIND: End Address: 0x1012
41 # UNWIND: Unwind Info Address: 0x2020
43 # UNWIND: Flags: 4 UNW_ChainInfo
44 # UNWIND: Size of prolog: 0
45 # UNWIND: Number of Codes: 0
46 # UNWIND: No frame pointer used
47 # UNWIND: Function Table:
48 # UNWIND: Start Address: 0x101b
49 # UNWIND: End Address: 0x101c
50 # UNWIND: Unwind Info Address: 0x2030
53 # UNWIND: Size of prolog: 0
54 # UNWIND: Number of Codes: 0
55 # UNWIND: No frame pointer used
56 # UNWIND: Function Table:
57 # UNWIND: Start Address: 0x101c
58 # UNWIND: End Address: 0x1039
59 # UNWIND: Unwind Info Address: 0x2038
62 # UNWIND: Size of prolog: 14
63 # UNWIND: Number of Codes: 6
64 # UNWIND: No frame pointer used
65 # UNWIND: Unwind Codes:
66 # UNWIND: 0x0e: UOP_AllocLarge 8454128
67 # UNWIND: 0x07: UOP_AllocLarge 8190
68 # UNWIND: 0x00: UOP_PushMachFrame w/o error code
72 Machine: IMAGE_FILE_MACHINE_AMD64
76 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
78 SectionData: 4883EC184889742410440F110424534889E3488D235B4883C418C3C34881ECF0FF00004881ECF0FF80004881C4F0FF80004881C4F0FF0000C3
80 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
82 SectionData: 0912080312030F300E880000096402000422001A000000000000000021000000000000001B000000000000000100000000000000010E06000E11F0FF80000701FE1F001A
85 SymbolName: __C_specific_handler
86 Type: IMAGE_REL_AMD64_ADDR32NB
89 Type: IMAGE_REL_AMD64_ADDR32NB
92 Type: IMAGE_REL_AMD64_ADDR32NB
95 Type: IMAGE_REL_AMD64_ADDR32NB
97 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
99 SectionData: 000000001B0000000000000012000000120000001C00000000000000010000002C000000000000001D00000034000000
103 Type: IMAGE_REL_AMD64_ADDR32NB
106 Type: IMAGE_REL_AMD64_ADDR32NB
109 Type: IMAGE_REL_AMD64_ADDR32NB
112 Type: IMAGE_REL_AMD64_ADDR32NB
115 Type: IMAGE_REL_AMD64_ADDR32NB
118 Type: IMAGE_REL_AMD64_ADDR32NB
120 SymbolName: smallFunc
121 Type: IMAGE_REL_AMD64_ADDR32NB
123 SymbolName: smallFunc
124 Type: IMAGE_REL_AMD64_ADDR32NB
127 Type: IMAGE_REL_AMD64_ADDR32NB
129 SymbolName: allocFunc
130 Type: IMAGE_REL_AMD64_ADDR32NB
132 SymbolName: allocFunc
133 Type: IMAGE_REL_AMD64_ADDR32NB
136 Type: IMAGE_REL_AMD64_ADDR32NB
138 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
140 SectionData: 00000000
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: 4
163 NumberOfLinenumbers: 0
169 SimpleType: IMAGE_SYM_TYPE_NULL
170 ComplexType: IMAGE_SYM_DTYPE_NULL
171 StorageClass: IMAGE_SYM_CLASS_STATIC
174 NumberOfRelocations: 12
175 NumberOfLinenumbers: 0
181 SimpleType: IMAGE_SYM_TYPE_NULL
182 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
183 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
184 - Name: __C_specific_handler
187 SimpleType: IMAGE_SYM_TYPE_NULL
188 ComplexType: IMAGE_SYM_DTYPE_NULL
189 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
193 SimpleType: IMAGE_SYM_TYPE_NULL
194 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
195 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
199 SimpleType: IMAGE_SYM_TYPE_NULL
200 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
201 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
205 SimpleType: IMAGE_SYM_TYPE_NULL
206 ComplexType: IMAGE_SYM_DTYPE_NULL
207 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
208 - Name: __C_specific_handler
211 SimpleType: IMAGE_SYM_TYPE_NULL
212 ComplexType: IMAGE_SYM_DTYPE_NULL
213 StorageClass: IMAGE_SYM_CLASS_EXTERNAL