1 ## Check that the default NumberOfRvaAndSize is as expected.
2 # RUN: yaml2obj --docnum=1 %s -o %t
3 # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=CHECK16
4 # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP16
6 # CHECK16: NumberOfRvaAndSize: 16
7 # CHECK16-NEXT: DataDirectory {
8 # CHECK16-NEXT: ExportTableRVA: 0x0
9 # CHECK16-NEXT: ExportTableSize: 0x0
10 # CHECK16-NEXT: ImportTableRVA: 0x0
11 # CHECK16-NEXT: ImportTableSize: 0x0
12 # CHECK16-NEXT: ResourceTableRVA: 0x0
13 # CHECK16-NEXT: ResourceTableSize: 0x0
14 # CHECK16-NEXT: ExceptionTableRVA: 0x0
15 # CHECK16-NEXT: ExceptionTableSize: 0x0
16 # CHECK16-NEXT: CertificateTableRVA: 0x0
17 # CHECK16-NEXT: CertificateTableSize: 0x0
18 # CHECK16-NEXT: BaseRelocationTableRVA: 0x0
19 # CHECK16-NEXT: BaseRelocationTableSize: 0x0
20 # CHECK16-NEXT: DebugRVA: 0x0
21 # CHECK16-NEXT: DebugSize: 0x0
22 # CHECK16-NEXT: ArchitectureRVA: 0x0
23 # CHECK16-NEXT: ArchitectureSize: 0x0
24 # CHECK16-NEXT: GlobalPtrRVA: 0x0
25 # CHECK16-NEXT: GlobalPtrSize: 0x0
26 # CHECK16-NEXT: TLSTableRVA: 0x0
27 # CHECK16-NEXT: TLSTableSize: 0x0
28 # CHECK16-NEXT: LoadConfigTableRVA: 0x0
29 # CHECK16-NEXT: LoadConfigTableSize: 0x0
30 # CHECK16-NEXT: BoundImportRVA: 0x0
31 # CHECK16-NEXT: BoundImportSize: 0x0
32 # CHECK16-NEXT: IATRVA: 0x0
33 # CHECK16-NEXT: IATSize: 0x0
34 # CHECK16-NEXT: DelayImportDescriptorRVA: 0x0
35 # CHECK16-NEXT: DelayImportDescriptorSize: 0x0
36 # CHECK16-NEXT: CLRRuntimeHeaderRVA: 0x0
37 # CHECK16-NEXT: CLRRuntimeHeaderSize: 0x0
38 # CHECK16-NEXT: ReservedRVA: 0x0
39 # CHECK16-NEXT: ReservedSize: 0x0
42 # ROUNDTRIP16: ExportTable:
43 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
44 # ROUNDTRIP16-NEXT: Size: 0
45 # ROUNDTRIP16-NEXT: ImportTable:
46 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
47 # ROUNDTRIP16-NEXT: Size: 0
48 # ROUNDTRIP16-NEXT: ResourceTable:
49 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
50 # ROUNDTRIP16-NEXT: Size: 0
51 # ROUNDTRIP16-NEXT: ExceptionTable:
52 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
53 # ROUNDTRIP16-NEXT: Size: 0
54 # ROUNDTRIP16-NEXT: CertificateTable:
55 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
56 # ROUNDTRIP16-NEXT: Size: 0
57 # ROUNDTRIP16-NEXT: BaseRelocationTable:
58 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
59 # ROUNDTRIP16-NEXT: Size: 0
60 # ROUNDTRIP16-NEXT: Debug:
61 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
62 # ROUNDTRIP16-NEXT: Size: 0
63 # ROUNDTRIP16-NEXT: Architecture:
64 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
65 # ROUNDTRIP16-NEXT: Size: 0
66 # ROUNDTRIP16-NEXT: GlobalPtr:
67 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
68 # ROUNDTRIP16-NEXT: Size: 0
69 # ROUNDTRIP16-NEXT: TlsTable:
70 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
71 # ROUNDTRIP16-NEXT: Size: 0
72 # ROUNDTRIP16-NEXT: LoadConfigTable:
73 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
74 # ROUNDTRIP16-NEXT: Size: 0
75 # ROUNDTRIP16-NEXT: BoundImport:
76 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
77 # ROUNDTRIP16-NEXT: Size: 0
78 # ROUNDTRIP16-NEXT: IAT:
79 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
80 # ROUNDTRIP16-NEXT: Size: 0
81 # ROUNDTRIP16-NEXT: DelayImportDescriptor:
82 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
83 # ROUNDTRIP16-NEXT: Size: 0
84 # ROUNDTRIP16-NEXT: ClrRuntimeHeader:
85 # ROUNDTRIP16-NEXT: RelativeVirtualAddress: 0
86 # ROUNDTRIP16-NEXT: Size: 0
87 # ROUNDTRIP16-NEXT: header:
91 AddressOfEntryPoint: 4096
93 SectionAlignment: 4096
95 MajorOperatingSystemVersion: 0
96 MinorOperatingSystemVersion: 0
99 MajorSubsystemVersion: 0
100 MinorSubsystemVersion: 0
101 Subsystem: IMAGE_SUBSYSTEM_EFI_APPLICATION
102 DLLCharacteristics: [ ]
103 SizeOfStackReserve: 0
108 Machine: IMAGE_FILE_MACHINE_AMD64
117 ## Check setting NumberOfRvaAndSize equal to the default (output should
118 ## be the same as when unset).
119 # RUN: yaml2obj --docnum=2 %s -o %t -DNUMRVA=16
120 # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=CHECK16
121 # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP16
123 ## Check that NumberOfRvaAndSize can be zero.
124 # RUN: yaml2obj --docnum=2 %s -o %t -DNUMRVA=0
125 # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=CHECK0
126 # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP0
128 # CHECK0: NumberOfRvaAndSize: 0
129 # CHECK0-NOT: DataDirectory
131 # ROUNDTRIP0: NumberOfRvaAndSize: 0
132 # ROUNDTRIP0-NOT: ExportTable
134 ## Check setting NumberOfRvaAndSize to number below default.
135 # RUN: yaml2obj --docnum=2 %s -o %t -DNUMRVA=6
136 # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=CHECK6
137 # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP6
139 # CHECK6: NumberOfRvaAndSize: 6
140 # CHECK6-NEXT: DataDirectory {
141 # CHECK6-NEXT: ExportTableRVA: 0x0
142 # CHECK6-NEXT: ExportTableSize: 0x0
143 # CHECK6-NEXT: ImportTableRVA: 0x0
144 # CHECK6-NEXT: ImportTableSize: 0x0
145 # CHECK6-NEXT: ResourceTableRVA: 0x0
146 # CHECK6-NEXT: ResourceTableSize: 0x0
147 # CHECK6-NEXT: ExceptionTableRVA: 0x0
148 # CHECK6-NEXT: ExceptionTableSize: 0x0
149 # CHECK6-NEXT: CertificateTableRVA: 0x0
150 # CHECK6-NEXT: CertificateTableSize: 0x0
151 # CHECK6-NEXT: BaseRelocationTableRVA: 0x0
152 # CHECK6-NEXT: BaseRelocationTableSize: 0x0
155 # ROUNDTRIP6: NumberOfRvaAndSize: 6
156 # ROUNDTRIP6-NEXT: ExportTable:
157 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
158 # ROUNDTRIP6-NEXT: Size: 0
159 # ROUNDTRIP6-NEXT: ImportTable:
160 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
161 # ROUNDTRIP6-NEXT: Size: 0
162 # ROUNDTRIP6-NEXT: ResourceTable:
163 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
164 # ROUNDTRIP6-NEXT: Size: 0
165 # ROUNDTRIP6-NEXT: ExceptionTable:
166 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
167 # ROUNDTRIP6-NEXT: Size: 0
168 # ROUNDTRIP6-NEXT: CertificateTable:
169 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
170 # ROUNDTRIP6-NEXT: Size: 0
171 # ROUNDTRIP6-NEXT: BaseRelocationTable:
172 # ROUNDTRIP6-NEXT: RelativeVirtualAddress: 0
173 # ROUNDTRIP6-NEXT: Size: 0
174 # ROUNDTRIP6-NEXT: header:
176 ## Check setting NumberOfRvaAndSize to number above default.
177 # RUN: yaml2obj --docnum=2 %s -o %t -DNUMRVA=18
178 # RUN: llvm-readobj --file-headers %t | FileCheck %s --check-prefix=CHECK18
179 # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP18
181 # CHECK18: NumberOfRvaAndSize: 18
182 # CHECK18-NEXT: DataDirectory {
183 # CHECK18-NEXT: ExportTableRVA: 0x0
184 # CHECK18-NEXT: ExportTableSize: 0x0
185 # CHECK18-NEXT: ImportTableRVA: 0x0
186 # CHECK18-NEXT: ImportTableSize: 0x0
187 # CHECK18-NEXT: ResourceTableRVA: 0x0
188 # CHECK18-NEXT: ResourceTableSize: 0x0
189 # CHECK18-NEXT: ExceptionTableRVA: 0x0
190 # CHECK18-NEXT: ExceptionTableSize: 0x0
191 # CHECK18-NEXT: CertificateTableRVA: 0x0
192 # CHECK18-NEXT: CertificateTableSize: 0x0
193 # CHECK18-NEXT: BaseRelocationTableRVA: 0x0
194 # CHECK18-NEXT: BaseRelocationTableSize: 0x0
195 # CHECK18-NEXT: DebugRVA: 0x0
196 # CHECK18-NEXT: DebugSize: 0x0
197 # CHECK18-NEXT: ArchitectureRVA: 0x0
198 # CHECK18-NEXT: ArchitectureSize: 0x0
199 # CHECK18-NEXT: GlobalPtrRVA: 0x0
200 # CHECK18-NEXT: GlobalPtrSize: 0x0
201 # CHECK18-NEXT: TLSTableRVA: 0x0
202 # CHECK18-NEXT: TLSTableSize: 0x0
203 # CHECK18-NEXT: LoadConfigTableRVA: 0x0
204 # CHECK18-NEXT: LoadConfigTableSize: 0x0
205 # CHECK18-NEXT: BoundImportRVA: 0x0
206 # CHECK18-NEXT: BoundImportSize: 0x0
207 # CHECK18-NEXT: IATRVA: 0x0
208 # CHECK18-NEXT: IATSize: 0x0
209 # CHECK18-NEXT: DelayImportDescriptorRVA: 0x0
210 # CHECK18-NEXT: DelayImportDescriptorSize: 0x0
211 # CHECK18-NEXT: CLRRuntimeHeaderRVA: 0x0
212 # CHECK18-NEXT: CLRRuntimeHeaderSize: 0x0
213 # CHECK18-NEXT: ReservedRVA: 0x0
214 # CHECK18-NEXT: ReservedSize: 0x0
215 # CHECK18-NEXT: UnknownRVA: 0x0
216 # CHECK18-NEXT: UnknownSize: 0x0
217 # CHECK18-NEXT: UnknownRVA: 0x0
218 # CHECK18-NEXT: UnknownSize: 0x0
221 # ROUNDTRIP18: NumberOfRvaAndSize: 18
222 # ROUNDTRIP18-NEXT: ExportTable:
223 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
224 # ROUNDTRIP18-NEXT: Size: 0
225 # ROUNDTRIP18-NEXT: ImportTable:
226 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
227 # ROUNDTRIP18-NEXT: Size: 0
228 # ROUNDTRIP18-NEXT: ResourceTable:
229 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
230 # ROUNDTRIP18-NEXT: Size: 0
231 # ROUNDTRIP18-NEXT: ExceptionTable:
232 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
233 # ROUNDTRIP18-NEXT: Size: 0
234 # ROUNDTRIP18-NEXT: CertificateTable:
235 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
236 # ROUNDTRIP18-NEXT: Size: 0
237 # ROUNDTRIP18-NEXT: BaseRelocationTable:
238 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
239 # ROUNDTRIP18-NEXT: Size: 0
240 # ROUNDTRIP18-NEXT: Debug:
241 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
242 # ROUNDTRIP18-NEXT: Size: 0
243 # ROUNDTRIP18-NEXT: Architecture:
244 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
245 # ROUNDTRIP18-NEXT: Size: 0
246 # ROUNDTRIP18-NEXT: GlobalPtr:
247 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
248 # ROUNDTRIP18-NEXT: Size: 0
249 # ROUNDTRIP18-NEXT: TlsTable:
250 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
251 # ROUNDTRIP18-NEXT: Size: 0
252 # ROUNDTRIP18-NEXT: LoadConfigTable:
253 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
254 # ROUNDTRIP18-NEXT: Size: 0
255 # ROUNDTRIP18-NEXT: BoundImport:
256 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
257 # ROUNDTRIP18-NEXT: Size: 0
258 # ROUNDTRIP18-NEXT: IAT:
259 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
260 # ROUNDTRIP18-NEXT: Size: 0
261 # ROUNDTRIP18-NEXT: DelayImportDescriptor:
262 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
263 # ROUNDTRIP18-NEXT: Size: 0
264 # ROUNDTRIP18-NEXT: ClrRuntimeHeader:
265 # ROUNDTRIP18-NEXT: RelativeVirtualAddress: 0
266 # ROUNDTRIP18-NEXT: Size: 0
267 # ROUNDTRIP18-NEXT: header:
271 AddressOfEntryPoint: 4096
273 SectionAlignment: 4096
275 MajorOperatingSystemVersion: 0
276 MinorOperatingSystemVersion: 0
279 MajorSubsystemVersion: 0
280 MinorSubsystemVersion: 0
281 Subsystem: IMAGE_SUBSYSTEM_EFI_APPLICATION
282 DLLCharacteristics: [ ]
283 SizeOfStackReserve: 0
287 NumberOfRvaAndSize: [[NUMRVA]]
289 Machine: IMAGE_FILE_MACHINE_AMD64