[lld] r231582 - Revert r231545 to unbreak buildbot.

Rui Ueyama ruiu at google.com
Sat Mar 7 16:26:53 PST 2015


Author: ruiu
Date: Sat Mar  7 18:26:53 2015
New Revision: 231582

URL: http://llvm.org/viewvc/llvm-project?rev=231582&view=rev
Log:
Revert r231545 to unbreak buildbot.

This patch reverts r231545 "PECOFF: Do not add extraneous symbols
to the dead strip root." CrWinClangLLD buildbot is currently broken.
Since I can't reproduce the issue locally, I'm reverting the most
relevant change.

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=231582&r1=231581&r2=231582&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Sat Mar  7 18:26:53 2015
@@ -375,10 +375,8 @@ void FileCOFF::beforeLink() {
 
   // Add /INCLUDE'ed symbols to the file as if they existed in the
   // file as undefined symbols.
-  for (StringRef sym : undefSyms) {
+  for (StringRef sym : undefSyms)
     addUndefinedSymbol(sym);
-    _ctx.addDeadStripRoot(sym);
-  }
 
   // One can define alias symbols using /alternatename:<sym>=<sym> option.
   // The mapping for /alternatename is in the context object. This helper
@@ -389,6 +387,10 @@ void FileCOFF::beforeLink() {
   // SEH. Disable SEH if the file being read is not compatible.
   if (!isCompatibleWithSEH())
     _ctx.setSafeSEH(false);
+
+  if (_ctx.deadStrip())
+    for (const UndefinedAtom *undef : undefined())
+      _ctx.addDeadStripRoot(undef->name());
 }
 
 /// Iterate over the symbol table to retrieve all symbols.





More information about the llvm-commits mailing list