This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: Simply override version of special symbol


For a linker-defined symbol such as "_end", it is possible for a version
script to force the use of a specific version in a shared library.  It
is then possible for some other shared library to use a different
version script to force a different version.  This would cause gold to
fail an assertion when it saw a symbol with two different default
versions.  This patch fixes the problem by simply permitting this sort
of overridding.  Committed to mainline.

Ian


2011-07-05  Ian Lance Taylor  <iant@google.com>

	PR gold/12952
	* resolve.cc (Symbol::override_base_with_special): Simply override
	version with special symbol version, ignoring previous version.


Index: resolve.cc
===================================================================
RCS file: /cvs/src/src/gold/resolve.cc,v
retrieving revision 1.61
diff -u -p -r1.61 resolve.cc
--- resolve.cc	2 Jul 2011 05:29:59 -0000	1.61
+++ resolve.cc	6 Jul 2011 04:42:39 -0000
@@ -911,7 +911,15 @@ Symbol::override_base_with_special(const
     }
 
   if (same_name)
-    this->override_version(from->version_);
+    {
+      // When overriding a versioned symbol with a special symbol, we
+      // may be changing the version.  This will happen if we see a
+      // special symbol such as "_end" defined in a shared object with
+      // one version (from a version script), but we want to define it
+      // here with a different version (from a different version
+      // script).
+      this->version_ = from->version_;
+    }
   this->type_ = from->type_;
   this->binding_ = from->binding_;
   this->override_visibility(from->visibility_);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]