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>
- Cc: binutils at sourceware dot org
- Date: Sat, 6 Oct 2007 16:55:39 -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>
On Fri, Sep 28, 2007 at 10:52:34PM +0000, Joseph S. Myers wrote:
> @@ -2757,8 +2764,10 @@
> referenced, we move them to the end of the GOT, so that they
> don't prevent other entries that are referenced from getting
> too large offsets. */
> - - (g->next ? g->assigned_gotno : 0);
> + - (g->next ? g->assigned_gotno : 0) - g->forced_local_count;
This definitely needs some explanation in the comment above. I can't
figure out why it's right.
> - h->root.dynindx = --hsd->min_got_dynindx;
> - hsd->low = (struct elf_link_hash_entry *) h;
> + if (h->forced_local && hsd->forced_local <= hsd->prev_forced_local)
> + h->root.dynindx = hsd->max_unref_got_dynindx++;
> + else
> + {
> + h->root.dynindx = --hsd->min_got_dynindx;
> + hsd->low = (struct elf_link_hash_entry *) h;
> + }
Here you're putting some symbols at the end of the GOT... but where's
the space for them supposed to come from in the non-multi-GOT case?
They end up not included in global_gotno, so GOT entries for
__init_array_start and __init_array_end are created at runtime in the
two words following the GOT. I suspect you can reproduce this with
any program that doesn't use multi-GOT. Just look at the size of the
GOT and compare with sizeof (void *) * (DT_SYMTABNO - DT_GOTSYM).
I will keep investigating.
--
Daniel Jacobowitz
CodeSourcery