File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
test/tools/llvm-readobj/COFF Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -763,7 +763,7 @@ Error COFFObjectFile::initLoadConfigPtr() {
763
763
if (Error E =
764
764
getRvaPtr (ChpeOff - getImageBase (), IntPtr, " CHPE metadata" ))
765
765
return E;
766
- if (Error E = checkOffset (Data, IntPtr, sizeof (CHPEMetadata)))
766
+ if (Error E = checkOffset (Data, IntPtr, sizeof (* CHPEMetadata)))
767
767
return E;
768
768
769
769
CHPEMetadata = reinterpret_cast <const chpe_metadata *>(IntPtr);
Original file line number Diff line number Diff line change @@ -150,3 +150,34 @@ sections:
150
150
- UInt32 : 4 # HybridImageInfoBitfield
151
151
symbols : []
152
152
...
153
+
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
157
+
158
+ --- !COFF
159
+ OptionalHeader :
160
+ ImageBase : 0x180000000
161
+ SectionAlignment : 4096
162
+ FileAlignment : 512
163
+ DLLCharacteristics : [ ]
164
+ LoadConfigTable :
165
+ RelativeVirtualAddress : 0x4000
166
+ Size : 320
167
+ header :
168
+ Machine : IMAGE_FILE_MACHINE_AMD64
169
+ Characteristics : [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
170
+ sections :
171
+ - Name : .text
172
+ Characteristics : [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
173
+ VirtualAddress : 0x1000
174
+ VirtualSize : 0x2050
175
+ - Name : .rdata
176
+ Characteristics : [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
177
+ VirtualAddress : 0x4000
178
+ VirtualSize : 512
179
+ StructuredData :
180
+ - LoadConfig :
181
+ CHPEMetadataPointer : 0x1800041AC
182
+ symbols : []
183
+ ...
You can’t perform that action at this time.
0 commit comments