1
0
mirror of https://github.com/RPCSX/llvm.git synced 2025-04-04 01:01:37 +00:00

Re-commit r278066: Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama 2016-08-11 22:02:44 +00:00
parent d4a60d05aa
commit 837032f833

@ -718,9 +718,11 @@ COFFObjectFile::COFFObjectFile(MemoryBufferRef Object, std::error_code &EC)
}
if ((EC = getObject(DataDirectory, Data, DataDirAddr, DataDirSize)))
return;
CurPtr += COFFHeader->SizeOfOptionalHeader;
}
if (COFFHeader)
CurPtr += COFFHeader->SizeOfOptionalHeader;
if ((EC = getObject(SectionTable, Data, base() + CurPtr,
(uint64_t)getNumberOfSections() * sizeof(coff_section))))
return;