llvm-project
133 строки · 4.7 Кб
1# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj
2# RUN: lld-link -safeseh:no %t.obj %p/Inputs/std32.lib /subsystem:console \
3# RUN: /entry:main@0 /out:%t.exe /appcontainer
4# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=HEADER %s
5# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORTS %s
6# RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
7
8HEADER: Format: COFF-i386
9HEADER-NEXT: Arch: i386
10HEADER-NEXT: AddressSize: 32bit
11HEADER-NEXT: ImageFileHeader {
12HEADER-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
13HEADER-NEXT: SectionCount: 4
14HEADER-NEXT: TimeDateStamp:
15HEADER-NEXT: PointerToSymbolTable: 0x0
16HEADER-NEXT: SymbolCount: 0
17HEADER-NEXT: StringTableSize: 0
18HEADER-NEXT: OptionalHeaderSize: 224
19HEADER-NEXT: Characteristics [ (0x102)
20HEADER-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100)
21HEADER-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
22HEADER-NEXT: ]
23HEADER-NEXT: }
24HEADER-NEXT: ImageOptionalHeader {
25HEADER-NEXT: Magic: 0x10B
26HEADER-NEXT: MajorLinkerVersion: 14
27HEADER-NEXT: MinorLinkerVersion: 0
28HEADER-NEXT: SizeOfCode: 512
29HEADER-NEXT: SizeOfInitializedData: 1536
30HEADER-NEXT: SizeOfUninitializedData: 0
31HEADER-NEXT: AddressOfEntryPoint: 0x1000
32HEADER-NEXT: BaseOfCode: 0x1000
33HEADER-NEXT: BaseOfData: 0x0
34HEADER-NEXT: ImageBase: 0x400000
35HEADER-NEXT: SectionAlignment: 4096
36HEADER-NEXT: FileAlignment: 512
37HEADER-NEXT: MajorOperatingSystemVersion: 6
38HEADER-NEXT: MinorOperatingSystemVersion: 0
39HEADER-NEXT: MajorImageVersion: 0
40HEADER-NEXT: MinorImageVersion: 0
41HEADER-NEXT: MajorSubsystemVersion: 6
42HEADER-NEXT: MinorSubsystemVersion: 0
43HEADER-NEXT: SizeOfImage: 20480
44HEADER-NEXT: SizeOfHeaders: 1024
45HEADER-NEXT: CheckSum: 0x0
46HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
47HEADER-NEXT: Characteristics [ (0x9140)
48HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_APPCONTAINER (0x1000)
49HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
50HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
51HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
52HEADER-NEXT: ]
53HEADER-NEXT: SizeOfStackReserve: 1048576
54HEADER-NEXT: SizeOfStackCommit: 4096
55HEADER-NEXT: SizeOfHeapReserve: 1048576
56HEADER-NEXT: SizeOfHeapCommit: 4096
57HEADER-NEXT: NumberOfRvaAndSize: 16
58HEADER-NEXT: DataDirectory {
59HEADER-NEXT: ExportTableRVA: 0x0
60HEADER-NEXT: ExportTableSize: 0x0
61HEADER-NEXT: ImportTableRVA: 0x2000
62HEADER-NEXT: ImportTableSize: 0x28
63HEADER-NEXT: ResourceTableRVA: 0x0
64HEADER-NEXT: ResourceTableSize: 0x0
65HEADER-NEXT: ExceptionTableRVA: 0x0
66HEADER-NEXT: ExceptionTableSize: 0x0
67HEADER-NEXT: CertificateTableRVA: 0x0
68HEADER-NEXT: CertificateTableSize: 0x0
69HEADER-NEXT: BaseRelocationTableRVA: 0x4000
70HEADER-NEXT: BaseRelocationTableSize: 0x10
71HEADER-NEXT: DebugRVA: 0x0
72HEADER-NEXT: DebugSize: 0x0
73HEADER-NEXT: ArchitectureRVA: 0x0
74HEADER-NEXT: ArchitectureSize: 0x0
75HEADER-NEXT: GlobalPtrRVA: 0x0
76HEADER-NEXT: GlobalPtrSize: 0x0
77HEADER-NEXT: TLSTableRVA: 0x0
78HEADER-NEXT: TLSTableSize: 0x0
79HEADER-NEXT: LoadConfigTableRVA: 0x0
80HEADER-NEXT: LoadConfigTableSize: 0x0
81HEADER-NEXT: BoundImportRVA: 0x0
82HEADER-NEXT: BoundImportSize: 0x0
83HEADER-NEXT: IATRVA: 0x2034
84HEADER-NEXT: IATSize: 0xC
85HEADER-NEXT: DelayImportDescriptorRVA: 0x0
86HEADER-NEXT: DelayImportDescriptorSize: 0x0
87HEADER-NEXT: CLRRuntimeHeaderRVA: 0x0
88HEADER-NEXT: CLRRuntimeHeaderSize: 0x0
89HEADER-NEXT: ReservedRVA: 0x0
90HEADER-NEXT: ReservedSize: 0x0
91HEADER-NEXT: }
92HEADER-NEXT: }
93HEADER-NEXT: DOSHeader {
94HEADER-NEXT: Magic: MZ
95HEADER-NEXT: UsedBytesInTheLastPage: 120
96HEADER-NEXT: FileSizeInPages: 1
97HEADER-NEXT: NumberOfRelocationItems: 0
98HEADER-NEXT: HeaderSizeInParagraphs: 4
99HEADER-NEXT: MinimumExtraParagraphs: 0
100HEADER-NEXT: MaximumExtraParagraphs: 0
101HEADER-NEXT: InitialRelativeSS: 0
102HEADER-NEXT: InitialSP: 0
103HEADER-NEXT: Checksum: 0
104HEADER-NEXT: InitialIP: 0
105HEADER-NEXT: InitialRelativeCS: 0
106HEADER-NEXT: AddressOfRelocationTable: 64
107HEADER-NEXT: OverlayNumber: 0
108HEADER-NEXT: OEMid: 0
109HEADER-NEXT: OEMinfo: 0
110HEADER-NEXT: AddressOfNewExeHeader: 120
111HEADER-NEXT: }
112
113IMPORTS: Format: COFF-i386
114IMPORTS: Arch: i386
115IMPORTS: AddressSize: 32bit
116IMPORTS: Import {
117IMPORTS: Name: std32.dll
118IMPORTS: ImportLookupTableRVA: 0x2028
119IMPORTS: ImportAddressTableRVA: 0x2034
120IMPORTS: Symbol: ExitProcess (0)
121IMPORTS: Symbol: MessageBoxA (1)
122IMPORTS: }
123
124BASEREL: BaseReloc [
125BASEREL: Entry {
126BASEREL: Type: HIGHLOW
127BASEREL: Address: 0x1005
128BASEREL: }
129BASEREL: Entry {
130BASEREL: Type: HIGHLOW
131BASEREL: Address: 0x100C
132BASEREL: }
133BASEREL: ]
134