diff options
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 9 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fc7a1b8..293fd99 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2021-05-03 Alan Modra <amodra@gmail.com> + * elf32-ppc.c (allocate_dynrelocs): Call ensure_undef_dynamic for + weak undefined symols that only appear on PLT relocs. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + +2021-05-03 Alan Modra <amodra@gmail.com> + PR 27755 * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 830c920..ff618e4 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -5296,9 +5296,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) for (ent = h->plt.plist; ent != NULL; ent = ent->next) if (ent->plt.refcount > 0) { - asection *s = htab->elf.splt; - bool dyn = !use_local_plt (info, h); + asection *s; + bool dyn; + if (!ensure_undef_dynamic (info, h)) + return false; + + dyn = !use_local_plt (info, h); + s = htab->elf.splt; if (!dyn) { if (h->type == STT_GNU_IFUNC) diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index ed72de2..bc960bf 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -9855,6 +9855,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) for (pent = h->plt.plist; pent != NULL; pent = pent->next) if (pent->plt.refcount > 0) { + if (!ensure_undef_dynamic (info, h)) + return false; + if (use_local_plt (info, h)) { if (h->type == STT_GNU_IFUNC) |