1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /debug /out:%t.exe /entry:main %t.obj
3 # RUN: llvm-readobj --sections %t.exe | FileCheck %s
4 # RUN: lld-link /debug:dwarf /out:%t.exe /entry:main %t.obj
5 # RUN: llvm-readobj --sections %t.exe | FileCheck %s
6 # RUN: lld-link /out:%t.exe /entry:main %t.obj
7 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=NODEBUG %s
8 # RUN: lld-link /debug:symtab /out:%t.exe /entry:main %t.obj
9 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=NODEBUG %s
14 # CHECK: Name: .debug_abbrev
15 # CHECK: Name: .debug_info
16 # CHECK: Name: .debug_line
17 # CHECK: Name: .debug_pubnames
18 # CHECK: Name: .debug_pubtypes
20 # NODEBUG: Name: .text
21 # NODEBUG: Name: .reloc
22 # NODEBUG: Name: .rmeta
23 # NODEBUG-NOT: Name: .debug_abbrev
24 # NODEBUG-NOT: Name: .debug_info
25 # NODEBUG-NOT: Name: .debug_line
26 # NODEBUG-NOT: Name: .debug_pubnames
27 # NODEBUG-NOT: Name: .debug_pubtypes
31 Machine: IMAGE_FILE_MACHINE_I386
35 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
37 SectionData: 508D0500000000C70424000000005AC3
41 Type: IMAGE_REL_I386_DIR32
43 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
47 Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
52 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
73 Flags: [ HasColumnInfo ]
77 - FileName: '\usr\local\google\home\majnemer\llvm\src\tools\lld\<stdin>'
88 - FileName: '\usr\local\google\home\majnemer\llvm\src\tools\lld\<stdin>'
93 - '\usr\local\google\home\majnemer\llvm\src\tools\lld\<stdin>'
97 Type: IMAGE_REL_I386_SECREL
100 Type: IMAGE_REL_I386_SECTION
103 Type: IMAGE_REL_I386_SECREL
106 Type: IMAGE_REL_I386_SECTION
108 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
112 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
115 - Name: .debug_abbrev
116 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
118 SectionData: 011101250E1305030E10171B0E110112060000023400030E49133F193A0B3B0B02186E0E0000032400030E3E0B0B0B0000042E0011011206E77F194018030E3A0B3B0B49133F19000000
120 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
122 SectionData: 54000000040000000000040100000000040037000000000000003F000000000000001000000002720000003B0000000101050300000000780000000374000000050404000000001000000001548000000001013B00000000
125 SymbolName: .debug_abbrev
126 Type: IMAGE_REL_I386_SECREL
128 SymbolName: .debug_str
129 Type: IMAGE_REL_I386_SECREL
131 SymbolName: .debug_str
132 Type: IMAGE_REL_I386_SECREL
134 SymbolName: .debug_line
135 Type: IMAGE_REL_I386_SECREL
137 SymbolName: .debug_str
138 Type: IMAGE_REL_I386_SECREL
141 Type: IMAGE_REL_I386_DIR32
143 SymbolName: .debug_str
144 Type: IMAGE_REL_I386_SECREL
146 SymbolName: '?x@@3HA'
147 Type: IMAGE_REL_I386_DIR32
149 SymbolName: .debug_str
150 Type: IMAGE_REL_I386_SECREL
152 SymbolName: .debug_str
153 Type: IMAGE_REL_I386_SECREL
156 Type: IMAGE_REL_I386_DIR32
158 SymbolName: .debug_str
159 Type: IMAGE_REL_I386_SECREL
160 - Name: .debug_ranges
161 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
164 - Name: .debug_pubnames
165 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
167 SectionData: 1D00000002000000000058000000420000006D61696E0026000000780000000000
170 SymbolName: .debug_info
171 Type: IMAGE_REL_I386_SECREL
172 - Name: .debug_pubtypes
173 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
175 SectionData: 16000000020000000000580000003B000000696E740000000000
178 SymbolName: .debug_info
179 Type: IMAGE_REL_I386_SECREL
181 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
183 SectionData: 3300000002001E0000000101FB0E0D000101010100000001000001003C737464696E3E000000000000050200000000010AD60202000101
187 Type: IMAGE_REL_I386_DIR32
189 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
191 SectionData: 00112233
196 SimpleType: IMAGE_SYM_TYPE_NULL
197 ComplexType: IMAGE_SYM_DTYPE_NULL
198 StorageClass: IMAGE_SYM_CLASS_STATIC
201 NumberOfRelocations: 1
202 NumberOfLinenumbers: 0
208 SimpleType: IMAGE_SYM_TYPE_NULL
209 ComplexType: IMAGE_SYM_DTYPE_NULL
210 StorageClass: IMAGE_SYM_CLASS_STATIC
213 NumberOfRelocations: 0
214 NumberOfLinenumbers: 0
220 SimpleType: IMAGE_SYM_TYPE_NULL
221 ComplexType: IMAGE_SYM_DTYPE_NULL
222 StorageClass: IMAGE_SYM_CLASS_STATIC
225 NumberOfRelocations: 0
226 NumberOfLinenumbers: 0
232 SimpleType: IMAGE_SYM_TYPE_NULL
233 ComplexType: IMAGE_SYM_DTYPE_NULL
234 StorageClass: IMAGE_SYM_CLASS_STATIC
237 NumberOfRelocations: 4
238 NumberOfLinenumbers: 0
244 SimpleType: IMAGE_SYM_TYPE_NULL
245 ComplexType: IMAGE_SYM_DTYPE_NULL
246 StorageClass: IMAGE_SYM_CLASS_STATIC
249 NumberOfRelocations: 0
250 NumberOfLinenumbers: 0
256 SimpleType: IMAGE_SYM_TYPE_NULL
257 ComplexType: IMAGE_SYM_DTYPE_NULL
258 StorageClass: IMAGE_SYM_CLASS_STATIC
261 NumberOfRelocations: 0
262 NumberOfLinenumbers: 0
265 - Name: .debug_abbrev
268 SimpleType: IMAGE_SYM_TYPE_NULL
269 ComplexType: IMAGE_SYM_DTYPE_NULL
270 StorageClass: IMAGE_SYM_CLASS_STATIC
273 NumberOfRelocations: 0
274 NumberOfLinenumbers: 0
280 SimpleType: IMAGE_SYM_TYPE_NULL
281 ComplexType: IMAGE_SYM_DTYPE_NULL
282 StorageClass: IMAGE_SYM_CLASS_STATIC
285 NumberOfRelocations: 12
286 NumberOfLinenumbers: 0
289 - Name: .debug_ranges
292 SimpleType: IMAGE_SYM_TYPE_NULL
293 ComplexType: IMAGE_SYM_DTYPE_NULL
294 StorageClass: IMAGE_SYM_CLASS_STATIC
297 NumberOfRelocations: 0
298 NumberOfLinenumbers: 0
301 - Name: .debug_pubnames
304 SimpleType: IMAGE_SYM_TYPE_NULL
305 ComplexType: IMAGE_SYM_DTYPE_NULL
306 StorageClass: IMAGE_SYM_CLASS_STATIC
309 NumberOfRelocations: 1
310 NumberOfLinenumbers: 0
313 - Name: .debug_pubtypes
316 SimpleType: IMAGE_SYM_TYPE_NULL
317 ComplexType: IMAGE_SYM_DTYPE_NULL
318 StorageClass: IMAGE_SYM_CLASS_STATIC
321 NumberOfRelocations: 1
322 NumberOfLinenumbers: 0
328 SimpleType: IMAGE_SYM_TYPE_NULL
329 ComplexType: IMAGE_SYM_DTYPE_NULL
330 StorageClass: IMAGE_SYM_CLASS_STATIC
333 NumberOfRelocations: 1
334 NumberOfLinenumbers: 0
340 SimpleType: IMAGE_SYM_TYPE_NULL
341 ComplexType: IMAGE_SYM_DTYPE_NULL
342 StorageClass: IMAGE_SYM_CLASS_STATIC
346 SimpleType: IMAGE_SYM_TYPE_NULL
347 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
348 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
352 SimpleType: IMAGE_SYM_TYPE_NULL
353 ComplexType: IMAGE_SYM_DTYPE_NULL
354 StorageClass: IMAGE_SYM_CLASS_EXTERNAL