1 RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-i386 \ 2 RUN: | FileCheck %s -check-prefix COFF32 3 RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-x86-64 \ 4 RUN: | FileCheck %s -check-prefix COFF64 5 RUN: llvm-readobj -h %p/Inputs/trivial.exe.coff-i386 \ 6 RUN: | FileCheck %s -check-prefix PE32 7 RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 \ 8 RUN: | FileCheck %s -check-prefix ELF32 9 RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 \ 10 RUN: | FileCheck %s -check-prefix ELF64 11 12 COFF32: File: {{(.*[/\\])?}}trivial.obj.coff-i386 13 COFF32-NEXT: Format: COFF-i386 14 COFF32-NEXT: Arch: i386 15 COFF32-NEXT: AddressSize: 32bit 16 COFF32-NEXT: ImageFileHeader { 17 COFF32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) 18 COFF32-NEXT: SectionCount: 2 19 COFF32-NEXT: TimeDateStamp: 2013-03-20 17:56:46 (0x5149F85E) 20 COFF32-NEXT: PointerToSymbolTable: 0xA5 21 COFF32-NEXT: SymbolCount: 7 22 COFF32-NEXT: OptionalHeaderSize: 0 23 COFF32-NEXT: Characteristics [ (0x0) 24 COFF32-NEXT: ] 25 COFF32-NEXT: } 26 27 COFF64: File: {{(.*[/\\])?}}trivial.obj.coff-x86-64 28 COFF64-NEXT: Format: COFF-x86-64 29 COFF64-NEXT: Arch: x86_64 30 COFF64-NEXT: AddressSize: 64bit 31 COFF64-NEXT: ImageFileHeader { 32 COFF64-NEXT: Machine: IMAGE_FILE_MACHINE_AMD64 (0x8664) 33 COFF64-NEXT: SectionCount: 2 34 COFF64-NEXT: TimeDateStamp: 2013-03-20 17:56:46 (0x5149F85E) 35 COFF64-NEXT: PointerToSymbolTable: 0xAB 36 COFF64-NEXT: SymbolCount: 7 37 COFF64-NEXT: OptionalHeaderSize: 0 38 COFF64-NEXT: Characteristics [ (0x0) 39 COFF64-NEXT: ] 40 COFF64-NEXT: } 41 42 ELF32: File: {{(.*[/\\])?}}trivial.obj.elf-i386 43 ELF32-NEXT: Format: ELF32-i386 44 ELF32-NEXT: Arch: i386 45 ELF32-NEXT: AddressSize: 32bit 46 ELF32-NEXT: LoadName: 47 ELF32-NEXT: ElfHeader { 48 ELF32-NEXT: Ident { 49 ELF32-NEXT: Magic: (7F 45 4C 46) 50 ELF32-NEXT: Class: 32-bit (0x1) 51 ELF32-NEXT: DataEncoding: LittleEndian (0x1) 52 ELF32-NEXT: FileVersion: 1 53 ELF32-NEXT: OS/ABI: GNU/Linux (0x3) 54 ELF32-NEXT: ABIVersion: 0 55 ELF32-NEXT: Unused: (00 00 00 00 00 00 00) 56 ELF32-NEXT: } 57 ELF32-NEXT: Type: Relocatable (0x1) 58 ELF32-NEXT: Machine: EM_386 (0x3) 59 ELF32-NEXT: Version: 1 60 ELF32-NEXT: Entry: 0x0 61 ELF32-NEXT: ProgramHeaderOffset: 0x0 62 ELF32-NEXT: SectionHeaderOffset: 0xC8 63 ELF32-NEXT: Flags [ (0x0) 64 ELF32-NEXT: ] 65 ELF32-NEXT: HeaderSize: 52 66 ELF32-NEXT: ProgramHeaderEntrySize: 0 67 ELF32-NEXT: ProgramHeaderCount: 0 68 ELF32-NEXT: SectionHeaderEntrySize: 40 69 ELF32-NEXT: SectionHeaderCount: 10 70 ELF32-NEXT: StringTableSectionIndex: 7 71 ELF32-NEXT: } 72 73 ELF64: File: {{(.*[/\\])?}}trivial.obj.elf-x86-64 74 ELF64-NEXT: Format: ELF64-x86-64 75 ELF64-NEXT: Arch: x86_64 76 ELF64-NEXT: AddressSize: 64bit 77 ELF64-NEXT: LoadName: 78 ELF64-NEXT: ElfHeader { 79 ELF64-NEXT: Ident { 80 ELF64-NEXT: Magic: (7F 45 4C 46) 81 ELF64-NEXT: Class: 64-bit (0x2) 82 ELF64-NEXT: DataEncoding: LittleEndian (0x1) 83 ELF64-NEXT: FileVersion: 1 84 ELF64-NEXT: OS/ABI: GNU/Linux (0x3) 85 ELF64-NEXT: ABIVersion: 0 86 ELF64-NEXT: Unused: (00 00 00 00 00 00 00) 87 ELF64-NEXT: } 88 ELF64-NEXT: Type: Relocatable (0x1) 89 ELF64-NEXT: Machine: EM_X86_64 (0x3E) 90 ELF64-NEXT: Version: 1 91 ELF64-NEXT: Entry: 0x0 92 ELF64-NEXT: ProgramHeaderOffset: 0x0 93 ELF64-NEXT: SectionHeaderOffset: 0xB8 94 ELF64-NEXT: Flags [ (0x0) 95 ELF64-NEXT: ] 96 ELF64-NEXT: HeaderSize: 64 97 ELF64-NEXT: ProgramHeaderEntrySize: 0 98 ELF64-NEXT: ProgramHeaderCount: 0 99 ELF64-NEXT: SectionHeaderEntrySize: 64 100 ELF64-NEXT: SectionHeaderCount: 10 101 ELF64-NEXT: StringTableSectionIndex: 7 102 ELF64-NEXT: } 103 104 PE32: File: {{(.*[/\\])?}}trivial.exe.coff-i386 105 PE32-NEXT: Format: COFF-i386 106 PE32-NEXT: Arch: i386 107 PE32-NEXT: AddressSize: 32bit 108 PE32-NEXT: ImageFileHeader { 109 PE32-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C) 110 PE32-NEXT: SectionCount: 3 111 PE32-NEXT: TimeDateStamp: 2013-07-16 00:39:15 (0x51E49633) 112 PE32-NEXT: PointerToSymbolTable: 0x0 113 PE32-NEXT: SymbolCount: 0 114 PE32-NEXT: OptionalHeaderSize: 224 115 PE32-NEXT: Characteristics [ (0x102) 116 PE32-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100) 117 PE32-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2) 118 PE32-NEXT: ] 119 PE32-NEXT: } 120 PE32-NEXT: ImageOptionalHeader { 121 PE32-NEXT: MajorLinkerVersion: 11 122 PE32-NEXT: MinorLinkerVersion: 0 123 PE32-NEXT: SizeOfCode: 512 124 PE32-NEXT: SizeOfInitializedData: 1024 125 PE32-NEXT: SizeOfUninitializedData: 0 126 PE32-NEXT: AddressOfEntryPoint: 0x1000 127 PE32-NEXT: BaseOfCode: 0x1000 128 PE32-NEXT: BaseOfData: 0x2000 129 PE32-NEXT: ImageBase: 0x400000 130 PE32-NEXT: SectionAlignment: 4096 131 PE32-NEXT: FileAlignment: 512 132 PE32-NEXT: MajorOperatingSystemVersion: 6 133 PE32-NEXT: MinorOperatingSystemVersion: 0 134 PE32-NEXT: MajorImageVersion: 0 135 PE32-NEXT: MinorImageVersion: 0 136 PE32-NEXT: MajorSubsystemVersion: 6 137 PE32-NEXT: MinorSubsystemVersion: 0 138 PE32-NEXT: SizeOfImage: 16384 139 PE32-NEXT: SizeOfHeaders: 1024 140 PE32-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3) 141 PE32-NEXT: Subsystem [ (0x8140) 142 PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40) 143 PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100) 144 PE32-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000) 145 PE32-NEXT: ] 146 PE32-NEXT: SizeOfStackReserve: 1048576 147 PE32-NEXT: SizeOfStackCommit: 4096 148 PE32-NEXT: SizeOfHeapReserve: 1048576 149 PE32-NEXT: SizeOfHeapCommit: 4096 150 PE32-NEXT: NumberOfRvaAndSize: 16 151 PE32-NEXT: DataDirectory { 152 PE32-NEXT: ExportTableRVA: 0x0 153 PE32-NEXT: ExportTableSize: 0x0 154 PE32-NEXT: ImportTableRVA: 0x0 155 PE32-NEXT: ImportTableSize: 0x0 156 PE32-NEXT: ResourceTableRVA: 0x0 157 PE32-NEXT: ResourceTableSize: 0x0 158 PE32-NEXT: ExceptionTableRVA: 0x0 159 PE32-NEXT: ExceptionTableSize: 0x0 160 PE32-NEXT: CertificateTableRVA: 0x0 161 PE32-NEXT: CertificateTableSize: 0x0 162 PE32-NEXT: BaseRelocationTableRVA: 0x3000 163 PE32-NEXT: BaseRelocationTableSize: 0xC 164 PE32-NEXT: DebugRVA: 0x0 165 PE32-NEXT: DebugSize: 0x0 166 PE32-NEXT: ArchitectureRVA: 0x0 167 PE32-NEXT: ArchitectureSize: 0x0 168 PE32-NEXT: GlobalPtrRVA: 0x0 169 PE32-NEXT: GlobalPtrSize: 0x0 170 PE32-NEXT: TLSTableRVA: 0x0 171 PE32-NEXT: TLSTableSize: 0x0 172 PE32-NEXT: LoadConfigTableRVA: 0x0 173 PE32-NEXT: LoadConfigTableSize: 0x0 174 PE32-NEXT: BoundImportRVA: 0x0 175 PE32-NEXT: BoundImportSize: 0x0 176 PE32-NEXT: IATRVA: 0x0 177 PE32-NEXT: IATSize: 0x0 178 PE32-NEXT: DelayImportDescriptorRVA: 0x0 179 PE32-NEXT: DelayImportDescriptorSize: 0x0 180 PE32-NEXT: CLRRuntimeHeaderRVA: 0x0 181 PE32-NEXT: CLRRuntimeHeaderSize: 0x0 182 PE32-NEXT: ReservedRVA: 0x0 183 PE32-NEXT: ReservedSize: 0x0 184 PE32-NEXT: } 185 PE32-NEXT: } 186