Clear dynstr_index when forcing symbols local

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.
This commit is contained in:
Alan Modra 2017-04-27 11:06:33 +09:30
parent 21d68fcd0c
commit 641338d8e9
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -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;
}
}
}