Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 2017 13:41:06 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r320597 - projects/clang500-import/contrib/llvm/tools/lld/ELF
Message-ID:  <201707031341.v63Df6bm017039@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Jul  3 13:41:05 2017
New Revision: 320597
URL: https://svnweb.freebsd.org/changeset/base/320597

Log:
  Revert LLVM r306813: Resolve references properly when using .symver
  
  This LLD commit was intended to fix one case of symbol versioning
  (LLVM PR28414) but broke FreeBSD buildworld.  It has been reverted
  upstream in LLVM r306996.
  
  Discussed with:	dim

Modified:
  projects/clang500-import/contrib/llvm/tools/lld/ELF/SymbolTable.cpp

Modified: projects/clang500-import/contrib/llvm/tools/lld/ELF/SymbolTable.cpp
==============================================================================
--- projects/clang500-import/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Mon Jul  3 13:02:21 2017	(r320596)
+++ projects/clang500-import/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Mon Jul  3 13:41:05 2017	(r320597)
@@ -712,31 +712,15 @@ void SymbolTable<ELFT>::assignWildcardVersion(SymbolVe
       B->symbol()->VersionId = VersionId;
 }
 
-static bool isDefaultVersion(SymbolBody *B) {
-  return B->isInCurrentDSO() && B->getName().find("@@") != StringRef::npos;
-}
-
 // This function processes version scripts by updating VersionId
 // member of symbols.
 template <class ELFT> void SymbolTable<ELFT>::scanVersionScript() {
   // Symbol themselves might know their versions because symbols
   // can contain versions in the form of <name>@<version>.
-  // Let them parse and update their names to exclude version suffix.
-  for (Symbol *Sym : SymVector) {
-    SymbolBody *Body = Sym->body();
-    bool IsDefault = isDefaultVersion(Body);
-    Body->parseSymbolVersion();
-
-    if (!IsDefault)
-      continue;
-
-    // <name>@@<version> means the symbol is the default version. If that's the
-    // case, the symbol is not used only to resolve <name> of version <version>
-    // but also undefined unversioned symbols with name <name>.
-    SymbolBody *S = find(Body->getName());
-    if (S && S->isUndefined())
-      S->copy(Body);
-  }
+  // Let them parse their names.
+  if (!Config->VersionDefinitions.empty())
+    for (Symbol *Sym : SymVector)
+      Sym->body()->parseSymbolVersion();
 
   // Handle edge cases first.
   handleAnonymousVersion();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707031341.v63Df6bm017039>