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: Don't look up an archive map symbol twice


I spotted a dumb bug in the code which handles an archive symbol map,
which I introduced here:

2009-03-17  Ian Lance Taylor  <iant@google.com>

	* archive.cc (Archive::add_symbols): Check for a version attached
	to the symbol name in the archive map.

If a symbol has no version, which is the normal case, the code was
looking it up in the symbol table twice.  This had no effect on the
actual link, except for slowing it down.

I committed this patch to fix the problem.

Ian


2009-12-15  Ian Lance Taylor  <iant@google.com>

	* archive.cc (Archive::add_symbols): Only look up a symbol without
	a version if there is, in fact, a version.


Index: archive.cc
===================================================================
RCS file: /cvs/src/src/gold/archive.cc,v
retrieving revision 1.48
diff -p -u -r1.48 archive.cc
--- archive.cc	14 Dec 2009 19:53:04 -0000	1.48
+++ archive.cc	15 Dec 2009 22:04:49 -0000
@@ -688,6 +688,7 @@ Archive::add_symbols(Symbol_table* symta
 
 	  Symbol* sym = symtab->lookup(sym_name, ver);
 	  if (def
+	      && ver != NULL
 	      && (sym == NULL
 		  || !sym->is_undefined()
 		  || sym->binding() == elfcpp::STB_WEAK))

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