[lld] r187211 - [PECOFF] Ignore sections with IMAGE_SCN_LNK_REMOVE attribute.

Rui Ueyama ruiu at google.com
Fri Jul 26 09:59:39 PDT 2013


Author: ruiu
Date: Fri Jul 26 11:59:38 2013
New Revision: 187211

URL: http://llvm.org/viewvc/llvm-project?rev=187211&view=rev
Log:
[PECOFF] Ignore sections with IMAGE_SCN_LNK_REMOVE attribute.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=187211&r1=187210&r2=187211&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Fri Jul 26 11:59:38 2013
@@ -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());





More information about the llvm-commits mailing list