1 # RUN: yaml2obj --docnum=1 %s -o %t1
2 # RUN: llvm-readobj --coff-load-config %t1 | FileCheck %s
4 # CHECK: CHPEMetadataPointer: 0x180005000
5 # CHECK: CHPEMetadata [
6 # CHECK-NEXT: Version: 0x1
7 # CHECK-NEXT: CodeMap [
8 # CHECK-NEXT: 0x1000 - 0x1030 ARM64EC
9 # CHECK-NEXT: 0x2000 - 0x2040 ARM64
10 # CHECK-NEXT: 0x3000 - 0x3050 X64
12 # CHECK-NEXT: CodeRangesToEntryPoints [
13 # CHECK-NEXT: 0x1000 - 0x1020 -> 0x1000
14 # CHECK-NEXT: 0x1020 - 0x1040 -> 0x2000
16 # CHECK-NEXT: RedirectionMetadata [
17 # CHECK-NEXT: 0x1000 -> 0x2000
18 # CHECK-NEXT: 0x1020 -> 0x2030
20 # CHECK-NOT: AuxiliaryDelayloadIAT:
24 ImageBase: 0x180000000
25 SectionAlignment: 4096
27 DLLCharacteristics: [ ]
29 RelativeVirtualAddress: 0x4000
32 Machine: IMAGE_FILE_MACHINE_AMD64
33 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
36 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
37 VirtualAddress: 0x1000
40 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
41 VirtualAddress: 0x4000
45 CHPEMetadataPointer: 0x180005000
47 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
48 VirtualAddress: 0x5000
52 - UInt32: 0x5050 # CodeMap
53 - UInt32: 3 # CodeMapCount
54 - UInt32: 0x5068 # CodeRangesToEntryPoints
55 - UInt32: 0x5080 # RedirectionMetadata
63 - UInt32: 2 # CodeRangesToEntryPointsCount
64 - UInt32: 2 # RedirectionMetadataCount
71 - UInt32: 0x1001 # CodeMap[0]
73 - UInt32: 0x2000 # CodeMap[1]
75 - UInt32: 0x3002 # CodeMap[2]
77 - UInt32: 0x1000 # CodeRangesToEntryPoints[0]
80 - UInt32: 0x1020 # CodeRangesToEntryPoints[1]
83 - UInt32: 0x1000 # RedirectionMetadata[0]
85 - UInt32: 0x1020 # RedirectionMetadata[1]
90 # RUN: yaml2obj --docnum=2 %s -o %t2
91 # RUN: llvm-readobj --coff-load-config %t2 | FileCheck --check-prefix=CHPE2 %s
93 # CHPE2: CHPEMetadata [
94 # CHPE2-NEXT: Version: 0x2
95 # CHPE2: AuxiliaryDelayloadIAT: 0x1
96 # CHPE2-NEXT: AuxiliaryDelayloadIATCopy: 0x2
97 # CHPE2-NEXT: HybridImageInfoBitfield: 0x4
101 ImageBase: 0x180000000
102 SectionAlignment: 4096
104 DLLCharacteristics: [ ]
106 RelativeVirtualAddress: 0x4000
109 Machine: IMAGE_FILE_MACHINE_AMD64
110 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
113 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
114 VirtualAddress: 0x1000
117 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
118 VirtualAddress: 0x4000
122 CHPEMetadataPointer: 0x180005000
124 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
125 VirtualAddress: 0x5000
128 - UInt32: 2 # Version
148 - UInt32: 1 # AuxiliaryDelayloadIAT
149 - UInt32: 2 # AuxiliaryDelayloadIATCopy
150 - UInt32: 4 # HybridImageInfoBitfield
154 # RUN: yaml2obj --docnum=3 %s -o %t3
155 # RUN: not llvm-readobj --coff-load-config %t3 2>&1 | FileCheck --check-prefix=ERR-EOF %s
156 # ERR-EOF: The end of the file was unexpectedly encountered
160 ImageBase: 0x180000000
161 SectionAlignment: 4096
163 DLLCharacteristics: [ ]
165 RelativeVirtualAddress: 0x4000
168 Machine: IMAGE_FILE_MACHINE_AMD64
169 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
172 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
173 VirtualAddress: 0x1000
176 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
177 VirtualAddress: 0x4000
181 CHPEMetadataPointer: 0x1800041AC