summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-07-26 16:59:38 +0000
committerRui Ueyama <ruiu@google.com>2013-07-26 16:59:38 +0000
commitb37fba7c54bd83ea0198c13433a1eba32401850d (patch)
tree68919149a904db6a7c52ead03343e816462aceb4
parente33d4afa47a4562ffc9c50f777b2e76e5be2ab56 (diff)
downloadbcm5719-llvm-b37fba7c54bd83ea0198c13433a1eba32401850d.tar.gz
bcm5719-llvm-b37fba7c54bd83ea0198c13433a1eba32401850d.zip
[PECOFF] Ignore sections with IMAGE_SCN_LNK_REMOVE attribute.
llvm-svn: 187211
-rw-r--r--lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
index 110889ceb22..ef29769a7cf 100644
--- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
@@ -200,6 +200,11 @@ private:
if (sectionName == ".debug$S")
return error_code::success();
+ // A section with IMAGE_SCN_LNK_REMOVE attribute will never become
+ // a part of the output image. That's what the COFF spec says.
+ if (section->Characteristics & llvm::COFF::IMAGE_SCN_LNK_REMOVE)
+ return error_code::success();
+
// Create an atom for the entire section.
if (symbols.empty()) {
ArrayRef<uint8_t> Data(SecData.data(), SecData.size());
OpenPOWER on IntegriCloud