From 04597ac2585f8e532797e92625cf8d097b7725e1 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sun, 8 Mar 2015 21:31:36 +0000 Subject: [PATCH] Re-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root That commit was reverted in r231582 as it was a culprit for buildbot breakage. Turned out it's not. llvm-svn: 231610 --- lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp index 5eec68c..6abd689 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp @@ -375,8 +375,10 @@ 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:= option. // The mapping for /alternatename is in the context object. This helper @@ -387,10 +389,6 @@ 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. -- 2.7.4