public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Clear dynstr_index when forcing symbols local
@ 2017-04-27  2:23 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2017-04-27  2:23 UTC (permalink / raw)
  To: binutils

This is really just cosmetic, but it does protect a little from
accidentally reading a stale value.

	* elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
	when force_local.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6cda710..c870cc7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-04-27  Alan Modra  <amodra@gmail.com>
 
+	* elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
+	when force_local.
+
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
 	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
 	(ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
 	(ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 73af763..59300b7 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -7295,9 +7295,10 @@ _bfd_elf_link_hash_hide_symbol (struct bfd_link_info *info,
       h->forced_local = 1;
       if (h->dynindx != -1)
 	{
-	  h->dynindx = -1;
 	  _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
 				  h->dynstr_index);
+	  h->dynindx = -1;
+	  h->dynstr_index = 0;
 	}
     }
 }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-27  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  2:23 Clear dynstr_index when forcing symbols local Alan Modra

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).