+2017-11-23 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
+ (ppc64_elf_copy_indirect_symbol): Don't set weakref.
+ (alias_readonly_dynrelocs): Use u.alias rather than weakref.
+ (ppc64_elf_adjust_dynamic_symbol): Don't use
+ alias_readonly_dynrelocs for function symbols.
+
2017-11-23 Alan Modra <amodra@gmail.com>
* elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
/* Track dynamic relocs copied for this symbol. */
struct elf_dyn_relocs *dyn_relocs;
- /* Chain of aliases referring to a weakdef. */
- struct ppc_link_hash_entry *weakref;
-
/* Link between function code and descriptor symbols. */
struct ppc_link_hash_entry *oh;
in order to simplify readonly_dynrelocs and save a field in the
symbol hash entry, but that means dyn_relocs can't be used in any
tests about a specific symbol, or affect other symbol flags which
- are then tested.
- Chain weakdefs so we can get from the weakdef back to an alias.
- The list is circular so that we don't need to use u.weakdef as
- well as this list to look at all aliases. */
+ are then tested. */
if (eind->elf.root.type != bfd_link_hash_indirect)
- {
- struct ppc_link_hash_entry *cur, *add, *next;
-
- add = eind;
- do
- {
- cur = edir->weakref;
- if (cur != NULL)
- {
- do
- {
- /* We can be called twice for the same symbols.
- Don't make multiple loops. */
- if (cur == add)
- return;
- cur = cur->weakref;
- } while (cur != edir);
- }
- next = add->weakref;
- if (cur != add)
- {
- add->weakref = edir->weakref != NULL ? edir->weakref : edir;
- edir->weakref = add;
- }
- add = next;
- } while (add != NULL && add != eind);
- return;
- }
+ return;
/* Copy over any dynamic relocs we may have on the indirect sym. */
if (eind->dyn_relocs != NULL)
}
/* Return true if we have dynamic relocs against H or any of its weak
- aliases, that apply to read-only sections. */
+ aliases, that apply to read-only sections. Cannot be used after
+ size_dynamic_sections. */
static bfd_boolean
alias_readonly_dynrelocs (struct elf_link_hash_entry *h)
{
if (readonly_dynrelocs (&eh->elf))
return TRUE;
- eh = eh->weakref;
+ eh = (struct ppc_link_hash_entry *) eh->elf.u.alias;
} while (eh != NULL && &eh->elf != h);
return FALSE;
extra work in ld.so when resolving these symbols. */
if (global_entry_stub (h))
{
- if (!alias_readonly_dynrelocs (h))
+ if (!readonly_dynrelocs (h))
{
h->pointer_equality_needed = 0;
/* If we haven't seen a branch reloc then we don't need
return TRUE;
}
else if (!h->needs_plt
- && !alias_readonly_dynrelocs (h))
+ && !readonly_dynrelocs (h))
{
/* If we haven't seen a branch reloc then we don't need a
plt entry. */