Index: test/tools/llvm-readobj/file-headers.test =================================================================== --- test/tools/llvm-readobj/file-headers.test +++ test/tools/llvm-readobj/file-headers.test @@ -1,394 +1,595 @@ -RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-arm \ -RUN: | FileCheck %s -check-prefix COFF-ARM -RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-arm64 \ -RUN: | FileCheck %s -check-prefix COFF-ARM64 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-i386 \ -RUN: | FileCheck %s -check-prefix COFF32 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-x86-64 \ -RUN: | FileCheck %s -check-prefix COFF64 -RUN: llvm-readobj -h %p/Inputs/trivial.exe.coff-i386 \ -RUN: | FileCheck %s -check-prefix PE32 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 \ -RUN: | FileCheck %s -check-prefix ELF32 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 \ -RUN: | FileCheck %s -check-prefix ELF64 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-i386 \ -RUN: | FileCheck %s -check-prefix MACHO32 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-x86-64 \ -RUN: | FileCheck %s -check-prefix MACHO64 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-ppc \ -RUN: | FileCheck %s -check-prefix MACHO-PPC -RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-ppc64 \ -RUN: | FileCheck %s -check-prefix MACHO-PPC64 -RUN: llvm-readobj -h %p/Inputs/trivial.obj.macho-arm \ -RUN: | FileCheck %s -check-prefix MACHO-ARM -RUN: llvm-readobj -h %p/Inputs/magic.coff-unknown \ -RUN: | FileCheck %s -check-prefix COFF-UNKNOWN -RUN: llvm-readobj -h %p/Inputs/magic.coff-importlib \ -RUN: | FileCheck %s -check-prefix COFF-IMPORTLIB -RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-lanai \ -RUN: | FileCheck %s -check-prefix ELF-LANAI -RUN: llvm-readobj -h %p/Inputs/trivial.obj.wasm \ -RUN: | FileCheck %s -check-prefix WASM - -COFF-ARM: File: {{(.*[/\\])?}}trivial.obj.coff-arm -COFF-ARM-NEXT: Format: COFF-ARM -COFF-ARM-NEXT: Arch: thumb -COFF-ARM-NEXT: AddressSize: 32bit -COFF-ARM-NEXT: ImageFileHeader { -COFF-ARM-NEXT: Machine: IMAGE_FILE_MACHINE_ARMNT (0x1C4) -COFF-ARM-NEXT: SectionCount: 2 -COFF-ARM-NEXT: TimeDateStamp: 2014-03-13 02:48:34 (0x53211C82) -COFF-ARM-NEXT: PointerToSymbolTable: 0xFF -COFF-ARM-NEXT: SymbolCount: 6 -COFF-ARM-NEXT: OptionalHeaderSize: 0 -COFF-ARM-NEXT: Characteristics [ (0x0) -COFF-ARM-NEXT: ] -COFF-ARM-NEXT: } - -COFF-ARM64: File: {{(.*[/\\])?}}trivial.obj.coff-arm64 -COFF-ARM64-NEXT: Format: COFF-ARM64 -COFF-ARM64-NEXT: Arch: aarch64 -COFF-ARM64-NEXT: AddressSize: 64bit -COFF-ARM64-NEXT: ImageFileHeader { -COFF-ARM64-NEXT: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64) -COFF-ARM64-NEXT: SectionCount: 1 -COFF-ARM64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) -COFF-ARM64-NEXT: PointerToSymbolTable: 0x44 -COFF-ARM64-NEXT: SymbolCount: 3 -COFF-ARM64-NEXT: OptionalHeaderSize: 0 -COFF-ARM64-NEXT: Characteristics [ (0x0) -COFF-ARM64-NEXT: ] -COFF-ARM64-NEXT: } - -COFF32: File: {{(.*[/\\])?}}trivial.obj.coff-i386 -COFF32-NEXT: Format: COFF-i386 -COFF32-NEXT: Arch: i386 -COFF32-NEXT: AddressSize: 32bit -COFF32-NEXT: ImageFileHeader { -COFF32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) -COFF32-NEXT: SectionCount: 2 -COFF32-NEXT: TimeDateStamp: 2013-03-20 17:56:46 (0x5149F85E) -COFF32-NEXT: PointerToSymbolTable: 0xA5 -COFF32-NEXT: SymbolCount: 9 -COFF32-NEXT: OptionalHeaderSize: 0 -COFF32-NEXT: Characteristics [ (0x0) -COFF32-NEXT: ] -COFF32-NEXT: } - -COFF64: File: {{(.*[/\\])?}}trivial.obj.coff-x86-64 -COFF64-NEXT: Format: COFF-x86-64 -COFF64-NEXT: Arch: x86_64 -COFF64-NEXT: AddressSize: 64bit -COFF64-NEXT: ImageFileHeader { -COFF64-NEXT: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664) -COFF64-NEXT: SectionCount: 2 -COFF64-NEXT: TimeDateStamp: 2013-03-20 17:56:46 (0x5149F85E) -COFF64-NEXT: PointerToSymbolTable: 0xAB -COFF64-NEXT: SymbolCount: 7 -COFF64-NEXT: OptionalHeaderSize: 0 -COFF64-NEXT: Characteristics [ (0x0) -COFF64-NEXT: ] -COFF64-NEXT: } - -ELF32: File: {{(.*[/\\])?}}trivial.obj.elf-i386 -ELF32-NEXT: Format: ELF32-i386 -ELF32-NEXT: Arch: i386 -ELF32-NEXT: AddressSize: 32bit -ELF32-NEXT: LoadName: -ELF32-NEXT: ElfHeader { -ELF32-NEXT: Ident { -ELF32-NEXT: Magic: (7F 45 4C 46) -ELF32-NEXT: Class: 32-bit (0x1) -ELF32-NEXT: DataEncoding: LittleEndian (0x1) -ELF32-NEXT: FileVersion: 1 -ELF32-NEXT: OS/ABI: GNU/Linux (0x3) -ELF32-NEXT: ABIVersion: 0 -ELF32-NEXT: Unused: (00 00 00 00 00 00 00) -ELF32-NEXT: } -ELF32-NEXT: Type: Relocatable (0x1) -ELF32-NEXT: Machine: EM_386 (0x3) -ELF32-NEXT: Version: 1 -ELF32-NEXT: Entry: 0x0 -ELF32-NEXT: ProgramHeaderOffset: 0x0 -ELF32-NEXT: SectionHeaderOffset: 0xC8 -ELF32-NEXT: Flags [ (0x0) -ELF32-NEXT: ] -ELF32-NEXT: HeaderSize: 52 -ELF32-NEXT: ProgramHeaderEntrySize: 0 -ELF32-NEXT: ProgramHeaderCount: 0 -ELF32-NEXT: SectionHeaderEntrySize: 40 -ELF32-NEXT: SectionHeaderCount: 10 -ELF32-NEXT: StringTableSectionIndex: 7 -ELF32-NEXT: } - -ELF64: File: {{(.*[/\\])?}}trivial.obj.elf-x86-64 -ELF64-NEXT: Format: ELF64-x86-64 -ELF64-NEXT: Arch: x86_64 -ELF64-NEXT: AddressSize: 64bit -ELF64-NEXT: LoadName: -ELF64-NEXT: ElfHeader { -ELF64-NEXT: Ident { -ELF64-NEXT: Magic: (7F 45 4C 46) -ELF64-NEXT: Class: 64-bit (0x2) -ELF64-NEXT: DataEncoding: LittleEndian (0x1) -ELF64-NEXT: FileVersion: 1 -ELF64-NEXT: OS/ABI: GNU/Linux (0x3) -ELF64-NEXT: ABIVersion: 0 -ELF64-NEXT: Unused: (00 00 00 00 00 00 00) -ELF64-NEXT: } -ELF64-NEXT: Type: Relocatable (0x1) -ELF64-NEXT: Machine: EM_X86_64 (0x3E) -ELF64-NEXT: Version: 1 -ELF64-NEXT: Entry: 0x0 -ELF64-NEXT: ProgramHeaderOffset: 0x0 -ELF64-NEXT: SectionHeaderOffset: 0xB8 -ELF64-NEXT: Flags [ (0x0) -ELF64-NEXT: ] -ELF64-NEXT: HeaderSize: 64 -ELF64-NEXT: ProgramHeaderEntrySize: 0 -ELF64-NEXT: ProgramHeaderCount: 0 -ELF64-NEXT: SectionHeaderEntrySize: 64 -ELF64-NEXT: SectionHeaderCount: 10 -ELF64-NEXT: StringTableSectionIndex: 7 -ELF64-NEXT: } - -MACHO32: File: {{(.*[/\\])?}}trivial.obj.macho-i386 -MACHO32-NEXT: Format: Mach-O 32-bit i386 -MACHO32-NEXT: Arch: i386 -MACHO32-NEXT: AddressSize: 32bit -MACHO32-NEXT: MachHeader { -MACHO32-NEXT: Magic: Magic (0xFEEDFACE) -MACHO32-NEXT: CpuType: X86 (0x7) -MACHO32-NEXT: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3) -MACHO32-NEXT: FileType: Relocatable (0x1) -MACHO32-NEXT: NumOfLoadCommands: 3 -MACHO32-NEXT: SizeOfLoadCommands: 296 -MACHO32-NEXT: Flags [ (0x2000) -MACHO32-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) -MACHO32-NEXT: ] -MACHO32-NEXT: } - -MACHO64: File: {{(.*[/\\])?}}trivial.obj.macho-x86-64 -MACHO64-NEXT: Format: Mach-O 64-bit x86-64 -MACHO64-NEXT: Arch: x86_64 -MACHO64-NEXT: AddressSize: 64bit -MACHO64-NEXT: MachHeader { -MACHO64-NEXT: Magic: Magic64 (0xFEEDFACF) -MACHO64-NEXT: CpuType: X86-64 (0x1000007) -MACHO64-NEXT: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3) -MACHO64-NEXT: FileType: Relocatable (0x1) -MACHO64-NEXT: NumOfLoadCommands: 3 -MACHO64-NEXT: SizeOfLoadCommands: 336 -MACHO64-NEXT: Flags [ (0x2000) -MACHO64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) -MACHO64-NEXT: ] -MACHO64-NEXT: Reserved: 0x0 -MACHO64-NEXT: } - -MACHO-PPC: File: {{(.*[/\\])?}}trivial.obj.macho-ppc -MACHO-PPC-NEXT: Format: Mach-O 32-bit ppc -MACHO-PPC-NEXT: Arch: powerpc -MACHO-PPC-NEXT: AddressSize: 32bit -MACHO-PPC-NEXT: MachHeader { -MACHO-PPC-NEXT: Magic: Magic (0xFEEDFACE) -MACHO-PPC-NEXT: CpuType: PowerPC (0x12) -MACHO-PPC-NEXT: CpuSubType: CPU_SUBTYPE_POWERPC_ALL (0x0) -MACHO-PPC-NEXT: FileType: Relocatable (0x1) -MACHO-PPC-NEXT: NumOfLoadCommands: 3 -MACHO-PPC-NEXT: SizeOfLoadCommands: 500 -MACHO-PPC-NEXT: Flags [ (0x2000) -MACHO-PPC-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) -MACHO-PPC-NEXT: ] -MACHO-PPC-NEXT: } - -MACHO-PPC64: File: {{(.*[/\\])?}}trivial.obj.macho-ppc64 -MACHO-PPC64-NEXT: Format: Mach-O 64-bit ppc64 -MACHO-PPC64-NEXT: Arch: powerpc64 -MACHO-PPC64-NEXT: AddressSize: 64bit -MACHO-PPC64-NEXT: MachHeader { -MACHO-PPC64-NEXT: Magic: Magic64 (0xFEEDFACF) -MACHO-PPC64-NEXT: CpuType: PowerPC64 (0x1000012) -MACHO-PPC64-NEXT: CpuSubtype: 0x0 -MACHO-PPC64-NEXT: FileType: Relocatable (0x1) -MACHO-PPC64-NEXT: NumOfLoadCommands: 3 -MACHO-PPC64-NEXT: SizeOfLoadCommands: 576 -MACHO-PPC64-NEXT: Flags [ (0x2000) -MACHO-PPC64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) -MACHO-PPC64-NEXT: ] -MACHO-PPC64-NEXT: Reserved: 0x0 -MACHO-PPC64-NEXT: } - -MACHO-ARM: File: {{(.*[/\\])?}}trivial.obj.macho-arm -MACHO-ARM-NEXT: Format: Mach-O arm -MACHO-ARM-NEXT: Arch: arm -MACHO-ARM-NEXT: AddressSize: 32bit -MACHO-ARM-NEXT: MachHeader { -MACHO-ARM-NEXT: Magic: Magic (0xFEEDFACE) -MACHO-ARM-NEXT: CpuType: Arm (0xC) -MACHO-ARM-NEXT: CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9) -MACHO-ARM-NEXT: FileType: Relocatable (0x1) -MACHO-ARM-NEXT: NumOfLoadCommands: 3 -MACHO-ARM-NEXT: SizeOfLoadCommands: 636 -MACHO-ARM-NEXT: Flags [ (0x2000) -MACHO-ARM-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) -MACHO-ARM-NEXT: ] -MACHO-ARM-NEXT: } - -PE32: File: {{(.*[/\\])?}}trivial.exe.coff-i386 -PE32-NEXT: Format: COFF-i386 -PE32-NEXT: Arch: i386 -PE32-NEXT: AddressSize: 32bit -PE32-NEXT: ImageFileHeader { -PE32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) -PE32-NEXT: SectionCount: 3 -PE32-NEXT: TimeDateStamp: 2013-07-16 00:39:15 (0x51E49633) -PE32-NEXT: PointerToSymbolTable: 0x0 -PE32-NEXT: SymbolCount: 0 -PE32-NEXT: OptionalHeaderSize: 224 -PE32-NEXT: Characteristics [ (0x102) -PE32-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100) -PE32-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2) -PE32-NEXT: ] -PE32-NEXT: } -PE32-NEXT: ImageOptionalHeader { -PE32-NEXT: Magic: 0x10B -PE32-NEXT: MajorLinkerVersion: 11 -PE32-NEXT: MinorLinkerVersion: 0 -PE32-NEXT: SizeOfCode: 512 -PE32-NEXT: SizeOfInitializedData: 1024 -PE32-NEXT: SizeOfUninitializedData: 0 -PE32-NEXT: AddressOfEntryPoint: 0x1000 -PE32-NEXT: BaseOfCode: 0x1000 -PE32-NEXT: BaseOfData: 0x2000 -PE32-NEXT: ImageBase: 0x400000 -PE32-NEXT: SectionAlignment: 4096 -PE32-NEXT: FileAlignment: 512 -PE32-NEXT: MajorOperatingSystemVersion: 6 -PE32-NEXT: MinorOperatingSystemVersion: 0 -PE32-NEXT: MajorImageVersion: 0 -PE32-NEXT: MinorImageVersion: 0 -PE32-NEXT: MajorSubsystemVersion: 6 -PE32-NEXT: MinorSubsystemVersion: 0 -PE32-NEXT: SizeOfImage: 16384 -PE32-NEXT: SizeOfHeaders: 1024 -PE32-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3) -PE32-NEXT: Characteristics [ (0x8140) -PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40) -PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100) -PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000) -PE32-NEXT: ] -PE32-NEXT: SizeOfStackReserve: 1048576 -PE32-NEXT: SizeOfStackCommit: 4096 -PE32-NEXT: SizeOfHeapReserve: 1048576 -PE32-NEXT: SizeOfHeapCommit: 4096 -PE32-NEXT: NumberOfRvaAndSize: 16 -PE32-NEXT: DataDirectory { -PE32-NEXT: ExportTableRVA: 0x0 -PE32-NEXT: ExportTableSize: 0x0 -PE32-NEXT: ImportTableRVA: 0x0 -PE32-NEXT: ImportTableSize: 0x0 -PE32-NEXT: ResourceTableRVA: 0x0 -PE32-NEXT: ResourceTableSize: 0x0 -PE32-NEXT: ExceptionTableRVA: 0x0 -PE32-NEXT: ExceptionTableSize: 0x0 -PE32-NEXT: CertificateTableRVA: 0x0 -PE32-NEXT: CertificateTableSize: 0x0 -PE32-NEXT: BaseRelocationTableRVA: 0x3000 -PE32-NEXT: BaseRelocationTableSize: 0xC -PE32-NEXT: DebugRVA: 0x0 -PE32-NEXT: DebugSize: 0x0 -PE32-NEXT: ArchitectureRVA: 0x0 -PE32-NEXT: ArchitectureSize: 0x0 -PE32-NEXT: GlobalPtrRVA: 0x0 -PE32-NEXT: GlobalPtrSize: 0x0 -PE32-NEXT: TLSTableRVA: 0x0 -PE32-NEXT: TLSTableSize: 0x0 -PE32-NEXT: LoadConfigTableRVA: 0x0 -PE32-NEXT: LoadConfigTableSize: 0x0 -PE32-NEXT: BoundImportRVA: 0x0 -PE32-NEXT: BoundImportSize: 0x0 -PE32-NEXT: IATRVA: 0x0 -PE32-NEXT: IATSize: 0x0 -PE32-NEXT: DelayImportDescriptorRVA: 0x0 -PE32-NEXT: DelayImportDescriptorSize: 0x0 -PE32-NEXT: CLRRuntimeHeaderRVA: 0x0 -PE32-NEXT: CLRRuntimeHeaderSize: 0x0 -PE32-NEXT: ReservedRVA: 0x0 -PE32-NEXT: ReservedSize: 0x0 -PE32-NEXT: } -PE32-NEXT: } -PE32-NEXT: DOSHeader { -PE32-NEXT: Magic: MZ -PE32-NEXT: UsedBytesInTheLastPage: 144 -PE32-NEXT: FileSizeInPages: 3 -PE32-NEXT: NumberOfRelocationItems: 0 -PE32-NEXT: HeaderSizeInParagraphs: 4 -PE32-NEXT: MinimumExtraParagraphs: 0 -PE32-NEXT: MaximumExtraParagraphs: 65535 -PE32-NEXT: InitialRelativeSS: 0 -PE32-NEXT: InitialSP: 184 -PE32-NEXT: Checksum: 0 -PE32-NEXT: InitialIP: 0 -PE32-NEXT: InitialRelativeCS: 0 -PE32-NEXT: AddressOfRelocationTable: 64 -PE32-NEXT: OverlayNumber: 0 -PE32-NEXT: OEMid: 0 -PE32-NEXT: OEMinfo: 0 -PE32-NEXT: AddressOfNewExeHeader: 176 -PE32-NEXT: } - -COFF-UNKNOWN: Format: COFF- -COFF-UNKNOWN-NEXT: Arch: unknown -COFF-UNKNOWN-NEXT: AddressSize: 32bit -COFF-UNKNOWN-NEXT: ImageFileHeader { -COFF-UNKNOWN-NEXT: Machine: IMAGE_FILE_MACHINE_UNKNOWN (0x0) -COFF-UNKNOWN-NEXT: SectionCount: 3 -COFF-UNKNOWN-NEXT: TimeDateStamp: 2013-11-14 21:19:28 (0x52853E60) -COFF-UNKNOWN-NEXT: PointerToSymbolTable: 0xF8 -COFF-UNKNOWN-NEXT: SymbolCount: 11 -COFF-UNKNOWN-NEXT: OptionalHeaderSize: 0 -COFF-UNKNOWN-NEXT: Characteristics [ (0x0) -COFF-UNKNOWN-NEXT: ] -COFF-UNKNOWN-NEXT: } - -COFF-IMPORTLIB: Format: COFF-import-file -COFF-IMPORTLIB-NEXT: Type: code -COFF-IMPORTLIB-NEXT: Name type: noprefix -COFF-IMPORTLIB-NEXT: Symbol: __imp__func -COFF-IMPORTLIB-NEXT: Symbol: _func - -ELF-LANAI: Format: ELF32-lanai -ELF-LANAI-NEXT: Arch: lanai -ELF-LANAI-NEXT: AddressSize: 32bit -ELF-LANAI-NEXT: LoadName: -ELF-LANAI-NEXT: ElfHeader { -ELF-LANAI-NEXT: Ident { -ELF-LANAI-NEXT: Magic: (7F 45 4C 46) -ELF-LANAI-NEXT: Class: 32-bit (0x1) -ELF-LANAI-NEXT: DataEncoding: BigEndian (0x2) -ELF-LANAI-NEXT: FileVersion: 1 -ELF-LANAI-NEXT: OS/ABI: SystemV (0x0) -ELF-LANAI-NEXT: ABIVersion: 0 -ELF-LANAI-NEXT: Unused: (00 00 00 00 00 00 00) -ELF-LANAI-NEXT: } -ELF-LANAI-NEXT: Type: Relocatable (0x1) -ELF-LANAI-NEXT: Machine: EM_LANAI (0xF4) -ELF-LANAI-NEXT: Version: 1 -ELF-LANAI-NEXT: Entry: 0x0 -ELF-LANAI-NEXT: ProgramHeaderOffset: 0x0 -ELF-LANAI-NEXT: SectionHeaderOffset: 0x1A0 -ELF-LANAI-NEXT: Flags [ (0x0) -ELF-LANAI-NEXT: ] -ELF-LANAI-NEXT: HeaderSize: 52 -ELF-LANAI-NEXT: ProgramHeaderEntrySize: 0 -ELF-LANAI-NEXT: ProgramHeaderCount: 0 -ELF-LANAI-NEXT: SectionHeaderEntrySize: 40 -ELF-LANAI-NEXT: SectionHeaderCount: 8 -ELF-LANAI-NEXT: StringTableSectionIndex: 1 -ELF-LANAI-NEXT: } - -WASM: Format: WASM -WASM-NEXT: Arch: wasm32 -WASM-NEXT: AddressSize: 32bit -WASM-NEXT: Version: 0x1 +# RUN: yaml2obj %s --docnum=1 -o %t1.coff-arm +# RUN: llvm-readobj -h %t1.coff-arm | FileCheck %s -check-prefix COFF-ARM + +# COFF-ARM: File: {{.*}}.coff-arm +# COFF-ARM-NEXT: Format: COFF-ARM +# COFF-ARM-NEXT: Arch: thumb +# COFF-ARM-NEXT: AddressSize: 32bit +# COFF-ARM-NEXT: ImageFileHeader { +# COFF-ARM-NEXT: Machine: IMAGE_FILE_MACHINE_ARMNT (0x1C4) +# COFF-ARM-NEXT: SectionCount: 0 +# COFF-ARM-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# COFF-ARM-NEXT: PointerToSymbolTable: 0x0 +# COFF-ARM-NEXT: SymbolCount: 0 +# COFF-ARM-NEXT: OptionalHeaderSize: 0 +# COFF-ARM-NEXT: Characteristics [ (0x0) +# COFF-ARM-NEXT: ] +# COFF-ARM-NEXT: } + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_ARMNT + Characteristics: [ ] +sections: +symbols: + +# RUN: yaml2obj %s --docnum=2 -o %t2.coff-arm64 +# RUN: llvm-readobj -h %t2.coff-arm64 | FileCheck %s -check-prefix COFF-ARM64 + +# COFF-ARM64: File: {{.*}}.coff-arm64 +# COFF-ARM64-NEXT: Format: COFF-ARM64 +# COFF-ARM64-NEXT: Arch: aarch64 +# COFF-ARM64-NEXT: AddressSize: 64bit +# COFF-ARM64-NEXT: ImageFileHeader { +# COFF-ARM64-NEXT: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64) +# COFF-ARM64-NEXT: SectionCount: 0 +# COFF-ARM64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# COFF-ARM64-NEXT: PointerToSymbolTable: 0x0 +# COFF-ARM64-NEXT: SymbolCount: 0 +# COFF-ARM64-NEXT: OptionalHeaderSize: 0 +# COFF-ARM64-NEXT: Characteristics [ (0x0) +# COFF-ARM64-NEXT: ] +# COFF-ARM64-NEXT: } + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_ARM64 + Characteristics: [ ] +sections: +symbols: + +# RUN: yaml2obj %s --docnum=3 -o %t3.coff-i386 +# RUN: llvm-readobj -h %t3.coff-i386 | FileCheck %s -check-prefix COFF32 + +# COFF32: File: {{.*}}.coff-i386 +# COFF32-NEXT: Format: COFF-i386 +# COFF32-NEXT: Arch: i386 +# COFF32-NEXT: AddressSize: 32bit +# COFF32-NEXT: ImageFileHeader { +# COFF32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) +# COFF32-NEXT: SectionCount: 0 +# COFF32-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# COFF32-NEXT: PointerToSymbolTable: 0x0 +# COFF32-NEXT: SymbolCount: 0 +# COFF32-NEXT: OptionalHeaderSize: 0 +# COFF32-NEXT: Characteristics [ (0x0) +# COFF32-NEXT: ] +# COFF32-NEXT: } + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_I386 + Characteristics: [ ] +sections: +symbols: + +# RUN: yaml2obj %s --docnum=4 -o %t4.coff-x86-64 +# RUN: llvm-readobj -h %t4.coff-x86-64 | FileCheck %s -check-prefix COFF64 + +# COFF64: File: {{.*}}.coff-x86-64 +# COFF64-NEXT: Format: COFF-x86-64 +# COFF64-NEXT: Arch: x86_64 +# COFF64-NEXT: AddressSize: 64bit +# COFF64-NEXT: ImageFileHeader { +# COFF64-NEXT: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664) +# COFF64-NEXT: SectionCount: 0 +# COFF64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# COFF64-NEXT: PointerToSymbolTable: 0x0 +# COFF64-NEXT: SymbolCount: 0 +# COFF64-NEXT: OptionalHeaderSize: 0 +# COFF64-NEXT: Characteristics [ (0x0) +# COFF64-NEXT: ] +# COFF64-NEXT: } + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ ] +sections: +symbols: + +# RUN: yaml2obj %s --docnum=5 -o %t5.coff-i386 +# RUN: llvm-readobj -h %t5.coff-i386 | FileCheck %s -check-prefix PE32 + +# PE32: File: {{.*}}.coff-i386 +# PE32-NEXT: Format: COFF-i386 +# PE32-NEXT: Arch: i386 +# PE32-NEXT: AddressSize: 32bit +# PE32-NEXT: ImageFileHeader { +# PE32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) +# PE32-NEXT: SectionCount: 0 +# PE32-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# PE32-NEXT: PointerToSymbolTable: 0x0 +# PE32-NEXT: SymbolCount: 0 +# PE32-NEXT: OptionalHeaderSize: 224 +# PE32-NEXT: Characteristics [ (0x102) +# PE32-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100) +# PE32-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2) +# PE32-NEXT: ] +# PE32-NEXT: } +# PE32-NEXT: ImageOptionalHeader { +# PE32-NEXT: Magic: 0x10B +# PE32-NEXT: MajorLinkerVersion: 0 +# PE32-NEXT: MinorLinkerVersion: 0 +# PE32-NEXT: SizeOfCode: 0 +# PE32-NEXT: SizeOfInitializedData: 0 +# PE32-NEXT: SizeOfUninitializedData: 0 +# PE32-NEXT: AddressOfEntryPoint: 0x1000 +# PE32-NEXT: BaseOfCode: 0x0 +# PE32-NEXT: BaseOfData: 0x0 +# PE32-NEXT: ImageBase: 0x400000 +# PE32-NEXT: SectionAlignment: 4096 +# PE32-NEXT: FileAlignment: 512 +# PE32-NEXT: MajorOperatingSystemVersion: 6 +# PE32-NEXT: MinorOperatingSystemVersion: 0 +# PE32-NEXT: MajorImageVersion: 0 +# PE32-NEXT: MinorImageVersion: 0 +# PE32-NEXT: MajorSubsystemVersion: 6 +# PE32-NEXT: MinorSubsystemVersion: 0 +# PE32-NEXT: SizeOfImage: 4096 +# PE32-NEXT: SizeOfHeaders: 512 +# PE32-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3) +# PE32-NEXT: Characteristics [ (0x8140) +# PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40) +# PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100) +# PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000) +# PE32-NEXT: ] +# PE32-NEXT: SizeOfStackReserve: 1048576 +# PE32-NEXT: SizeOfStackCommit: 4096 +# PE32-NEXT: SizeOfHeapReserve: 1048576 +# PE32-NEXT: SizeOfHeapCommit: 4096 +# PE32-NEXT: NumberOfRvaAndSize: 16 +# PE32-NEXT: DataDirectory { +# PE32-NEXT: ExportTableRVA: 0x0 +# PE32-NEXT: ExportTableSize: 0x0 +# PE32-NEXT: ImportTableRVA: 0x0 +# PE32-NEXT: ImportTableSize: 0x0 +# PE32-NEXT: ResourceTableRVA: 0x0 +# PE32-NEXT: ResourceTableSize: 0x0 +# PE32-NEXT: ExceptionTableRVA: 0x0 +# PE32-NEXT: ExceptionTableSize: 0x0 +# PE32-NEXT: CertificateTableRVA: 0x0 +# PE32-NEXT: CertificateTableSize: 0x0 +# PE32-NEXT: BaseRelocationTableRVA: 0x0 +# PE32-NEXT: BaseRelocationTableSize: 0x0 +# PE32-NEXT: DebugRVA: 0x0 +# PE32-NEXT: DebugSize: 0x0 +# PE32-NEXT: ArchitectureRVA: 0x0 +# PE32-NEXT: ArchitectureSize: 0x0 +# PE32-NEXT: GlobalPtrRVA: 0x0 +# PE32-NEXT: GlobalPtrSize: 0x0 +# PE32-NEXT: TLSTableRVA: 0x0 +# PE32-NEXT: TLSTableSize: 0x0 +# PE32-NEXT: LoadConfigTableRVA: 0x0 +# PE32-NEXT: LoadConfigTableSize: 0x0 +# PE32-NEXT: BoundImportRVA: 0x0 +# PE32-NEXT: BoundImportSize: 0x0 +# PE32-NEXT: IATRVA: 0x0 +# PE32-NEXT: IATSize: 0x0 +# PE32-NEXT: DelayImportDescriptorRVA: 0x0 +# PE32-NEXT: DelayImportDescriptorSize: 0x0 +# PE32-NEXT: CLRRuntimeHeaderRVA: 0x0 +# PE32-NEXT: CLRRuntimeHeaderSize: 0x0 +# PE32-NEXT: ReservedRVA: 0x0 +# PE32-NEXT: ReservedSize: 0x0 +# PE32-NEXT: } +# PE32-NEXT: } +# PE32-NEXT: DOSHeader { +# PE32-NEXT: Magic: MZ +# PE32-NEXT: UsedBytesInTheLastPage: 0 +# PE32-NEXT: FileSizeInPages: 0 +# PE32-NEXT: NumberOfRelocationItems: 0 +# PE32-NEXT: HeaderSizeInParagraphs: 0 +# PE32-NEXT: MinimumExtraParagraphs: 0 +# PE32-NEXT: MaximumExtraParagraphs: 0 +# PE32-NEXT: InitialRelativeSS: 0 +# PE32-NEXT: InitialSP: 0 +# PE32-NEXT: Checksum: 0 +# PE32-NEXT: InitialIP: 0 +# PE32-NEXT: InitialRelativeCS: 0 +# PE32-NEXT: AddressOfRelocationTable: 64 +# PE32-NEXT: OverlayNumber: 0 +# PE32-NEXT: OEMid: 0 +# PE32-NEXT: OEMinfo: 0 +# PE32-NEXT: AddressOfNewExeHeader: 128 +# PE32-NEXT: } + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4096 + ImageBase: 4194304 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 + ExportTable: + RelativeVirtualAddress: 0 + Size: 0 + ImportTable: + RelativeVirtualAddress: 0 + Size: 0 + ResourceTable: + RelativeVirtualAddress: 0 + Size: 0 + ExceptionTable: + RelativeVirtualAddress: 0 + Size: 0 + CertificateTable: + RelativeVirtualAddress: 0 + Size: 0 + BaseRelocationTable: + RelativeVirtualAddress: 0 + Size: 0 + Debug: + RelativeVirtualAddress: 0 + Size: 0 + Architecture: + RelativeVirtualAddress: 0 + Size: 0 + GlobalPtr: + RelativeVirtualAddress: 0 + Size: 0 + TlsTable: + RelativeVirtualAddress: 0 + Size: 0 + LoadConfigTable: + RelativeVirtualAddress: 0 + Size: 0 + BoundImport: + RelativeVirtualAddress: 0 + Size: 0 + IAT: + RelativeVirtualAddress: 0 + Size: 0 + DelayImportDescriptor: + RelativeVirtualAddress: 0 + Size: 0 + ClrRuntimeHeader: + RelativeVirtualAddress: 0 + Size: 0 +header: + Machine: IMAGE_FILE_MACHINE_I386 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE ] +sections: +symbols: [] +... + +# RUN: yaml2obj %s --docnum=6 -o %t6.elf-i386 +# RUN: llvm-readobj -h %t6.elf-i386 | FileCheck %s -check-prefix ELF32 + +# ELF32: File: {{.*}}elf-i386 +# ELF32-NEXT: Format: ELF32-i386 +# ELF32-NEXT: Arch: i386 +# ELF32-NEXT: AddressSize: 32bit +# ELF32-NEXT: LoadName: +# ELF32-NEXT: ElfHeader { +# ELF32-NEXT: Ident { +# ELF32-NEXT: Magic: (7F 45 4C 46) +# ELF32-NEXT: Class: 32-bit (0x1) +# ELF32-NEXT: DataEncoding: LittleEndian (0x1) +# ELF32-NEXT: FileVersion: 1 +# ELF32-NEXT: OS/ABI: GNU/Linux (0x3) +# ELF32-NEXT: ABIVersion: 0 +# ELF32-NEXT: Unused: (00 00 00 00 00 00 00) +# ELF32-NEXT: } +# ELF32-NEXT: Type: Relocatable (0x1) +# ELF32-NEXT: Machine: EM_386 (0x3) +# ELF32-NEXT: Version: 1 +# ELF32-NEXT: Entry: 0x0 +# ELF32-NEXT: ProgramHeaderOffset: 0x34 +# ELF32-NEXT: SectionHeaderOffset: 0x34 +# ELF32-NEXT: Flags [ (0x0) +# ELF32-NEXT: ] +# ELF32-NEXT: HeaderSize: 52 +# ELF32-NEXT: ProgramHeaderEntrySize: 32 +# ELF32-NEXT: ProgramHeaderCount: 0 +# ELF32-NEXT: SectionHeaderEntrySize: 40 +# ELF32-NEXT: SectionHeaderCount: 4 +# ELF32-NEXT: StringTableSectionIndex: 3 +# ELF32-NEXT: } + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_386 + +# RUN: yaml2obj %s --docnum=7 -o %t7.elf-x86-64 +# RUN: llvm-readobj -h %t7.elf-x86-64 | FileCheck %s -check-prefix ELF64 + +# ELF64: File: {{.*}}elf-x86-64 +# ELF64-NEXT: Format: ELF64-x86-64 +# ELF64-NEXT: Arch: x86_64 +# ELF64-NEXT: AddressSize: 64bit +# ELF64-NEXT: LoadName: +# ELF64-NEXT: ElfHeader { +# ELF64-NEXT: Ident { +# ELF64-NEXT: Magic: (7F 45 4C 46) +# ELF64-NEXT: Class: 64-bit (0x2) +# ELF64-NEXT: DataEncoding: LittleEndian (0x1) +# ELF64-NEXT: FileVersion: 1 +# ELF64-NEXT: OS/ABI: GNU/Linux (0x3) +# ELF64-NEXT: ABIVersion: 0 +# ELF64-NEXT: Unused: (00 00 00 00 00 00 00) +# ELF64-NEXT: } +# ELF64-NEXT: Type: Relocatable (0x1) +# ELF64-NEXT: Machine: EM_X86_64 (0x3E) +# ELF64-NEXT: Version: 1 +# ELF64-NEXT: Entry: 0x0 +# ELF64-NEXT: ProgramHeaderOffset: 0x40 +# ELF64-NEXT: SectionHeaderOffset: 0x40 +# ELF64-NEXT: Flags [ (0x0) +# ELF64-NEXT: ] +# ELF64-NEXT: HeaderSize: 64 +# ELF64-NEXT: ProgramHeaderEntrySize: 56 +# ELF64-NEXT: ProgramHeaderCount: 0 +# ELF64-NEXT: SectionHeaderEntrySize: 64 +# ELF64-NEXT: SectionHeaderCount: 4 +# ELF64-NEXT: StringTableSectionIndex: 3 +# ELF64-NEXT: } + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_GNU + Type: ET_REL + Machine: EM_X86_64 + +# RUN: yaml2obj %s --docnum=8 -o %t8.macho-i386 +# RUN: llvm-readobj -h %t8.macho-i386 | FileCheck %s -check-prefix MACHO32 + +# MACHO32: File: {{.*}}.macho-i386 +# MACHO32-NEXT: Format: Mach-O 32-bit i386 +# MACHO32-NEXT: Arch: i386 +# MACHO32-NEXT: AddressSize: 32bit +# MACHO32-NEXT: MachHeader { +# MACHO32-NEXT: Magic: Magic (0xFEEDFACE) +# MACHO32-NEXT: CpuType: X86 (0x7) +# MACHO32-NEXT: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3) +# MACHO32-NEXT: FileType: Relocatable (0x1) +# MACHO32-NEXT: NumOfLoadCommands: 0 +# MACHO32-NEXT: SizeOfLoadCommands: 0 +# MACHO32-NEXT: Flags [ (0x2000) +# MACHO32-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) +# MACHO32-NEXT: ] +# MACHO32-NEXT: } + +--- !mach-o +FileHeader: + magic: 0xFEEDFACE + cputype: 0x00000007 + cpusubtype: 0x00000003 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00002000 + +# RUN: yaml2obj %s --docnum=9 -o %t9.macho-x86-64 +# RUN: llvm-readobj -h %t9.macho-x86-64 | FileCheck %s -check-prefix MACHO64 + +# MACHO64: File: {{.*}}.macho-x86-64 +# MACHO64-NEXT: Format: Mach-O 64-bit x86-64 +# MACHO64-NEXT: Arch: x86_64 +# MACHO64-NEXT: AddressSize: 64bit +# MACHO64-NEXT: MachHeader { +# MACHO64-NEXT: Magic: Magic64 (0xFEEDFACF) +# MACHO64-NEXT: CpuType: X86-64 (0x1000007) +# MACHO64-NEXT: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3) +# MACHO64-NEXT: FileType: Relocatable (0x1) +# MACHO64-NEXT: NumOfLoadCommands: 0 +# MACHO64-NEXT: SizeOfLoadCommands: 0 +# MACHO64-NEXT: Flags [ (0x2000) +# MACHO64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) +# MACHO64-NEXT: ] +# MACHO64-NEXT: Reserved: 0x0 +# MACHO64-NEXT: } + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00002000 + reserved: 0x00000000 + +# RUN: yaml2obj %s --docnum=10 -o %t10.macho-ppc +# RUN: llvm-readobj -h %t10.macho-ppc | FileCheck %s -check-prefix MACHO-PPC + +# MACHO-PPC: File: {{.*}}.macho-ppc +# MACHO-PPC-NEXT: Format: Mach-O 32-bit ppc +# MACHO-PPC-NEXT: Arch: powerpc +# MACHO-PPC-NEXT: AddressSize: 32bit +# MACHO-PPC-NEXT: MachHeader { +# MACHO-PPC-NEXT: Magic: Magic (0xFEEDFACE) +# MACHO-PPC-NEXT: CpuType: PowerPC (0x12) +# MACHO-PPC-NEXT: CpuSubType: CPU_SUBTYPE_POWERPC_ALL (0x0) +# MACHO-PPC-NEXT: FileType: Relocatable (0x1) +# MACHO-PPC-NEXT: NumOfLoadCommands: 0 +# MACHO-PPC-NEXT: SizeOfLoadCommands: 0 +# MACHO-PPC-NEXT: Flags [ (0x2000) +# MACHO-PPC-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) +# MACHO-PPC-NEXT: ] +# MACHO-PPC-NEXT: } + +--- !mach-o +IsLittleEndian: false +FileHeader: + magic: 0xFEEDFACE + cputype: 0x00000012 + cpusubtype: 0x00000000 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00002000 + +# RUN: yaml2obj %s --docnum=11 -o %t11.macho-ppc +# RUN: llvm-readobj -h %t11.macho-ppc | FileCheck %s -check-prefix MACHO-PPC64 + +# MACHO-PPC64: File: {{.*}}.macho-ppc +# MACHO-PPC64-NEXT: Format: Mach-O 64-bit ppc64 +# MACHO-PPC64-NEXT: Arch: powerpc64 +# MACHO-PPC64-NEXT: AddressSize: 64bit +# MACHO-PPC64-NEXT: MachHeader { +# MACHO-PPC64-NEXT: Magic: Magic64 (0xFEEDFACF) +# MACHO-PPC64-NEXT: CpuType: PowerPC64 (0x1000012) +# MACHO-PPC64-NEXT: CpuSubtype: 0x0 +# MACHO-PPC64-NEXT: FileType: Relocatable (0x1) +# MACHO-PPC64-NEXT: NumOfLoadCommands: 0 +# MACHO-PPC64-NEXT: SizeOfLoadCommands: 0 +# MACHO-PPC64-NEXT: Flags [ (0x2000) +# MACHO-PPC64-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) +# MACHO-PPC64-NEXT: ] +# MACHO-PPC64-NEXT: Reserved: 0x0 +# MACHO-PPC64-NEXT: } + +--- !mach-o +IsLittleEndian: false +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000012 + cpusubtype: 0x00000000 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00002000 + reserved: 0x00000000 + +# RUN: yaml2obj %s --docnum=12 -o %t12.macho-arm +# RUN: llvm-readobj -h %t12.macho-arm | FileCheck %s -check-prefix MACHO-ARM + +# MACHO-ARM: File: {{.*}}.macho-arm +# MACHO-ARM-NEXT: Format: Mach-O arm +# MACHO-ARM-NEXT: Arch: arm +# MACHO-ARM-NEXT: AddressSize: 32bit +# MACHO-ARM-NEXT: MachHeader { +# MACHO-ARM-NEXT: Magic: Magic (0xFEEDFACE) +# MACHO-ARM-NEXT: CpuType: Arm (0xC) +# MACHO-ARM-NEXT: CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9) +# MACHO-ARM-NEXT: FileType: Relocatable (0x1) +# MACHO-ARM-NEXT: NumOfLoadCommands: 0 +# MACHO-ARM-NEXT: SizeOfLoadCommands: 0 +# MACHO-ARM-NEXT: Flags [ (0x2000) +# MACHO-ARM-NEXT: MH_SUBSECTIONS_VIA_SYMBOLS (0x2000) +# MACHO-ARM-NEXT: ] +# MACHO-ARM-NEXT: } + +--- !mach-o +FileHeader: + magic: 0xFEEDFACE + cputype: 0x0000000C + cpusubtype: 0x00000009 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00002000 + +# RUN: yaml2obj %s --docnum=13 -o %t13.coff-unknown +# RUN: llvm-readobj -h %t13.coff-unknown | FileCheck %s -check-prefix COFF-UNKNOWN + +# COFF-UNKNOWN: Format: COFF- +# COFF-UNKNOWN-NEXT: Arch: unknown +# COFF-UNKNOWN-NEXT: AddressSize: 32bit +# COFF-UNKNOWN-NEXT: ImageFileHeader { +# COFF-UNKNOWN-NEXT: Machine: IMAGE_FILE_MACHINE_UNKNOWN (0x0) +# COFF-UNKNOWN-NEXT: SectionCount: 0 +# COFF-UNKNOWN-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0) +# COFF-UNKNOWN-NEXT: PointerToSymbolTable: 0x0 +# COFF-UNKNOWN-NEXT: SymbolCount: 0 +# COFF-UNKNOWN-NEXT: OptionalHeaderSize: 0 +# COFF-UNKNOWN-NEXT: Characteristics [ (0x0) +# COFF-UNKNOWN-NEXT: ] +# COFF-UNKNOWN-NEXT: } + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_UNKNOWN + Characteristics: [ ] +sections: +symbols: + +# RUN: llvm-readobj -h %p/Inputs/magic.coff-importlib \ +# RUN: | FileCheck %s -check-prefix COFF-IMPORTLIB + +# COFF-IMPORTLIB: Format: COFF-import-file +# COFF-IMPORTLIB-NEXT: Type: code +# COFF-IMPORTLIB-NEXT: Name type: noprefix +# COFF-IMPORTLIB-NEXT: Symbol: __imp__func +# COFF-IMPORTLIB-NEXT: Symbol: _func + +# RUN: yaml2obj %s --docnum=14 -o %t14.elf-lanai +# RUN: llvm-readobj -h %t14.elf-lanai | FileCheck %s -check-prefix ELF-LANAI + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2MSB + Type: ET_REL + Machine: EM_LANAI + +# ELF-LANAI: Format: ELF32-lanai +# ELF-LANAI-NEXT: Arch: lanai +# ELF-LANAI-NEXT: AddressSize: 32bit +# ELF-LANAI-NEXT: LoadName: +# ELF-LANAI-NEXT: ElfHeader { +# ELF-LANAI-NEXT: Ident { +# ELF-LANAI-NEXT: Magic: (7F 45 4C 46) +# ELF-LANAI-NEXT: Class: 32-bit (0x1) +# ELF-LANAI-NEXT: DataEncoding: BigEndian (0x2) +# ELF-LANAI-NEXT: FileVersion: 1 +# ELF-LANAI-NEXT: OS/ABI: SystemV (0x0) +# ELF-LANAI-NEXT: ABIVersion: 0 +# ELF-LANAI-NEXT: Unused: (00 00 00 00 00 00 00) +# ELF-LANAI-NEXT: } +# ELF-LANAI-NEXT: Type: Relocatable (0x1) +# ELF-LANAI-NEXT: Machine: EM_LANAI (0xF4) +# ELF-LANAI-NEXT: Version: 1 +# ELF-LANAI-NEXT: Entry: 0x0 +# ELF-LANAI-NEXT: ProgramHeaderOffset: 0x34 +# ELF-LANAI-NEXT: SectionHeaderOffset: 0x34 +# ELF-LANAI-NEXT: Flags [ (0x0) +# ELF-LANAI-NEXT: ] +# ELF-LANAI-NEXT: HeaderSize: 52 +# ELF-LANAI-NEXT: ProgramHeaderEntrySize: 32 +# ELF-LANAI-NEXT: ProgramHeaderCount: 0 +# ELF-LANAI-NEXT: SectionHeaderEntrySize: 40 +# ELF-LANAI-NEXT: SectionHeaderCount: 4 +# ELF-LANAI-NEXT: StringTableSectionIndex: 3 +# ELF-LANAI-NEXT: } + +# RUN: yaml2obj %s --docnum=15 -o %t15.wasm +# RUN: llvm-readobj -h %t15.wasm | FileCheck %s -check-prefix WASM + +# WASM: Format: WASM +# WASM-NEXT: Arch: wasm32 +# WASM-NEXT: AddressSize: 32bit +# WASM-NEXT: Version: 0x1 + +--- !WASM +FileHeader: + Version: 0x00000001