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