COFF: Do not use VirtualSize section header field for directive sections.

Looks like clang-cl sets a bogus value to the field, which makes
getSectionContents() to truncate section contents. This patch directly
uses SizeOfRawData field instead of VirtualSize to see if this can
make buildbot green.

llvm-svn: 241386
This commit is contained in:
Rui Ueyama 2015-07-04 02:26:20 +00:00
parent 3126c6c565
commit cffbe7cb55
1 changed files with 2 additions and 1 deletions

View File

@ -136,7 +136,8 @@ std::error_code ObjectFile::initializeChunks() {
if (Name == ".drectve") {
ArrayRef<uint8_t> Data;
COFFObj->getSectionContents(Sec, Data);
Directives = std::string((const char *)Data.data(), Data.size());
Directives = std::string((const char *)Data.data(),
Sec->SizeOfRawData);
continue;
}
if (Name.startswith(".debug"))