forked from OSchip/llvm-project
Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
llvm-svn: 278429
This commit is contained in:
parent
8e0c53a018
commit
8950a53821
|
@ -718,9 +718,11 @@ COFFObjectFile::COFFObjectFile(MemoryBufferRef Object, std::error_code &EC)
|
||||||
}
|
}
|
||||||
if ((EC = getObject(DataDirectory, Data, DataDirAddr, DataDirSize)))
|
if ((EC = getObject(DataDirectory, Data, DataDirAddr, DataDirSize)))
|
||||||
return;
|
return;
|
||||||
CurPtr += COFFHeader->SizeOfOptionalHeader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (COFFHeader)
|
||||||
|
CurPtr += COFFHeader->SizeOfOptionalHeader;
|
||||||
|
|
||||||
if ((EC = getObject(SectionTable, Data, base() + CurPtr,
|
if ((EC = getObject(SectionTable, Data, base() + CurPtr,
|
||||||
(uint64_t)getNumberOfSections() * sizeof(coff_section))))
|
(uint64_t)getNumberOfSections() * sizeof(coff_section))))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue