[llvm-branch-commits] [lld] r325502 - Merging r325204:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 19 06:20:30 PST 2018


Author: hans
Date: Mon Feb 19 06:20:30 2018
New Revision: 325502

URL: http://llvm.org/viewvc/llvm-project?rev=325502&view=rev
Log:
Merging r325204:
------------------------------------------------------------------------
r325204 | ruiu | 2018-02-15 03:40:58 +0100 (Thu, 15 Feb 2018) | 7 lines

Fix an issue that lld drops symbol versions for -r.

When we are emitting a relocatable output, we should keep the original
symbol name including "@" part. Previously, we drop that part unconditionally
which resulted in dropping versions from symbols.

Differential Revision: https://reviews.llvm.org/D43307
------------------------------------------------------------------------

Added:
    lld/branches/release_60/test/ELF/relocatable-versioned.s
      - copied unchanged from r325204, lld/trunk/test/ELF/relocatable-versioned.s
Modified:
    lld/branches/release_60/   (props changed)
    lld/branches/release_60/ELF/Driver.cpp

Propchange: lld/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb 19 06:20:30 2018
@@ -1 +1 @@
-/lld/trunk:321983,321986,322041,322259,322264,322359,322421,322801,323155,323221,323243,323288,323395-323396,323399,323440,323449,323456,323625,323893,323895,324043,324467-324468
+/lld/trunk:321983,321986,322041,322259,322264,322359,322421,322801,323155,323221,323243,323288,323395-323396,323399,323440,323449,323456,323625,323893,323895,324043,324467-324468,325204

Modified: lld/branches/release_60/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_60/ELF/Driver.cpp?rev=325502&r1=325501&r2=325502&view=diff
==============================================================================
--- lld/branches/release_60/ELF/Driver.cpp (original)
+++ lld/branches/release_60/ELF/Driver.cpp Mon Feb 19 06:20:30 2018
@@ -1061,7 +1061,12 @@ template <class ELFT> void LinkerDriver:
     addReservedSymbols();
 
   // Apply version scripts.
-  Symtab->scanVersionScript();
+  //
+  // For a relocatable output, version scripts don't make sense, and
+  // parsing a symbol version string (e.g. dropping "@ver1" from a symbol
+  // name "foo at ver1") rather do harm, so we don't call this if -r is given.
+  if (!Config->Relocatable)
+    Symtab->scanVersionScript();
 
   // Create wrapped symbols for -wrap option.
   for (auto *Arg : Args.filtered(OPT_wrap))




More information about the llvm-branch-commits mailing list