public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: binutils@sources.redhat.com
Subject: RFA: Adjust MIPS hidden symbol handling
Date: Wed, 13 Apr 2005 17:56:00 -0000	[thread overview]
Message-ID: <20050413175620.GA32580@nevyn.them.org> (raw)

The MIPS backend currently has its own state for forced local symbols.  But
it's redundant with the common set, and the three places we check that flag
are bogus for the other sources of hidden symbols besides hide_symbol.

Fixes several assertion failures on mips64-linux using TLS, no other changes
in the binutils testsuite.  OK?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

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.

Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c	2005-04-12 16:39:56.000000000 -0400
+++ binutils/bfd/elfxx-mips.c	2005-04-13 13:38:18.360504220 -0400
@@ -61,7 +61,7 @@ struct mips_got_entry
     bfd_vma addend;
     /* If abfd != NULL && symndx == -1, the hash table entry
        corresponding to a global symbol in the got (or, local, if
-       h->forced_local).  */
+       h->root.forced_local).  */
     struct mips_elf_link_hash_entry *h;
   } d;
 
@@ -242,9 +242,6 @@ struct mips_elf_link_hash_entry
      being called returns a floating point value.  */
   asection *call_fp_stub;
 
-  /* Are we forced local?  .*/
-  bfd_boolean forced_local;
-
 #define GOT_NORMAL	0
 #define GOT_TLS_GD	1
 #define GOT_TLS_LDM	2
@@ -714,7 +711,6 @@ mips_elf_link_hash_newfunc (struct bfd_h
       ret->need_fn_stub = FALSE;
       ret->call_stub = NULL;
       ret->call_fp_stub = NULL;
-      ret->forced_local = FALSE;
       ret->tls_type = GOT_NORMAL;
     }
 
@@ -2463,7 +2459,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;
@@ -2855,7 +2851,7 @@ mips_elf_make_got_per_bfd (void **entryp
       if (entry->tls_type & GOT_TLS_IE)
 	g->tls_gotno += 1;
     }
-  else if (entry->symndx >= 0 || entry->d.h->forced_local)
+  else if (entry->symndx >= 0 || entry->d.h->root.forced_local)
     ++g->local_gotno;
   else
     ++g->global_gotno;
@@ -8356,9 +8352,8 @@ _bfd_mips_elf_hide_symbol (struct bfd_li
   struct mips_elf_link_hash_entry *h;
 
   h = (struct mips_elf_link_hash_entry *) entry;
-  if (h->forced_local)
+  if (h->root.forced_local)
     return;
-  h->forced_local = force_local;
 
   dynobj = elf_hash_table (info)->dynobj;
   if (dynobj != NULL && force_local && h->root.type != STT_TLS)

             reply	other threads:[~2005-04-13 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 17:56 Daniel Jacobowitz [this message]
2005-04-13 18:00 ` Thiemo Seufer
2005-04-15  2:35   ` Daniel Jacobowitz
2005-04-19 18:36     ` Daniel Jacobowitz
2005-04-19 18:51       ` Maciej W. Rozycki
2005-04-19 18:54         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050413175620.GA32580@nevyn.them.org \
    --to=drow@false.org \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).