1 # RUN: yaml2obj %s --docnum=1 -o %t.arm
2 # RUN: llvm-readobj -h %t.arm \
3 # RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.arm --check-prefix ARM
6 # ARM-NEXT:Format: COFF-ARM
8 # ARM-NEXT:AddressSize: 32bit
9 # ARM-NEXT:ImageFileHeader {
10 # ARM-NEXT: Machine: IMAGE_FILE_MACHINE_ARMNT (0x1C4)
11 # ARM-NEXT: SectionCount: 0
12 # ARM-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
13 # ARM-NEXT: PointerToSymbolTable: 0x0
14 # ARM-NEXT: SymbolCount: 0
15 # ARM-NEXT: OptionalHeaderSize: 0
16 # ARM-NEXT: Characteristics [ (0x0)
23 Machine: IMAGE_FILE_MACHINE_ARMNT
28 # RUN: yaml2obj %s --docnum=2 -o %t.arm64
29 # RUN: llvm-readobj -h %t.arm64 \
30 # RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.arm64 --check-prefix ARM64
32 # ARM64:File: [[FILE]]
33 # ARM64-NEXT:Format: COFF-ARM64
34 # ARM64-NEXT:Arch: aarch64
35 # ARM64-NEXT:AddressSize: 64bit
36 # ARM64-NEXT:ImageFileHeader {
37 # ARM64-NEXT: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64)
38 # ARM64-NEXT: SectionCount: 0
39 # ARM64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
40 # ARM64-NEXT: PointerToSymbolTable: 0x0
41 # ARM64-NEXT: SymbolCount: 0
42 # ARM64-NEXT: OptionalHeaderSize: 0
43 # ARM64-NEXT: Characteristics [ (0x0)
50 Machine: IMAGE_FILE_MACHINE_ARM64
55 # RUN: yaml2obj %s --docnum=3 -o %t.i386
56 # RUN: llvm-readobj -h %t.i386 \
57 # RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.i386 --check-prefix I386
60 # I386-NEXT:Format: COFF-i386
61 # I386-NEXT:Arch: i386
62 # I386-NEXT:AddressSize: 32bit
63 # I386-NEXT:ImageFileHeader {
64 # I386-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
65 # I386-NEXT: SectionCount: 0
66 # I386-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
67 # I386-NEXT: PointerToSymbolTable: 0x0
68 # I386-NEXT: SymbolCount: 0
69 # I386-NEXT: OptionalHeaderSize: 0
70 # I386-NEXT: Characteristics [ (0x0)
77 Machine: IMAGE_FILE_MACHINE_I386
82 # RUN: yaml2obj %s --docnum=4 -o %t.x86-64
83 # RUN: llvm-readobj -h %t.x86-64 \
84 # RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.x86-64 --check-prefix X86-64
86 # X86-64:File: [[FILE]]
87 # X86-64-NEXT:Format: COFF-x86-64
88 # X86-64-NEXT:Arch: x86_64
89 # X86-64-NEXT:AddressSize: 64bit
90 # X86-64-NEXT:ImageFileHeader {
91 # X86-64-NEXT: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664)
92 # X86-64-NEXT: SectionCount: 0
93 # X86-64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
94 # X86-64-NEXT: PointerToSymbolTable: 0x0
95 # X86-64-NEXT: SymbolCount: 0
96 # X86-64-NEXT: OptionalHeaderSize: 0
97 # X86-64-NEXT: Characteristics [ (0x0)
104 Machine: IMAGE_FILE_MACHINE_AMD64
109 # RUN: yaml2obj %s --docnum=5 -o %t.i386
110 # RUN: llvm-readobj -h %t.i386 \
111 # RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.i386 --check-prefix I386-CUSTOM-HEADER
113 # I386-CUSTOM-HEADER:File: [[FILE]]
114 # I386-CUSTOM-HEADER-NEXT:Format: COFF-i386
115 # I386-CUSTOM-HEADER-NEXT:Arch: i386
116 # I386-CUSTOM-HEADER-NEXT:AddressSize: 32bit
117 # I386-CUSTOM-HEADER-NEXT:ImageFileHeader {
118 # I386-CUSTOM-HEADER-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
119 # I386-CUSTOM-HEADER-NEXT: SectionCount: 0
120 # I386-CUSTOM-HEADER-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
121 # I386-CUSTOM-HEADER-NEXT: PointerToSymbolTable: 0x0
122 # I386-CUSTOM-HEADER-NEXT: SymbolCount: 0
123 # I386-CUSTOM-HEADER-NEXT: OptionalHeaderSize: 224
124 # I386-CUSTOM-HEADER-NEXT: Characteristics [ (0x102)
125 # I386-CUSTOM-HEADER-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100)
126 # I386-CUSTOM-HEADER-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
127 # I386-CUSTOM-HEADER-NEXT: ]
128 # I386-CUSTOM-HEADER-NEXT:}
129 # I386-CUSTOM-HEADER-NEXT:ImageOptionalHeader {
130 # I386-CUSTOM-HEADER-NEXT: Magic: 0x10B
131 # I386-CUSTOM-HEADER-NEXT: MajorLinkerVersion: 0
132 # I386-CUSTOM-HEADER-NEXT: MinorLinkerVersion: 0
133 # I386-CUSTOM-HEADER-NEXT: SizeOfCode: 0
134 # I386-CUSTOM-HEADER-NEXT: SizeOfInitializedData: 0
135 # I386-CUSTOM-HEADER-NEXT: SizeOfUninitializedData: 0
136 # I386-CUSTOM-HEADER-NEXT: AddressOfEntryPoint: 0x1000
137 # I386-CUSTOM-HEADER-NEXT: BaseOfCode: 0x0
138 # I386-CUSTOM-HEADER-NEXT: BaseOfData: 0x0
139 # I386-CUSTOM-HEADER-NEXT: ImageBase: 0x400000
140 # I386-CUSTOM-HEADER-NEXT: SectionAlignment: 4096
141 # I386-CUSTOM-HEADER-NEXT: FileAlignment: 512
142 # I386-CUSTOM-HEADER-NEXT: MajorOperatingSystemVersion: 6
143 # I386-CUSTOM-HEADER-NEXT: MinorOperatingSystemVersion: 0
144 # I386-CUSTOM-HEADER-NEXT: MajorImageVersion: 0
145 # I386-CUSTOM-HEADER-NEXT: MinorImageVersion: 0
146 # I386-CUSTOM-HEADER-NEXT: MajorSubsystemVersion: 6
147 # I386-CUSTOM-HEADER-NEXT: MinorSubsystemVersion: 0
148 # I386-CUSTOM-HEADER-NEXT: SizeOfImage: 4096
149 # I386-CUSTOM-HEADER-NEXT: SizeOfHeaders: 512
150 # I386-CUSTOM-HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
151 # I386-CUSTOM-HEADER-NEXT: Characteristics [ (0x8140)
152 # I386-CUSTOM-HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
153 # I386-CUSTOM-HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
154 # I386-CUSTOM-HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
155 # I386-CUSTOM-HEADER-NEXT: ]
156 # I386-CUSTOM-HEADER-NEXT: SizeOfStackReserve: 1048576
157 # I386-CUSTOM-HEADER-NEXT: SizeOfStackCommit: 4096
158 # I386-CUSTOM-HEADER-NEXT: SizeOfHeapReserve: 1048576
159 # I386-CUSTOM-HEADER-NEXT: SizeOfHeapCommit: 4096
160 # I386-CUSTOM-HEADER-NEXT: NumberOfRvaAndSize: 16
161 # I386-CUSTOM-HEADER-NEXT: DataDirectory {
162 # I386-CUSTOM-HEADER-NEXT: ExportTableRVA: 0x0
163 # I386-CUSTOM-HEADER-NEXT: ExportTableSize: 0x0
164 # I386-CUSTOM-HEADER-NEXT: ImportTableRVA: 0x0
165 # I386-CUSTOM-HEADER-NEXT: ImportTableSize: 0x0
166 # I386-CUSTOM-HEADER-NEXT: ResourceTableRVA: 0x0
167 # I386-CUSTOM-HEADER-NEXT: ResourceTableSize: 0x0
168 # I386-CUSTOM-HEADER-NEXT: ExceptionTableRVA: 0x0
169 # I386-CUSTOM-HEADER-NEXT: ExceptionTableSize: 0x0
170 # I386-CUSTOM-HEADER-NEXT: CertificateTableRVA: 0x0
171 # I386-CUSTOM-HEADER-NEXT: CertificateTableSize: 0x0
172 # I386-CUSTOM-HEADER-NEXT: BaseRelocationTableRVA: 0x0
173 # I386-CUSTOM-HEADER-NEXT: BaseRelocationTableSize: 0x0
174 # I386-CUSTOM-HEADER-NEXT: DebugRVA: 0x0
175 # I386-CUSTOM-HEADER-NEXT: DebugSize: 0x0
176 # I386-CUSTOM-HEADER-NEXT: ArchitectureRVA: 0x0
177 # I386-CUSTOM-HEADER-NEXT: ArchitectureSize: 0x0
178 # I386-CUSTOM-HEADER-NEXT: GlobalPtrRVA: 0x0
179 # I386-CUSTOM-HEADER-NEXT: GlobalPtrSize: 0x0
180 # I386-CUSTOM-HEADER-NEXT: TLSTableRVA: 0x0
181 # I386-CUSTOM-HEADER-NEXT: TLSTableSize: 0x0
182 # I386-CUSTOM-HEADER-NEXT: LoadConfigTableRVA: 0x0
183 # I386-CUSTOM-HEADER-NEXT: LoadConfigTableSize: 0x0
184 # I386-CUSTOM-HEADER-NEXT: BoundImportRVA: 0x0
185 # I386-CUSTOM-HEADER-NEXT: BoundImportSize: 0x0
186 # I386-CUSTOM-HEADER-NEXT: IATRVA: 0x0
187 # I386-CUSTOM-HEADER-NEXT: IATSize: 0x0
188 # I386-CUSTOM-HEADER-NEXT: DelayImportDescriptorRVA: 0x0
189 # I386-CUSTOM-HEADER-NEXT: DelayImportDescriptorSize: 0x0
190 # I386-CUSTOM-HEADER-NEXT: CLRRuntimeHeaderRVA: 0x0
191 # I386-CUSTOM-HEADER-NEXT: CLRRuntimeHeaderSize: 0x0
192 # I386-CUSTOM-HEADER-NEXT: ReservedRVA: 0x0
193 # I386-CUSTOM-HEADER-NEXT: ReservedSize: 0x0
194 # I386-CUSTOM-HEADER-NEXT: }
195 # I386-CUSTOM-HEADER-NEXT:}
196 # I386-CUSTOM-HEADER-NEXT:DOSHeader {
197 # I386-CUSTOM-HEADER-NEXT: Magic: MZ
198 # I386-CUSTOM-HEADER-NEXT: UsedBytesInTheLastPage: 0
199 # I386-CUSTOM-HEADER-NEXT: FileSizeInPages: 0
200 # I386-CUSTOM-HEADER-NEXT: NumberOfRelocationItems: 0
201 # I386-CUSTOM-HEADER-NEXT: HeaderSizeInParagraphs: 0
202 # I386-CUSTOM-HEADER-NEXT: MinimumExtraParagraphs: 0
203 # I386-CUSTOM-HEADER-NEXT: MaximumExtraParagraphs: 0
204 # I386-CUSTOM-HEADER-NEXT: InitialRelativeSS: 0
205 # I386-CUSTOM-HEADER-NEXT: InitialSP: 0
206 # I386-CUSTOM-HEADER-NEXT: Checksum: 0
207 # I386-CUSTOM-HEADER-NEXT: InitialIP: 0
208 # I386-CUSTOM-HEADER-NEXT: InitialRelativeCS: 0
209 # I386-CUSTOM-HEADER-NEXT: AddressOfRelocationTable: 64
210 # I386-CUSTOM-HEADER-NEXT: OverlayNumber: 0
211 # I386-CUSTOM-HEADER-NEXT: OEMid: 0
212 # I386-CUSTOM-HEADER-NEXT: OEMinfo: 0
213 # I386-CUSTOM-HEADER-NEXT: AddressOfNewExeHeader: 128
214 # I386-CUSTOM-HEADER-NEXT:}
215 # I386-CUSTOM-HEADER-NOT:{{.}}
219 AddressOfEntryPoint: 4096
221 SectionAlignment: 4096
223 MajorOperatingSystemVersion: 6
224 MinorOperatingSystemVersion: 0
227 MajorSubsystemVersion: 6
228 MinorSubsystemVersion: 0
229 Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
230 DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
231 SizeOfStackReserve: 1048576
232 SizeOfStackCommit: 4096
233 SizeOfHeapReserve: 1048576
234 SizeOfHeapCommit: 4096
236 RelativeVirtualAddress: 0
239 RelativeVirtualAddress: 0
242 RelativeVirtualAddress: 0
245 RelativeVirtualAddress: 0
248 RelativeVirtualAddress: 0
251 RelativeVirtualAddress: 0
254 RelativeVirtualAddress: 0
257 RelativeVirtualAddress: 0
260 RelativeVirtualAddress: 0
263 RelativeVirtualAddress: 0
266 RelativeVirtualAddress: 0
269 RelativeVirtualAddress: 0
272 RelativeVirtualAddress: 0
274 DelayImportDescriptor:
275 RelativeVirtualAddress: 0
278 RelativeVirtualAddress: 0
281 Machine: IMAGE_FILE_MACHINE_I386
282 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE ]
287 # RUN: yaml2obj %s --docnum=6 -o %t.unknown
288 # RUN: llvm-readobj -h %t.unknown \
289 # RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix UNKNOWN
291 # UNKNOWN:Format: COFF-<unknown arch>
292 # UNKNOWN-NEXT:Arch: unknown
293 # UNKNOWN-NEXT:AddressSize: 32bit
294 # UNKNOWN-NEXT:ImageFileHeader {
295 # UNKNOWN-NEXT: Machine: IMAGE_FILE_MACHINE_UNKNOWN (0x0)
296 # UNKNOWN-NEXT: SectionCount: 0
297 # UNKNOWN-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
298 # UNKNOWN-NEXT: PointerToSymbolTable: 0x0
299 # UNKNOWN-NEXT: SymbolCount: 0
300 # UNKNOWN-NEXT: OptionalHeaderSize: 0
301 # UNKNOWN-NEXT: Characteristics [ (0x0)
308 Machine: IMAGE_FILE_MACHINE_UNKNOWN
313 # RUN: llvm-readobj -h %p/Inputs/magic.coff-importlib \
314 # RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix IMPORTLIB
316 # IMPORTLIB:Format: COFF-import-file
317 # IMPORTLIB-NEXT:Type: code
318 # IMPORTLIB-NEXT:Name type: noprefix
319 # IMPORTLIB-NEXT:Symbol: __imp__func
320 # IMPORTLIB-NEXT:Symbol: _func
321 # IMPORTLIB-NOT:{{.}}