diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-07-04 02:26:20 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-07-04 02:26:20 +0000 |
| commit | cffbe7cb554e2cfffa3759e54a0d87c20dd7636e (patch) | |
| tree | df1f738e3859a55b18cb169efb86dbde86d21ab9 | |
| parent | 3126c6c565efed0d3d5391b5fc35f841759ff876 (diff) | |
| download | bcm5719-llvm-cffbe7cb554e2cfffa3759e54a0d87c20dd7636e.tar.gz bcm5719-llvm-cffbe7cb554e2cfffa3759e54a0d87c20dd7636e.zip | |
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
| -rw-r--r-- | lld/COFF/InputFiles.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 3bb3c6f36d4..9b2b9b3513f 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -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")) |

