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]

PATCH COMMITTED: Mention symbol version if there is one


I committed this patch to gold to mention the symbol version in the
error message if there is an undefined reference to a symbol with a
specific version.

I believe that in GNU ld this would appear as symbol_name@version.

Ian


2008-04-08  Ian Lance Taylor  <iant@google.com>

	* errors.cc (Errors::undefined_symbol): Mention symbol version if
	there is one.


Index: errors.cc
===================================================================
RCS file: /cvs/src/src/gold/errors.cc,v
retrieving revision 1.5
diff -p -u -r1.5 errors.cc
--- errors.cc	13 Mar 2008 21:04:21 -0000	1.5
+++ errors.cc	9 Apr 2008 00:32:54 -0000
@@ -158,9 +158,15 @@ Errors::undefined_symbol(const Symbol* s
       return;
     ++this->error_count_;
   }
-  fprintf(stderr, _("%s: %s: undefined reference to '%s'\n"),
-	  this->program_name_, relinfo->location(relnum, reloffset).c_str(),
-	  sym->demangled_name().c_str());
+  const char* const version = sym->version();
+  if (version == NULL)
+    fprintf(stderr, _("%s: %s: undefined reference to '%s'\n"),
+	    this->program_name_, relinfo->location(relnum, reloffset).c_str(),
+	    sym->demangled_name().c_str());
+  else
+    fprintf(stderr, _("%s: %s: undefined reference to '%s', version '%s'\n"),
+	    this->program_name_, relinfo->location(relnum, reloffset).c_str(),
+	    sym->demangled_name().c_str(), version);
 }
 
 // Issue a debugging message.

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