This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Ping Re: Patch for MIPS multi-got bug with forced-local symbols
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, binutils at sourceware dot org, rsandifo at nildram dot co dot uk
- Date: Fri, 12 Oct 2007 11:59:31 -0400
- Subject: Re: Ping Re: Patch for MIPS multi-got bug with forced-local symbols
- References: <Pine.LNX.4.64.0709191207020.26095@digraph.polyomino.org.uk> <Pine.LNX.4.64.0709261156230.24212@digraph.polyomino.org.uk> <Pine.LNX.4.64.0709282249490.7411@digraph.polyomino.org.uk> <20071006205539.GA28839@caradoc.them.org> <20071008133625.GA7117@caradoc.them.org> <874ph0gh6q.fsf@firetop.home>
On Tue, Oct 09, 2007 at 09:35:09PM +0100, Richard Sandiford wrote:
> FWIW, it looks good to me. I think the second solution is indeed how
> things are supposed to work at the moment, and if we're going to change
> the datastructures, a bigger overhaul than the first option might be
> useful...
Thanks. Here's what I have checked in.
--
Daniel Jacobowitz
CodeSourcery
2007-10-12 Daniel Jacobowitz <dan@codesourcery.com>
* elfxx-mips.c (mips_elf_sort_hash_table_f): Handle forced
local symbols specially.
(mips_elf_set_global_got_offset): Skip forced local symbols.
--- elfxx-mips.c.pre 2007-10-08 05:44:21.000000000 -0700
+++ elfxx-mips.c 2007-10-08 06:20:14.000000000 -0700
@@ -2842,7 +2842,8 @@ mips_elf_sort_hash_table_f (struct mips_
/* Global symbols that need GOT entries that are not explicitly
referenced are marked with got offset 2. Those that are
referenced get a 1, and those that don't need GOT entries get
- -1. */
+ -1. Forced local symbols may also be marked with got offset 1,
+ but are never given global GOT entries. */
if (h->root.got.offset == 2)
{
BFD_ASSERT (h->tls_type == GOT_NORMAL);
@@ -2851,7 +2852,7 @@ mips_elf_sort_hash_table_f (struct mips_
hsd->low = (struct elf_link_hash_entry *) h;
h->root.dynindx = hsd->max_unref_got_dynindx++;
}
- else if (h->root.got.offset != 1)
+ else if (h->root.got.offset != 1 || h->forced_local)
h->root.dynindx = hsd->max_non_got_dynindx++;
else
{
@@ -3459,6 +3460,7 @@ mips_elf_set_global_got_offset (void **e
if (entry->abfd != NULL && entry->symndx == -1
&& entry->d.h->root.dynindx != -1
+ && !entry->d.h->forced_local
&& entry->d.h->tls_type == GOT_NORMAL)
{
if (g)