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]

Re: Ping Re: Patch for MIPS multi-got bug with forced-local symbols


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


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