This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFA: Adjust MIPS hidden symbol handling
On Thu, Apr 14, 2005 at 10:35:25PM -0400, Daniel Jacobowitz wrote:
> On Wed, Apr 13, 2005 at 07:21:16PM +0200, Thiemo Seufer wrote:
> > Daniel Jacobowitz wrote:
> > [snip]
> > > 2005-04-13 Daniel Jacobowitz <dan@codesourcery.com>
> > >
> > > * elfxx-mips.c (struct mips_got_entry): Update comment.
> > > (struct mips_elf_link_hash_entry): Remove forced_local.
> > > (mips_elf_link_hash_newfunc): Don't initialize forced_local.
> > > (mips_elf_create_local_got_entry): Check h->root.forced_local
> > > instead.
> > > (mips_elf_make_got_per_bfd): Likewise.
> > > (_bfd_mips_elf_hide_symbol): Likewise. Don't set forced_local.
> >
> > Ok.
>
> Unfortunately, not.
>
> I still think the patch is right in principle, and without it I get all
> sorts of assertion failures - but with it, I don't get enough room
> allocated for local GOT entries.
>
> What I think is happening is that without the patch, several kinds of
> hidden symbols are given unnecessary (and probably undesirable) global
> GOT entries. With it, they're given local GOT entries - but something
> else needs to be adjusted to account for it.
>
> I'm going to keep looking into this :-( I'd _like_ to fix it for 2.16,
> but 2.16 is running late already.
Nah, I was wrong. The two flags aren't quite the same: the
mips-specific flag is used for accounting when we convert a global GOT
entry to a local one. So only the assertion is wrong.
h->forced_local implies h->root.forced_local, but not the other way
around.
I'm committing this patch.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-04-19 Daniel Jacobowitz <dan@codesourcery.com>
* elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment.
(mips_elf_create_local_got_entry): Check h->root.forced_local.
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c 2005-04-19 12:36:30.830426877 -0400
+++ binutils/bfd/elfxx-mips.c 2005-04-19 12:36:58.795727677 -0400
@@ -242,7 +242,8 @@ struct mips_elf_link_hash_entry
being called returns a floating point value. */
asection *call_fp_stub;
- /* Are we forced local? .*/
+ /* Are we forced local? This will only be set if we have converted
+ the initial global GOT entry to a local GOT entry. */
bfd_boolean forced_local;
#define GOT_NORMAL 0
@@ -2463,7 +2464,7 @@ mips_elf_create_local_got_entry (bfd *ab
global entry then. It doesn't matter whether an entry is local
or global for TLS, since the dynamic linker does not
automatically relocate TLS GOT entries. */
- BFD_ASSERT (h == NULL || h->forced_local);
+ BFD_ASSERT (h == NULL || h->root.forced_local);
if (TLS_RELOC_P (r_type))
{
struct mips_got_entry *p;