Fix --exclude-libs option. Based on code already committed upstream.
authorkettenis <kettenis@openbsd.org>
Tue, 11 Sep 2018 09:25:56 +0000 (09:25 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 11 Sep 2018 09:25:56 +0000 (09:25 +0000)
tested by naddy@

gnu/llvm/tools/lld/ELF/Driver.cpp

index 36343e9..edc7ee1 100644 (file)
@@ -961,7 +961,7 @@ static void excludeLibs(opt::InputArgList &Args, ArrayRef<InputFile *> Files) {
     if (Optional<StringRef> Archive = getArchiveName(File))
       if (All || Libs.count(path::filename(*Archive)))
         for (Symbol *Sym : File->getSymbols())
-          if (!Sym->isLocal())
+          if (!Sym->isLocal() && Sym->File == File)
             Sym->VersionId = VER_NDX_LOCAL;
 }