This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold patch committed: Adjust symbols in GNU hash table
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Wed, 30 Dec 2009 00:30:48 -0800
- Subject: gold patch committed: Adjust symbols in GNU hash table
The last elflint problem: some undefined symbols were winding up in
the GNU hash table. This patch changes the selection to 1) always add
symbols whose value is needed; 2) otherwise, don't add symbols defined
in a dynamic object or forced local. Committed to mainline.
Ian
2009-12-30 Ian Lance Taylor <iant@google.com>
PR 10450
* dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
GNU hash table if they need a dynamic value. Otherwise, don't add
them if they are defined in a dynamic object or are forced local.
Index: dynobj.cc
===================================================================
RCS file: /cvs/src/src/gold/dynobj.cc,v
retrieving revision 1.51
diff -p -u -r1.51 dynobj.cc
--- dynobj.cc 29 Dec 2009 00:31:48 -0000 1.51
+++ dynobj.cc 30 Dec 2009 08:28:17 -0000
@@ -959,9 +959,10 @@ Dynobj::create_gnu_hash_table(const std:
{
Symbol* sym = dynsyms[i];
- // FIXME: Should put on unhashed_dynsyms if the symbol is
- // hidden.
- if (sym->is_undefined())
+ if (!sym->needs_dynsym_value()
+ && (sym->is_undefined()
+ || sym->is_from_dynobj()
+ || sym->is_forced_local()))
unhashed_dynsyms.push_back(sym);
else
{