[SandboxIR][Doc] Add Quick start notes (#123992)
[llvm-project.git] / llvm / test / tools / llvm-readobj / COFF / arm64x-reloc-invalid.yaml
blob18a43c5ab0c8c7320cb7c2507e77c765d2082dca
1 # Test ARM64X dynamic relocation validation.
3 # RUN: yaml2obj %s --docnum=1 -o %t1.dll
4 # RUN: not llvm-readobj %t1.dll 2>&1 | FileCheck --check-prefix=ERR-HEADER-RVA %s
5 # ERR-HEADER-RVA: RVA 0x1002 for ARM64X reloc not found
7 --- !COFF
8 OptionalHeader:
9   ImageBase:       0x180000000
10   SectionAlignment: 4096
11   FileAlignment:   512
12   DLLCharacteristics: [ ]
13   LoadConfigTable:
14     RelativeVirtualAddress: 0x5000
15     Size:            320
16 header:
17   Machine:         IMAGE_FILE_MACHINE_ARM64
18   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
19 sections:
20   - Name:            .text
21     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
22     VirtualAddress:  0x2000
23     VirtualSize:     0x2050
24   - Name:            .rdata
25     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
26     VirtualAddress:  0x5000
27     VirtualSize:     328
28     StructuredData:
29       - LoadConfig:
30           CHPEMetadataPointer: 0x180005000
31           DynamicValueRelocTableOffset: 4
32           DynamicValueRelocTableSection: 4
33   - Name:            .data
34     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
35     VirtualAddress:  0x6000
36     VirtualSize:     144
37     StructuredData:
38       - UInt32: 1       # Version
39       - UInt32: 0x5050  # CodeMap
40       - UInt32: 3       # CodeMapCount
41       - UInt32: 0x5068  # CodeRangesToEntryPoints
42       - UInt32: 0x5080  # RedirectionMetadata
43       - UInt32: 0
44       - UInt32: 0
45       - UInt32: 0
46       - UInt32: 0
47       - UInt32: 0
48       - UInt32: 0
49       - UInt32: 0
50       - UInt32: 0       # CodeRangesToEntryPointsCount
51       - UInt32: 0       # RedirectionMetadataCount
52       - UInt32: 0
53       - UInt32: 0
54       - UInt32: 0
55       - UInt32: 0
56       - UInt32: 0
57       - UInt32: 0
58       - UInt32: 0x1001  # CodeMap[0]
59       - UInt32: 0x30
60       - UInt32: 0x2000  # CodeMap[1]
61       - UInt32: 0x40
62       - UInt32: 0x3002  # CodeMap[2]
63       - UInt32: 0x50
64   - Name:            .reloc
65     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
66     VirtualAddress:  0x7000
67     VirtualSize:     328
68     StructuredData:
69       - UInt32: 0         # pad
70       - UInt32: 1         # coff_dynamic_reloc_table.Version
71       - UInt32: 24        # coff_dynamic_reloc_table.Size
72       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
73       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
74       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
75       - UInt32: 0x1000    # coff_base_reloc_block_header[0].PageRVA
76       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
77       - Binary: 0040      # ZERO offset 0xf00, size 2
78       - Binary: 0000      # terminator
79 symbols:         []
80 ...
82 # RUN: yaml2obj %s --docnum=2 -o %t2.dll
83 # RUN: not llvm-readobj %t2.dll 2>&1 | FileCheck --check-prefix=ERR-SEC-INDEX %s
84 # ERR-SEC-INDEX: section index out of bounds
86 --- !COFF
87 OptionalHeader:
88   ImageBase:       0x180000000
89   SectionAlignment: 4096
90   FileAlignment:   512
91   DLLCharacteristics: [ ]
92   LoadConfigTable:
93     RelativeVirtualAddress: 0x4000
94     Size:            320
95 header:
96   Machine:         IMAGE_FILE_MACHINE_ARM64
97   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
98 sections:
99   - Name:            .text
100     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
101     VirtualAddress:  0x1000
102     VirtualSize:     0x2050
103   - Name:            .rdata
104     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
105     VirtualAddress:  0x4000
106     VirtualSize:     328
107     StructuredData:
108       - LoadConfig:
109           CHPEMetadataPointer: 0x180005000
110           DynamicValueRelocTableOffset: 4
111           DynamicValueRelocTableSection: 5
112   - Name:            .data
113     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
114     VirtualAddress:  0x5000
115     VirtualSize:     144
116     StructuredData:
117       - UInt32: 1       # Version
118       - UInt32: 0x5050  # CodeMap
119       - UInt32: 3       # CodeMapCount
120       - UInt32: 0x5068  # CodeRangesToEntryPoints
121       - UInt32: 0x5080  # RedirectionMetadata
122       - UInt32: 0
123       - UInt32: 0
124       - UInt32: 0
125       - UInt32: 0
126       - UInt32: 0
127       - UInt32: 0
128       - UInt32: 0
129       - UInt32: 0       # CodeRangesToEntryPointsCount
130       - UInt32: 0       # RedirectionMetadataCount
131       - UInt32: 0
132       - UInt32: 0
133       - UInt32: 0
134       - UInt32: 0
135       - UInt32: 0
136       - UInt32: 0
137       - UInt32: 0x1001  # CodeMap[0]
138       - UInt32: 0x30
139       - UInt32: 0x2000  # CodeMap[1]
140       - UInt32: 0x40
141       - UInt32: 0x3002  # CodeMap[2]
142       - UInt32: 0x50
143 symbols:         []
146 # RUN: yaml2obj %s --docnum=3 -o %t3.dll
147 # RUN: not llvm-readobj %t3.dll 2>&1 | FileCheck --check-prefix=ERR-DIR-INDEX %s
148 # ERR-DIR-INDEX: Too large DynamicValueRelocTableOffset (4)
150 --- !COFF
151 OptionalHeader:
152   ImageBase:       0x180000000
153   SectionAlignment: 4096
154   FileAlignment:   512
155   DLLCharacteristics: [ ]
156   LoadConfigTable:
157     RelativeVirtualAddress: 0x4000
158     Size:            320
159 header:
160   Machine:         IMAGE_FILE_MACHINE_ARM64
161   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
162 sections:
163   - Name:            .text
164     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
165     VirtualAddress:  0x1000
166     VirtualSize:     0x2050
167   - Name:            .rdata
168     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
169     VirtualAddress:  0x4000
170     VirtualSize:     328
171     StructuredData:
172       - LoadConfig:
173           CHPEMetadataPointer: 0x180005000
174           DynamicValueRelocTableOffset: 4
175           DynamicValueRelocTableSection: 4
176   - Name:            .data
177     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
178     VirtualAddress:  0x5000
179     VirtualSize:     144
180     StructuredData:
181       - UInt32: 1       # Version
182       - UInt32: 0x5050  # CodeMap
183       - UInt32: 3       # CodeMapCount
184       - UInt32: 0x5068  # CodeRangesToEntryPoints
185       - UInt32: 0x5080  # RedirectionMetadata
186       - UInt32: 0
187       - UInt32: 0
188       - UInt32: 0
189       - UInt32: 0
190       - UInt32: 0
191       - UInt32: 0
192       - UInt32: 0
193       - UInt32: 0       # CodeRangesToEntryPointsCount
194       - UInt32: 0       # RedirectionMetadataCount
195       - UInt32: 0
196       - UInt32: 0
197       - UInt32: 0
198       - UInt32: 0
199       - UInt32: 0
200       - UInt32: 0
201       - UInt32: 0x1001  # CodeMap[0]
202       - UInt32: 0x30
203       - UInt32: 0x2000  # CodeMap[1]
204       - UInt32: 0x40
205       - UInt32: 0x3002  # CodeMap[2]
206       - UInt32: 0x50
207   - Name:            .reloc
208     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
209     VirtualAddress:  0x7000
210     VirtualSize:     11
211     StructuredData:
212       - UInt32: 0         # pad
213       - UInt32: 1         # coff_dynamic_reloc_table.Version
214       - Binary: 010000    # coff_dynamic_reloc_table.Size
215 symbols:         []
218 # RUN: yaml2obj %s --docnum=4 -o %t4.dll
219 # RUN: not llvm-readobj %t4.dll 2>&1 | FileCheck --check-prefix=ERR-DIR-SIZE %s
220 # ERR-DIR-SIZE: Indvalid dynamic relocations directory size (2)
222 --- !COFF
223 OptionalHeader:
224   ImageBase:       0x180000000
225   SectionAlignment: 4096
226   FileAlignment:   512
227   DLLCharacteristics: [ ]
228   LoadConfigTable:
229     RelativeVirtualAddress: 0x4000
230     Size:            320
231 header:
232   Machine:         IMAGE_FILE_MACHINE_ARM64
233   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
234 sections:
235   - Name:            .text
236     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
237     VirtualAddress:  0x1000
238     VirtualSize:     0x2050
239   - Name:            .rdata
240     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
241     VirtualAddress:  0x4000
242     VirtualSize:     328
243     StructuredData:
244       - LoadConfig:
245           CHPEMetadataPointer: 0x180005000
246           DynamicValueRelocTableOffset: 4
247           DynamicValueRelocTableSection: 4
248   - Name:            .data
249     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
250     VirtualAddress:  0x5000
251     VirtualSize:     144
252     StructuredData:
253       - UInt32: 1       # Version
254       - UInt32: 0x5050  # CodeMap
255       - UInt32: 3       # CodeMapCount
256       - UInt32: 0x5068  # CodeRangesToEntryPoints
257       - UInt32: 0x5080  # RedirectionMetadata
258       - UInt32: 0
259       - UInt32: 0
260       - UInt32: 0
261       - UInt32: 0
262       - UInt32: 0
263       - UInt32: 0
264       - UInt32: 0
265       - UInt32: 0       # CodeRangesToEntryPointsCount
266       - UInt32: 0       # RedirectionMetadataCount
267       - UInt32: 0
268       - UInt32: 0
269       - UInt32: 0
270       - UInt32: 0
271       - UInt32: 0
272       - UInt32: 0
273       - UInt32: 0x1001  # CodeMap[0]
274       - UInt32: 0x30
275       - UInt32: 0x2000  # CodeMap[1]
276       - UInt32: 0x40
277       - UInt32: 0x3002  # CodeMap[2]
278       - UInt32: 0x50
279   - Name:            .reloc
280     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
281     VirtualAddress:  0x7000
282     VirtualSize:     13
283     StructuredData:
284       - UInt32: 0         # pad
285       - UInt32: 1         # coff_dynamic_reloc_table.Version
286       - UInt32: 2         # coff_dynamic_reloc_table.Size
287       - Binary: 00
288 symbols:         []
291 # RUN: yaml2obj %s --docnum=5 -o %t5.dll
292 # RUN: not llvm-readobj %t5.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-SIZE %s
293 # ERR-RELOC-SIZE: Unexpected end of dynamic relocations data
295 --- !COFF
296 OptionalHeader:
297   ImageBase:       0x180000000
298   SectionAlignment: 4096
299   FileAlignment:   512
300   DLLCharacteristics: [ ]
301   LoadConfigTable:
302     RelativeVirtualAddress: 0x4000
303     Size:            320
304 header:
305   Machine:         IMAGE_FILE_MACHINE_ARM64
306   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
307 sections:
308   - Name:            .text
309     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
310     VirtualAddress:  0x1000
311     VirtualSize:     0x2050
312   - Name:            .rdata
313     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
314     VirtualAddress:  0x4000
315     VirtualSize:     328
316     StructuredData:
317       - LoadConfig:
318           CHPEMetadataPointer: 0x180005000
319           DynamicValueRelocTableOffset: 4
320           DynamicValueRelocTableSection: 4
321   - Name:            .data
322     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
323     VirtualAddress:  0x5000
324     VirtualSize:     144
325     StructuredData:
326       - UInt32: 1       # Version
327       - UInt32: 0x5050  # CodeMap
328       - UInt32: 3       # CodeMapCount
329       - UInt32: 0x5068  # CodeRangesToEntryPoints
330       - UInt32: 0x5080  # RedirectionMetadata
331       - UInt32: 0
332       - UInt32: 0
333       - UInt32: 0
334       - UInt32: 0
335       - UInt32: 0
336       - UInt32: 0
337       - UInt32: 0
338       - UInt32: 0       # CodeRangesToEntryPointsCount
339       - UInt32: 0       # RedirectionMetadataCount
340       - UInt32: 0
341       - UInt32: 0
342       - UInt32: 0
343       - UInt32: 0
344       - UInt32: 0
345       - UInt32: 0
346       - UInt32: 0x1001  # CodeMap[0]
347       - UInt32: 0x30
348       - UInt32: 0x2000  # CodeMap[1]
349       - UInt32: 0x40
350       - UInt32: 0x3002  # CodeMap[2]
351       - UInt32: 0x50
352   - Name:            .reloc
353     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
354     VirtualAddress:  0x7000
355     VirtualSize:     328
356     StructuredData:
357       - UInt32: 0         # pad
358       - UInt32: 1         # coff_dynamic_reloc_table.Version
359       - UInt32: 11        # coff_dynamic_reloc_table.Size
360       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
361       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
362       - Binary: 000000
363 symbols:         []
366 # RUN: yaml2obj %s --docnum=6 -o %t6.dll
367 # RUN: not llvm-readobj %t6.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-SIZE2 %s
368 # ERR-RELOC-SIZE2: Too large dynamic relocation size (4)
370 --- !COFF
371 OptionalHeader:
372   ImageBase:       0x180000000
373   SectionAlignment: 4096
374   FileAlignment:   512
375   DLLCharacteristics: [ ]
376   LoadConfigTable:
377     RelativeVirtualAddress: 0x4000
378     Size:            320
379 header:
380   Machine:         IMAGE_FILE_MACHINE_ARM64
381   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
382 sections:
383   - Name:            .text
384     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
385     VirtualAddress:  0x1000
386     VirtualSize:     0x2050
387   - Name:            .rdata
388     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
389     VirtualAddress:  0x4000
390     VirtualSize:     328
391     StructuredData:
392       - LoadConfig:
393           CHPEMetadataPointer: 0x180005000
394           DynamicValueRelocTableOffset: 4
395           DynamicValueRelocTableSection: 4
396   - Name:            .data
397     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
398     VirtualAddress:  0x5000
399     VirtualSize:     144
400     StructuredData:
401       - UInt32: 1       # Version
402       - UInt32: 0x5050  # CodeMap
403       - UInt32: 3       # CodeMapCount
404       - UInt32: 0x5068  # CodeRangesToEntryPoints
405       - UInt32: 0x5080  # RedirectionMetadata
406       - UInt32: 0
407       - UInt32: 0
408       - UInt32: 0
409       - UInt32: 0
410       - UInt32: 0
411       - UInt32: 0
412       - UInt32: 0
413       - UInt32: 0       # CodeRangesToEntryPointsCount
414       - UInt32: 0       # RedirectionMetadataCount
415       - UInt32: 0
416       - UInt32: 0
417       - UInt32: 0
418       - UInt32: 0
419       - UInt32: 0
420       - UInt32: 0
421       - UInt32: 0x1001  # CodeMap[0]
422       - UInt32: 0x30
423       - UInt32: 0x2000  # CodeMap[1]
424       - UInt32: 0x40
425       - UInt32: 0x3002  # CodeMap[2]
426       - UInt32: 0x50
427   - Name:            .reloc
428     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
429     VirtualAddress:  0x7000
430     VirtualSize:     328
431     StructuredData:
432       - UInt32: 0         # pad
433       - UInt32: 1         # coff_dynamic_reloc_table.Version
434       - UInt32: 15        # coff_dynamic_reloc_table.Size
435       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
436       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
437       - UInt32: 4         # coff_dynamic_relocation64.BaseRelocSize
438       - Binary: 000000
439 symbols:         []
442 # RUN: yaml2obj %s --docnum=7 -o %t7.dll
443 # RUN: not llvm-readobj %t7.dll 2>&1 | FileCheck --check-prefix=ERR-BLOCK-SIZE %s
444 # ERR-BLOCK-SIZE: ARM64X relocations block size (7) is too small
446 --- !COFF
447 OptionalHeader:
448   ImageBase:       0x180000000
449   SectionAlignment: 4096
450   FileAlignment:   512
451   DLLCharacteristics: [ ]
452   LoadConfigTable:
453     RelativeVirtualAddress: 0x4000
454     Size:            320
455 header:
456   Machine:         IMAGE_FILE_MACHINE_ARM64
457   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
458 sections:
459   - Name:            .text
460     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
461     VirtualAddress:  0x1000
462     VirtualSize:     0x2050
463   - Name:            .rdata
464     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
465     VirtualAddress:  0x4000
466     VirtualSize:     328
467     StructuredData:
468       - LoadConfig:
469           CHPEMetadataPointer: 0x180005000
470           DynamicValueRelocTableOffset: 4
471           DynamicValueRelocTableSection: 4
472   - Name:            .data
473     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
474     VirtualAddress:  0x5000
475     VirtualSize:     144
476     StructuredData:
477       - UInt32: 1       # Version
478       - UInt32: 0x5050  # CodeMap
479       - UInt32: 3       # CodeMapCount
480       - UInt32: 0x5068  # CodeRangesToEntryPoints
481       - UInt32: 0x5080  # RedirectionMetadata
482       - UInt32: 0
483       - UInt32: 0
484       - UInt32: 0
485       - UInt32: 0
486       - UInt32: 0
487       - UInt32: 0
488       - UInt32: 0
489       - UInt32: 0       # CodeRangesToEntryPointsCount
490       - UInt32: 0       # RedirectionMetadataCount
491       - UInt32: 0
492       - UInt32: 0
493       - UInt32: 0
494       - UInt32: 0
495       - UInt32: 0
496       - UInt32: 0
497       - UInt32: 0x1001  # CodeMap[0]
498       - UInt32: 0x30
499       - UInt32: 0x2000  # CodeMap[1]
500       - UInt32: 0x40
501       - UInt32: 0x3002  # CodeMap[2]
502       - UInt32: 0x50
503   - Name:            .reloc
504     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
505     VirtualAddress:  0x7000
506     VirtualSize:     328
507     StructuredData:
508       - UInt32: 0         # pad
509       - UInt32: 1         # coff_dynamic_reloc_table.Version
510       - UInt32: 21        # coff_dynamic_reloc_table.Size
511       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
512       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
513       - UInt32: 9         # coff_dynamic_relocation64.BaseRelocSize
514       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
515       - UInt32: 7         # coff_base_reloc_block_header[0].BlockSize
516       - Binary: 00
517 symbols:         []
520 # RUN: yaml2obj %s --docnum=8 -o %t8.dll
521 # RUN: not llvm-readobj %t8.dll 2>&1 | FileCheck --check-prefix=ERR-BLOCK-SIZE2 %s
522 # ERR-BLOCK-SIZE2: Unaligned ARM64X relocations block size (10)
524 --- !COFF
525 OptionalHeader:
526   ImageBase:       0x180000000
527   SectionAlignment: 4096
528   FileAlignment:   512
529   DLLCharacteristics: [ ]
530   LoadConfigTable:
531     RelativeVirtualAddress: 0x4000
532     Size:            320
533 header:
534   Machine:         IMAGE_FILE_MACHINE_ARM64
535   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
536 sections:
537   - Name:            .text
538     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
539     VirtualAddress:  0x1000
540     VirtualSize:     0x2050
541   - Name:            .rdata
542     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
543     VirtualAddress:  0x4000
544     VirtualSize:     328
545     StructuredData:
546       - LoadConfig:
547           CHPEMetadataPointer: 0x180005000
548           DynamicValueRelocTableOffset: 4
549           DynamicValueRelocTableSection: 4
550   - Name:            .data
551     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
552     VirtualAddress:  0x5000
553     VirtualSize:     144
554     StructuredData:
555       - UInt32: 1       # Version
556       - UInt32: 0x5050  # CodeMap
557       - UInt32: 3       # CodeMapCount
558       - UInt32: 0x5068  # CodeRangesToEntryPoints
559       - UInt32: 0x5080  # RedirectionMetadata
560       - UInt32: 0
561       - UInt32: 0
562       - UInt32: 0
563       - UInt32: 0
564       - UInt32: 0
565       - UInt32: 0
566       - UInt32: 0
567       - UInt32: 0       # CodeRangesToEntryPointsCount
568       - UInt32: 0       # RedirectionMetadataCount
569       - UInt32: 0
570       - UInt32: 0
571       - UInt32: 0
572       - UInt32: 0
573       - UInt32: 0
574       - UInt32: 0
575       - UInt32: 0x1001  # CodeMap[0]
576       - UInt32: 0x30
577       - UInt32: 0x2000  # CodeMap[1]
578       - UInt32: 0x40
579       - UInt32: 0x3002  # CodeMap[2]
580       - UInt32: 0x50
581   - Name:            .reloc
582     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
583     VirtualAddress:  0x7000
584     VirtualSize:     328
585     StructuredData:
586       - UInt32: 0         # pad
587       - UInt32: 1         # coff_dynamic_reloc_table.Version
588       - UInt32: 22        # coff_dynamic_reloc_table.Size
589       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
590       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
591       - UInt32: 10        # coff_dynamic_relocation64.BaseRelocSize
592       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
593       - UInt32: 10        # coff_base_reloc_block_header[0].BlockSize
594       - Binary: 0000
595 symbols:         []
598 # RUN: yaml2obj %s --docnum=9 -o %t9.dll
599 # RUN: not llvm-readobj %t9.dll 2>&1 | FileCheck --check-prefix=ERR-BLOCK-SIZE3 %s
600 # ERR-BLOCK-SIZE3: ARM64X relocations block size (12) is too large
602 --- !COFF
603 OptionalHeader:
604   ImageBase:       0x180000000
605   SectionAlignment: 4096
606   FileAlignment:   512
607   DLLCharacteristics: [ ]
608   LoadConfigTable:
609     RelativeVirtualAddress: 0x4000
610     Size:            320
611 header:
612   Machine:         IMAGE_FILE_MACHINE_ARM64
613   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
614 sections:
615   - Name:            .text
616     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
617     VirtualAddress:  0x1000
618     VirtualSize:     0x2050
619   - Name:            .rdata
620     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
621     VirtualAddress:  0x4000
622     VirtualSize:     328
623     StructuredData:
624       - LoadConfig:
625           CHPEMetadataPointer: 0x180005000
626           DynamicValueRelocTableOffset: 4
627           DynamicValueRelocTableSection: 4
628   - Name:            .data
629     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
630     VirtualAddress:  0x5000
631     VirtualSize:     144
632     StructuredData:
633       - UInt32: 1       # Version
634       - UInt32: 0x5050  # CodeMap
635       - UInt32: 3       # CodeMapCount
636       - UInt32: 0x5068  # CodeRangesToEntryPoints
637       - UInt32: 0x5080  # RedirectionMetadata
638       - UInt32: 0
639       - UInt32: 0
640       - UInt32: 0
641       - UInt32: 0
642       - UInt32: 0
643       - UInt32: 0
644       - UInt32: 0
645       - UInt32: 0       # CodeRangesToEntryPointsCount
646       - UInt32: 0       # RedirectionMetadataCount
647       - UInt32: 0
648       - UInt32: 0
649       - UInt32: 0
650       - UInt32: 0
651       - UInt32: 0
652       - UInt32: 0
653       - UInt32: 0x1001  # CodeMap[0]
654       - UInt32: 0x30
655       - UInt32: 0x2000  # CodeMap[1]
656       - UInt32: 0x40
657       - UInt32: 0x3002  # CodeMap[2]
658       - UInt32: 0x50
659   - Name:            .reloc
660     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
661     VirtualAddress:  0x7000
662     VirtualSize:     328
663     StructuredData:
664       - UInt32: 0         # pad
665       - UInt32: 1         # coff_dynamic_reloc_table.Version
666       - UInt32: 23        # coff_dynamic_reloc_table.Size
667       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
668       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
669       - UInt32: 11        # coff_dynamic_relocation64.BaseRelocSize
670       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
671       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
672       - Binary: 000000
673 symbols:         []
676 # RUN: yaml2obj %s --docnum=10 -o %t10.dll
677 # RUN: not llvm-readobj %t10.dll 2>&1 | FileCheck --check-prefix=ERR-TERMINATOR %s
678 # ERR-TERMINATOR: Unexpected ARM64X relocations terminator
680 --- !COFF
681 OptionalHeader:
682   ImageBase:       0x180000000
683   SectionAlignment: 4096
684   FileAlignment:   512
685   DLLCharacteristics: [ ]
686   LoadConfigTable:
687     RelativeVirtualAddress: 0x4000
688     Size:            320
689 header:
690   Machine:         IMAGE_FILE_MACHINE_ARM64
691   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
692 sections:
693   - Name:            .text
694     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
695     VirtualAddress:  0x1000
696     VirtualSize:     0x2050
697   - Name:            .rdata
698     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
699     VirtualAddress:  0x4000
700     VirtualSize:     328
701     StructuredData:
702       - LoadConfig:
703           CHPEMetadataPointer: 0x180005000
704           DynamicValueRelocTableOffset: 4
705           DynamicValueRelocTableSection: 4
706   - Name:            .data
707     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
708     VirtualAddress:  0x5000
709     VirtualSize:     144
710     StructuredData:
711       - UInt32: 1       # Version
712       - UInt32: 0x5050  # CodeMap
713       - UInt32: 3       # CodeMapCount
714       - UInt32: 0x5068  # CodeRangesToEntryPoints
715       - UInt32: 0x5080  # RedirectionMetadata
716       - UInt32: 0
717       - UInt32: 0
718       - UInt32: 0
719       - UInt32: 0
720       - UInt32: 0
721       - UInt32: 0
722       - UInt32: 0
723       - UInt32: 0       # CodeRangesToEntryPointsCount
724       - UInt32: 0       # RedirectionMetadataCount
725       - UInt32: 0
726       - UInt32: 0
727       - UInt32: 0
728       - UInt32: 0
729       - UInt32: 0
730       - UInt32: 0
731       - UInt32: 0x1001  # CodeMap[0]
732       - UInt32: 0x30
733       - UInt32: 0x2000  # CodeMap[1]
734       - UInt32: 0x40
735       - UInt32: 0x3002  # CodeMap[2]
736       - UInt32: 0x50
737   - Name:            .reloc
738     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
739     VirtualAddress:  0x7000
740     VirtualSize:     328
741     StructuredData:
742       - UInt32: 0         # pad
743       - UInt32: 1         # coff_dynamic_reloc_table.Version
744       - UInt32: 24        # coff_dynamic_reloc_table.Size
745       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
746       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
747       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
748       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
749       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
750       - Binary: 00000000
751 symbols:         []
754 # RUN: yaml2obj %s --docnum=11 -o %t11.dll
755 # RUN: not llvm-readobj %t11.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-TYPE %s
756 # ERR-RELOC-TYPE: Invalid relocation type
758 --- !COFF
759 OptionalHeader:
760   ImageBase:       0x180000000
761   SectionAlignment: 4096
762   FileAlignment:   512
763   DLLCharacteristics: [ ]
764   LoadConfigTable:
765     RelativeVirtualAddress: 0x4000
766     Size:            320
767 header:
768   Machine:         IMAGE_FILE_MACHINE_ARM64
769   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
770 sections:
771   - Name:            .text
772     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
773     VirtualAddress:  0x1000
774     VirtualSize:     0x2050
775   - Name:            .rdata
776     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
777     VirtualAddress:  0x4000
778     VirtualSize:     328
779     StructuredData:
780       - LoadConfig:
781           CHPEMetadataPointer: 0x180005000
782           DynamicValueRelocTableOffset: 4
783           DynamicValueRelocTableSection: 4
784   - Name:            .data
785     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
786     VirtualAddress:  0x5000
787     VirtualSize:     144
788     StructuredData:
789       - UInt32: 1       # Version
790       - UInt32: 0x5050  # CodeMap
791       - UInt32: 3       # CodeMapCount
792       - UInt32: 0x5068  # CodeRangesToEntryPoints
793       - UInt32: 0x5080  # RedirectionMetadata
794       - UInt32: 0
795       - UInt32: 0
796       - UInt32: 0
797       - UInt32: 0
798       - UInt32: 0
799       - UInt32: 0
800       - UInt32: 0
801       - UInt32: 0       # CodeRangesToEntryPointsCount
802       - UInt32: 0       # RedirectionMetadataCount
803       - UInt32: 0
804       - UInt32: 0
805       - UInt32: 0
806       - UInt32: 0
807       - UInt32: 0
808       - UInt32: 0
809       - UInt32: 0x1001  # CodeMap[0]
810       - UInt32: 0x30
811       - UInt32: 0x2000  # CodeMap[1]
812       - UInt32: 0x40
813       - UInt32: 0x3002  # CodeMap[2]
814       - UInt32: 0x50
815   - Name:            .reloc
816     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
817     VirtualAddress:  0x7000
818     VirtualSize:     328
819     StructuredData:
820       - UInt32: 0         # pad
821       - UInt32: 1         # coff_dynamic_reloc_table.Version
822       - UInt32: 24        # coff_dynamic_reloc_table.Size
823       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
824       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
825       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
826       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
827       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
828       - Binary: 00300000
829 symbols:         []
832 # RUN: yaml2obj %s --docnum=12 -o %t12.dll
833 # RUN: not llvm-readobj %t12.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-VALUE %s
834 # ERR-RELOC-VALUE: Invalid ARM64X relocation value size (0)
836 --- !COFF
837 OptionalHeader:
838   ImageBase:       0x180000000
839   SectionAlignment: 4096
840   FileAlignment:   512
841   DLLCharacteristics: [ ]
842   LoadConfigTable:
843     RelativeVirtualAddress: 0x4000
844     Size:            320
845 header:
846   Machine:         IMAGE_FILE_MACHINE_ARM64
847   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
848 sections:
849   - Name:            .text
850     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
851     VirtualAddress:  0x1000
852     VirtualSize:     0x2050
853   - Name:            .rdata
854     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
855     VirtualAddress:  0x4000
856     VirtualSize:     328
857     StructuredData:
858       - LoadConfig:
859           CHPEMetadataPointer: 0x180005000
860           DynamicValueRelocTableOffset: 4
861           DynamicValueRelocTableSection: 4
862   - Name:            .data
863     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
864     VirtualAddress:  0x5000
865     VirtualSize:     144
866     StructuredData:
867       - UInt32: 1       # Version
868       - UInt32: 0x5050  # CodeMap
869       - UInt32: 3       # CodeMapCount
870       - UInt32: 0x5068  # CodeRangesToEntryPoints
871       - UInt32: 0x5080  # RedirectionMetadata
872       - UInt32: 0
873       - UInt32: 0
874       - UInt32: 0
875       - UInt32: 0
876       - UInt32: 0
877       - UInt32: 0
878       - UInt32: 0
879       - UInt32: 0       # CodeRangesToEntryPointsCount
880       - UInt32: 0       # RedirectionMetadataCount
881       - UInt32: 0
882       - UInt32: 0
883       - UInt32: 0
884       - UInt32: 0
885       - UInt32: 0
886       - UInt32: 0
887       - UInt32: 0x1001  # CodeMap[0]
888       - UInt32: 0x30
889       - UInt32: 0x2000  # CodeMap[1]
890       - UInt32: 0x40
891       - UInt32: 0x3002  # CodeMap[2]
892       - UInt32: 0x50
893   - Name:            .reloc
894     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
895     VirtualAddress:  0x7000
896     VirtualSize:     328
897     StructuredData:
898       - UInt32: 0         # pad
899       - UInt32: 1         # coff_dynamic_reloc_table.Version
900       - UInt32: 24        # coff_dynamic_reloc_table.Size
901       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
902       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
903       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
904       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
905       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
906       - Binary: 00100000
907 symbols:         []
910 # RUN: yaml2obj %s --docnum=13 -o %t13.dll
911 # RUN: not llvm-readobj %t13.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-RVA %s
912 # ERR-RELOC-RVA: RVA 0x6062 for ARM64X reloc not found
914 --- !COFF
915 OptionalHeader:
916   ImageBase:       0x180000000
917   SectionAlignment: 4096
918   FileAlignment:   512
919   DLLCharacteristics: [ ]
920   LoadConfigTable:
921     RelativeVirtualAddress: 0x4000
922     Size:            320
923 header:
924   Machine:         IMAGE_FILE_MACHINE_ARM64
925   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
926 sections:
927   - Name:            .text
928     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
929     VirtualAddress:  0x1000
930     VirtualSize:     0x2050
931   - Name:            .rdata
932     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
933     VirtualAddress:  0x4000
934     VirtualSize:     328
935     StructuredData:
936       - LoadConfig:
937           CHPEMetadataPointer: 0x180005000
938           DynamicValueRelocTableOffset: 4
939           DynamicValueRelocTableSection: 4
940   - Name:            .data
941     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
942     VirtualAddress:  0x5000
943     VirtualSize:     144
944     StructuredData:
945       - UInt32: 1       # Version
946       - UInt32: 0x5050  # CodeMap
947       - UInt32: 3       # CodeMapCount
948       - UInt32: 0x5068  # CodeRangesToEntryPoints
949       - UInt32: 0x5080  # RedirectionMetadata
950       - UInt32: 0
951       - UInt32: 0
952       - UInt32: 0
953       - UInt32: 0
954       - UInt32: 0
955       - UInt32: 0
956       - UInt32: 0
957       - UInt32: 0       # CodeRangesToEntryPointsCount
958       - UInt32: 0       # RedirectionMetadataCount
959       - UInt32: 0
960       - UInt32: 0
961       - UInt32: 0
962       - UInt32: 0
963       - UInt32: 0
964       - UInt32: 0
965       - UInt32: 0x1001  # CodeMap[0]
966       - UInt32: 0x30
967       - UInt32: 0x2000  # CodeMap[1]
968       - UInt32: 0x40
969       - UInt32: 0x3002  # CodeMap[2]
970       - UInt32: 0x50
971   - Name:            .reloc
972     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
973     VirtualAddress:  0x7000
974     VirtualSize:     328
975     StructuredData:
976       - UInt32: 0         # pad
977       - UInt32: 1         # coff_dynamic_reloc_table.Version
978       - UInt32: 24        # coff_dynamic_reloc_table.Size
979       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
980       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
981       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
982       - UInt32: 0x6000    # coff_base_reloc_block_header[0].PageRVA
983       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
984       - Binary: 6040      # ZERO offset 0x60, size 2
985       - Binary: 0000      # terminator
986 symbols:         []
989 # RUN: yaml2obj %s --docnum=14 -o %t14.dll
990 # RUN: not llvm-readobj %t14.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-RVA-SIZE %s
991 # ERR-RELOC-RVA-SIZE: RVA 0x6062 for ARM64X reloc not found
993 --- !COFF
994 OptionalHeader:
995   ImageBase:       0x180000000
996   SectionAlignment: 4096
997   FileAlignment:   512
998   DLLCharacteristics: [ ]
999   LoadConfigTable:
1000     RelativeVirtualAddress: 0x4000
1001     Size:            320
1002 header:
1003   Machine:         IMAGE_FILE_MACHINE_ARM64
1004   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1005 sections:
1006   - Name:            .text
1007     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1008     VirtualAddress:  0x1000
1009     VirtualSize:     0x2050
1010   - Name:            .rdata
1011     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1012     VirtualAddress:  0x4000
1013     VirtualSize:     328
1014     StructuredData:
1015       - LoadConfig:
1016           CHPEMetadataPointer: 0x180005000
1017           DynamicValueRelocTableOffset: 4
1018           DynamicValueRelocTableSection: 4
1019   - Name:            .data
1020     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1021     VirtualAddress:  0x5000
1022     VirtualSize:     144
1023     StructuredData:
1024       - UInt32: 1       # Version
1025       - UInt32: 0x5050  # CodeMap
1026       - UInt32: 3       # CodeMapCount
1027       - UInt32: 0x5068  # CodeRangesToEntryPoints
1028       - UInt32: 0x5080  # RedirectionMetadata
1029       - UInt32: 0
1030       - UInt32: 0
1031       - UInt32: 0
1032       - UInt32: 0
1033       - UInt32: 0
1034       - UInt32: 0
1035       - UInt32: 0
1036       - UInt32: 0       # CodeRangesToEntryPointsCount
1037       - UInt32: 0       # RedirectionMetadataCount
1038       - UInt32: 0
1039       - UInt32: 0
1040       - UInt32: 0
1041       - UInt32: 0
1042       - UInt32: 0
1043       - UInt32: 0
1044       - UInt32: 0x1001  # CodeMap[0]
1045       - UInt32: 0x30
1046       - UInt32: 0x2000  # CodeMap[1]
1047       - UInt32: 0x40
1048       - UInt32: 0x3002  # CodeMap[2]
1049       - UInt32: 0x50
1050   - Name:            .reloc
1051     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1052     VirtualAddress:  0x7000
1053     VirtualSize:     328
1054     StructuredData:
1055       - UInt32: 0         # pad
1056       - UInt32: 1         # coff_dynamic_reloc_table.Version
1057       - UInt32: 24        # coff_dynamic_reloc_table.Size
1058       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1059       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1060       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
1061       - UInt32: 0x6000    # coff_base_reloc_block_header[0].PageRVA
1062       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1063       - Binary: 6040      # ZERO offset 0x60, size 2
1064       - Binary: 0000      # terminator
1065 symbols:         []
1068 # RUN: yaml2obj %s --docnum=15 -o %t15.dll
1069 # RUN: not llvm-readobj %t15.dll 2>&1 | FileCheck --check-prefix=ERR-PAGE-RVA %s
1070 # ERR-PAGE-RVA: Unaligned ARM64X relocations page RVA (24577)
1072 --- !COFF
1073 OptionalHeader:
1074   ImageBase:       0x180000000
1075   SectionAlignment: 4096
1076   FileAlignment:   512
1077   DLLCharacteristics: [ ]
1078   LoadConfigTable:
1079     RelativeVirtualAddress: 0x4000
1080     Size:            320
1081 header:
1082   Machine:         IMAGE_FILE_MACHINE_ARM64
1083   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1084 sections:
1085   - Name:            .text
1086     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1087     VirtualAddress:  0x1000
1088     VirtualSize:     0x2050
1089   - Name:            .rdata
1090     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1091     VirtualAddress:  0x4000
1092     VirtualSize:     328
1093     StructuredData:
1094       - LoadConfig:
1095           CHPEMetadataPointer: 0x180005000
1096           DynamicValueRelocTableOffset: 4
1097           DynamicValueRelocTableSection: 4
1098   - Name:            .data
1099     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1100     VirtualAddress:  0x5000
1101     VirtualSize:     144
1102     StructuredData:
1103       - UInt32: 1       # Version
1104       - UInt32: 0x5050  # CodeMap
1105       - UInt32: 3       # CodeMapCount
1106       - UInt32: 0x5068  # CodeRangesToEntryPoints
1107       - UInt32: 0x5080  # RedirectionMetadata
1108       - UInt32: 0
1109       - UInt32: 0
1110       - UInt32: 0
1111       - UInt32: 0
1112       - UInt32: 0
1113       - UInt32: 0
1114       - UInt32: 0
1115       - UInt32: 0       # CodeRangesToEntryPointsCount
1116       - UInt32: 0       # RedirectionMetadataCount
1117       - UInt32: 0
1118       - UInt32: 0
1119       - UInt32: 0
1120       - UInt32: 0
1121       - UInt32: 0
1122       - UInt32: 0
1123       - UInt32: 0x1001  # CodeMap[0]
1124       - UInt32: 0x30
1125       - UInt32: 0x2000  # CodeMap[1]
1126       - UInt32: 0x40
1127       - UInt32: 0x3002  # CodeMap[2]
1128       - UInt32: 0x50
1129   - Name:            .reloc
1130     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1131     VirtualAddress:  0x7000
1132     VirtualSize:     328
1133     StructuredData:
1134       - UInt32: 0         # pad
1135       - UInt32: 1         # coff_dynamic_reloc_table.Version
1136       - UInt32: 24        # coff_dynamic_reloc_table.Size
1137       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1138       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1139       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
1140       - UInt32: 0x6001    # coff_base_reloc_block_header[0].PageRVA
1141       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1142       - Binary: 0040      # ZERO offset 0, size 2
1143       - Binary: 0000      # terminator
1144 symbols:         []
1147 # RUN: yaml2obj %s --docnum=16 -o %t16.dll
1148 # RUN: not llvm-readobj %t16.dll 2>&1 | FileCheck --check-prefix=ERR-V2-HEADER-SIZE %s
1149 # ERR-V2-HEADER-SIZE: Invalid dynamic relocation header size (23)
1151 --- !COFF
1152 OptionalHeader:
1153   ImageBase:       0x180000000
1154   SectionAlignment: 4096
1155   FileAlignment:   512
1156   DLLCharacteristics: [ ]
1157   LoadConfigTable:
1158     RelativeVirtualAddress: 0x4000
1159     Size:            320
1160 header:
1161   Machine:         IMAGE_FILE_MACHINE_ARM64
1162   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1163 sections:
1164   - Name:            .text
1165     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1166     VirtualAddress:  0x1000
1167     VirtualSize:     0x2050
1168   - Name:            .rdata
1169     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1170     VirtualAddress:  0x4000
1171     VirtualSize:     328
1172     StructuredData:
1173       - LoadConfig:
1174           CHPEMetadataPointer: 0x180005000
1175           DynamicValueRelocTableOffset: 4
1176           DynamicValueRelocTableSection: 4
1177   - Name:            .data
1178     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1179     VirtualAddress:  0x5000
1180     VirtualSize:     144
1181     StructuredData:
1182       - UInt32: 1       # Version
1183       - UInt32: 0x5050  # CodeMap
1184       - UInt32: 3       # CodeMapCount
1185       - UInt32: 0x5068  # CodeRangesToEntryPoints
1186       - UInt32: 0x5080  # RedirectionMetadata
1187       - UInt32: 0
1188       - UInt32: 0
1189       - UInt32: 0
1190       - UInt32: 0
1191       - UInt32: 0
1192       - UInt32: 0
1193       - UInt32: 0
1194       - UInt32: 0       # CodeRangesToEntryPointsCount
1195       - UInt32: 0       # RedirectionMetadataCount
1196       - UInt32: 0
1197       - UInt32: 0
1198       - UInt32: 0
1199       - UInt32: 0
1200       - UInt32: 0
1201       - UInt32: 0
1202       - UInt32: 0x1001  # CodeMap[0]
1203       - UInt32: 0x30
1204       - UInt32: 0x2000  # CodeMap[1]
1205       - UInt32: 0x40
1206       - UInt32: 0x3002  # CodeMap[2]
1207       - UInt32: 0x50
1208   - Name:            .reloc
1209     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1210     VirtualAddress:  0x7000
1211     VirtualSize:     328
1212     StructuredData:
1213       - UInt32: 0         # pad
1214       - UInt32: 2         # coff_dynamic_reloc_table.Version
1215       - UInt32: 36        # coff_dynamic_reloc_table.Size
1216       - UInt32: 23        # coff_dynamic_relocation64_v2.HeaderSize
1217       - UInt32: 12        # coff_dynamic_relocation64_v2.FixupInfoSize
1218       - UInt32: 6         # coff_dynamic_relocation64_v2.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1219       - UInt32: 0         # coff_dynamic_relocation64_v2.Symbol(high)
1220       - UInt32: 0         # coff_dynamic_relocation64_v2.SymbolGroup
1221       - UInt32: 0         # coff_dynamic_relocation64_v2.Flags
1222       - UInt32: 0x6000    # coff_base_reloc_block_header[0].PageRVA
1223       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1224       - Binary: 0040      # ZERO offset 0, size 2
1225       - Binary: 0000      # terminator
1226 symbols:         []
1229 # RUN: yaml2obj %s --docnum=17 -o %t17.dll
1230 # RUN: not llvm-readobj %t17.dll 2>&1 | FileCheck --check-prefix=ERR-RELOC-SIZE %s
1232 --- !COFF
1233 OptionalHeader:
1234   ImageBase:       0x180000000
1235   SectionAlignment: 4096
1236   FileAlignment:   512
1237   DLLCharacteristics: [ ]
1238   LoadConfigTable:
1239     RelativeVirtualAddress: 0x4000
1240     Size:            320
1241 header:
1242   Machine:         IMAGE_FILE_MACHINE_ARM64
1243   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1244 sections:
1245   - Name:            .text
1246     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1247     VirtualAddress:  0x1000
1248     VirtualSize:     0x2050
1249   - Name:            .rdata
1250     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1251     VirtualAddress:  0x4000
1252     VirtualSize:     328
1253     StructuredData:
1254       - LoadConfig:
1255           CHPEMetadataPointer: 0x180005000
1256           DynamicValueRelocTableOffset: 4
1257           DynamicValueRelocTableSection: 4
1258   - Name:            .data
1259     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1260     VirtualAddress:  0x5000
1261     VirtualSize:     144
1262     StructuredData:
1263       - UInt32: 1       # Version
1264       - UInt32: 0x5050  # CodeMap
1265       - UInt32: 3       # CodeMapCount
1266       - UInt32: 0x5068  # CodeRangesToEntryPoints
1267       - UInt32: 0x5080  # RedirectionMetadata
1268       - UInt32: 0
1269       - UInt32: 0
1270       - UInt32: 0
1271       - UInt32: 0
1272       - UInt32: 0
1273       - UInt32: 0
1274       - UInt32: 0
1275       - UInt32: 0       # CodeRangesToEntryPointsCount
1276       - UInt32: 0       # RedirectionMetadataCount
1277       - UInt32: 0
1278       - UInt32: 0
1279       - UInt32: 0
1280       - UInt32: 0
1281       - UInt32: 0
1282       - UInt32: 0
1283       - UInt32: 0x1001  # CodeMap[0]
1284       - UInt32: 0x30
1285       - UInt32: 0x2000  # CodeMap[1]
1286       - UInt32: 0x40
1287       - UInt32: 0x3002  # CodeMap[2]
1288       - UInt32: 0x50
1289   - Name:            .reloc
1290     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1291     VirtualAddress:  0x7000
1292     VirtualSize:     328
1293     StructuredData:
1294       - UInt32: 0         # pad
1295       - UInt32: 2         # coff_dynamic_reloc_table.Version
1296       - UInt32: 20        # coff_dynamic_reloc_table.Size
1297       - UInt32: 24        # coff_dynamic_relocation64_v2.HeaderSize
1298       - UInt32: 12        # coff_dynamic_relocation64_v2.FixupInfoSize
1299       - UInt32: 6         # coff_dynamic_relocation64_v2.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1300       - UInt32: 0         # coff_dynamic_relocation64_v2.Symbol(high)
1301       - UInt32: 0         # coff_dynamic_relocation64_v2.SymbolGroup
1302 symbols:         []
1305 # RUN: yaml2obj %s --docnum=18 -o %t18.dll
1306 # RUN: not llvm-readobj %t18.dll 2>&1 | FileCheck --check-prefix=ERR-RVA-ALIGN %s
1307 # ERR-RVA-ALIGN: Unaligned ARM64X relocation RVA (24577)
1309 --- !COFF
1310 OptionalHeader:
1311   ImageBase:       0x180000000
1312   SectionAlignment: 4096
1313   FileAlignment:   512
1314   DLLCharacteristics: [ ]
1315   LoadConfigTable:
1316     RelativeVirtualAddress: 0x4000
1317     Size:            320
1318 header:
1319   Machine:         IMAGE_FILE_MACHINE_ARM64
1320   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1321 sections:
1322   - Name:            .text
1323     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1324     VirtualAddress:  0x1000
1325     VirtualSize:     0x2050
1326   - Name:            .rdata
1327     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1328     VirtualAddress:  0x4000
1329     VirtualSize:     328
1330     StructuredData:
1331       - LoadConfig:
1332           CHPEMetadataPointer: 0x180005000
1333           DynamicValueRelocTableOffset: 4
1334           DynamicValueRelocTableSection: 4
1335   - Name:            .data
1336     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1337     VirtualAddress:  0x5000
1338     VirtualSize:     144
1339     StructuredData:
1340       - UInt32: 1       # Version
1341       - UInt32: 0x5050  # CodeMap
1342       - UInt32: 3       # CodeMapCount
1343       - UInt32: 0x5068  # CodeRangesToEntryPoints
1344       - UInt32: 0x5080  # RedirectionMetadata
1345       - UInt32: 0
1346       - UInt32: 0
1347       - UInt32: 0
1348       - UInt32: 0
1349       - UInt32: 0
1350       - UInt32: 0
1351       - UInt32: 0
1352       - UInt32: 0       # CodeRangesToEntryPointsCount
1353       - UInt32: 0       # RedirectionMetadataCount
1354       - UInt32: 0
1355       - UInt32: 0
1356       - UInt32: 0
1357       - UInt32: 0
1358       - UInt32: 0
1359       - UInt32: 0
1360       - UInt32: 0x1001  # CodeMap[0]
1361       - UInt32: 0x30
1362       - UInt32: 0x2000  # CodeMap[1]
1363       - UInt32: 0x40
1364       - UInt32: 0x3002  # CodeMap[2]
1365       - UInt32: 0x50
1366   - Name:            .reloc
1367     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1368     VirtualAddress:  0x7000
1369     VirtualSize:     328
1370     StructuredData:
1371       - UInt32: 0         # pad
1372       - UInt32: 1         # coff_dynamic_reloc_table.Version
1373       - UInt32: 24        # coff_dynamic_reloc_table.Size
1374       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1375       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1376       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
1377       - UInt32: 0x6000    # coff_base_reloc_block_header[0].PageRVA
1378       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1379       - Binary: 0140      # ZERO offset 0, size 2
1380       - Binary: 0000      # terminator
1381 symbols:         []
1384 # RUN: yaml2obj %s --docnum=19 -o %t19.dll
1385 # RUN: not llvm-readobj %t19.dll 2>&1 | FileCheck --check-prefix=ERR-INVALID-VERSION %s
1386 # ERR-INVALID-VERSION: Unsupported dynamic relocations table version (3)
1388 --- !COFF
1389 OptionalHeader:
1390   ImageBase:       0x180000000
1391   SectionAlignment: 4096
1392   FileAlignment:   512
1393   DLLCharacteristics: [ ]
1394   LoadConfigTable:
1395     RelativeVirtualAddress: 0x4000
1396     Size:            320
1397 header:
1398   Machine:         IMAGE_FILE_MACHINE_ARM64
1399   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1400 sections:
1401   - Name:            .text
1402     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1403     VirtualAddress:  0x1000
1404     VirtualSize:     0x2050
1405   - Name:            .rdata
1406     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1407     VirtualAddress:  0x4000
1408     VirtualSize:     328
1409     StructuredData:
1410       - LoadConfig:
1411           CHPEMetadataPointer: 0x180005000
1412           DynamicValueRelocTableOffset: 4
1413           DynamicValueRelocTableSection: 4
1414   - Name:            .data
1415     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1416     VirtualAddress:  0x5000
1417     VirtualSize:     144
1418     StructuredData:
1419       - UInt32: 1       # Version
1420       - UInt32: 0x5050  # CodeMap
1421       - UInt32: 3       # CodeMapCount
1422       - UInt32: 0x5068  # CodeRangesToEntryPoints
1423       - UInt32: 0x5080  # RedirectionMetadata
1424       - UInt32: 0
1425       - UInt32: 0
1426       - UInt32: 0
1427       - UInt32: 0
1428       - UInt32: 0
1429       - UInt32: 0
1430       - UInt32: 0
1431       - UInt32: 0       # CodeRangesToEntryPointsCount
1432       - UInt32: 0       # RedirectionMetadataCount
1433       - UInt32: 0
1434       - UInt32: 0
1435       - UInt32: 0
1436       - UInt32: 0
1437       - UInt32: 0
1438       - UInt32: 0
1439       - UInt32: 0x1001  # CodeMap[0]
1440       - UInt32: 0x30
1441       - UInt32: 0x2000  # CodeMap[1]
1442       - UInt32: 0x40
1443       - UInt32: 0x3002  # CodeMap[2]
1444       - UInt32: 0x50
1445   - Name:            .reloc
1446     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1447     VirtualAddress:  0x7000
1448     VirtualSize:     328
1449     StructuredData:
1450       - UInt32: 0         # pad
1451       - UInt32: 3         # coff_dynamic_reloc_table.Version
1452       - UInt32: 24        # coff_dynamic_reloc_table.Size
1453       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1454       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1455       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
1456       - UInt32: 0x6000    # coff_base_reloc_block_header[0].PageRVA
1457       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1458       - Binary: 0140      # ZERO offset 0, size 2
1459       - Binary: 0000      # terminator
1460 symbols:         []
1463 # RUN: yaml2obj %s --docnum=20 -o %t20.dll
1464 # RUN: not llvm-readobj %t20.dll 2>&1 | FileCheck --check-prefix=ERR-END %s
1465 # ERR-END: Unexpected end of ARM64X relocations
1467 --- !COFF
1468 OptionalHeader:
1469   ImageBase:       0x180000000
1470   SectionAlignment: 4096
1471   FileAlignment:   512
1472   DLLCharacteristics: [ ]
1473   LoadConfigTable:
1474     RelativeVirtualAddress: 0x5000
1475     Size:            320
1476 header:
1477   Machine:         IMAGE_FILE_MACHINE_ARM64
1478   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1479 sections:
1480   - Name:            .text
1481     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1482     VirtualAddress:  0x2000
1483     VirtualSize:     0x2050
1484   - Name:            .rdata
1485     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1486     VirtualAddress:  0x5000
1487     VirtualSize:     328
1488     StructuredData:
1489       - LoadConfig:
1490           CHPEMetadataPointer: 0x180005000
1491           DynamicValueRelocTableOffset: 4
1492           DynamicValueRelocTableSection: 4
1493   - Name:            .data
1494     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1495     VirtualAddress:  0x6000
1496     VirtualSize:     144
1497     StructuredData:
1498       - UInt32: 1       # Version
1499       - UInt32: 0x5050  # CodeMap
1500       - UInt32: 3       # CodeMapCount
1501       - UInt32: 0x5068  # CodeRangesToEntryPoints
1502       - UInt32: 0x5080  # RedirectionMetadata
1503       - UInt32: 0
1504       - UInt32: 0
1505       - UInt32: 0
1506       - UInt32: 0
1507       - UInt32: 0
1508       - UInt32: 0
1509       - UInt32: 0
1510       - UInt32: 0       # CodeRangesToEntryPointsCount
1511       - UInt32: 0       # RedirectionMetadataCount
1512       - UInt32: 0
1513       - UInt32: 0
1514       - UInt32: 0
1515       - UInt32: 0
1516       - UInt32: 0
1517       - UInt32: 0
1518       - UInt32: 0x1001  # CodeMap[0]
1519       - UInt32: 0x30
1520       - UInt32: 0x2000  # CodeMap[1]
1521       - UInt32: 0x40
1522       - UInt32: 0x3002  # CodeMap[2]
1523       - UInt32: 0x50
1524   - Name:            .reloc
1525     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1526     VirtualAddress:  0x7000
1527     VirtualSize:     328
1528     StructuredData:
1529       - UInt32: 0         # pad
1530       - UInt32: 1         # coff_dynamic_reloc_table.Version
1531       - UInt32: 24        # coff_dynamic_reloc_table.Size
1532       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1533       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1534       - UInt32: 12        # coff_dynamic_relocation64.BaseRelocSize
1535       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
1536       - UInt32: 12        # coff_base_reloc_block_header[0].BlockSize
1537       - Binary: 2490      # VALUE offset 0x24, size 4
1538       - Binary: 0000      # terminator
1539 symbols:         []
1542 # RUN: yaml2obj %s --docnum=21 -o %t21.dll
1543 # RUN: not llvm-readobj %t21.dll 2>&1 | FileCheck --check-prefix=ERR-TERMINATOR %s
1545 --- !COFF
1546 OptionalHeader:
1547   ImageBase:       0x180000000
1548   SectionAlignment: 4096
1549   FileAlignment:   512
1550   DLLCharacteristics: [ ]
1551   LoadConfigTable:
1552     RelativeVirtualAddress: 0x4000
1553     Size:            320
1554 header:
1555   Machine:         IMAGE_FILE_MACHINE_ARM64
1556   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
1557 sections:
1558   - Name:            .text
1559     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
1560     VirtualAddress:  0x1000
1561     VirtualSize:     0x2050
1562   - Name:            .rdata
1563     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
1564     VirtualAddress:  0x4000
1565     VirtualSize:     328
1566     StructuredData:
1567       - LoadConfig:
1568           CHPEMetadataPointer: 0x180005000
1569           DynamicValueRelocTableOffset: 4
1570           DynamicValueRelocTableSection: 4
1571   - Name:            .data
1572     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
1573     VirtualAddress:  0x5000
1574     VirtualSize:     144
1575     StructuredData:
1576       - UInt32: 1       # Version
1577       - UInt32: 0x5050  # CodeMap
1578       - UInt32: 3       # CodeMapCount
1579       - UInt32: 0x5068  # CodeRangesToEntryPoints
1580       - UInt32: 0x5080  # RedirectionMetadata
1581       - UInt32: 0
1582       - UInt32: 0
1583       - UInt32: 0
1584       - UInt32: 0
1585       - UInt32: 0
1586       - UInt32: 0
1587       - UInt32: 0
1588       - UInt32: 0       # CodeRangesToEntryPointsCount
1589       - UInt32: 0       # RedirectionMetadataCount
1590       - UInt32: 0
1591       - UInt32: 0
1592       - UInt32: 0
1593       - UInt32: 0
1594       - UInt32: 0
1595       - UInt32: 0
1596       - UInt32: 0x1001  # CodeMap[0]
1597       - UInt32: 0x30
1598       - UInt32: 0x2000  # CodeMap[1]
1599       - UInt32: 0x40
1600       - UInt32: 0x3002  # CodeMap[2]
1601       - UInt32: 0x50
1602   - Name:            .reloc
1603     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_DISCARDABLE ]
1604     VirtualAddress:  0x7000
1605     VirtualSize:     328
1606     StructuredData:
1607       - UInt32: 0         # pad
1608       - UInt32: 1         # coff_dynamic_reloc_table.Version
1609       - UInt32: 28        # coff_dynamic_reloc_table.Size
1610       - UInt32: 6         # coff_dynamic_relocation64.Symbol(low) = IMAGE_DYNAMIC_RELOCATION_ARM64X
1611       - UInt32: 0         # coff_dynamic_relocation64.Symbol(high)
1612       - UInt32: 16        # coff_dynamic_relocation64.BaseRelocSize
1613       - UInt32: 0         # coff_base_reloc_block_header[0].PageRVA
1614       - UInt32: 16        # coff_base_reloc_block_header[0].BlockSize
1615       - Binary: 0040      # ZERO offset 0, size 2
1616       - Binary: 00000000
1617 symbols:         []