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: Avoid crashing if a shared library is missing a version


While debugging an unrelated problem, I noticed that gold crashes
after giving an error about a symbol with an undefined version when
creating a shared library.  I committed this patch to avoid the crash
by creating the version.

Ian


2008-07-17  Ian Lance Taylor  <iant@google.com>

	* dynobj.cc (Versions::add_def): If we give an error about a
	missing version, go ahead and create the version anyhow.


Index: dynobj.cc
===================================================================
RCS file: /cvs/src/src/gold/dynobj.cc,v
retrieving revision 1.38
diff -p -u -r1.38 dynobj.cc
--- dynobj.cc	19 Apr 2008 18:30:58 -0000	1.38
+++ dynobj.cc	18 Jul 2008 06:51:13 -0000
@@ -1388,11 +1388,8 @@ Versions::add_def(const Symbol* sym, con
       // find a definition of a symbol with a version which is not
       // in the version script.
       if (parameters->options().shared())
-	{
-	  gold_error(_("symbol %s has undefined version %s"),
-		     sym->demangled_name().c_str(), version);
-	  return;
-	}
+	gold_error(_("symbol %s has undefined version %s"),
+		   sym->demangled_name().c_str(), version);
 
       // When creating a regular executable, automatically define
       // a new version.

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