From de2b347055d7d3f9764e7c19f3bf8913cb1b5bb9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 15 Jun 2017 04:10:58 -0700 Subject: [PATCH] ppc: Don't discard relocs on __start_SECNAME/__stop_SECNAME __start_SECNAME and __stop_SECNAME may be undefined and hidden. They will be defined by linker later. PR ld/21562 * elf32-ppc.c (allocate_dynrelocs): Don't discard relocs on __start_SECNAME and __stop_SECNAME. --- bfd/elf32-ppc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index a4814fc..92cc18b 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -6056,8 +6056,11 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) changes. */ else if (bfd_link_pic (info)) { - /* Discard relocs on undefined symbols that must be local. */ + /* Discard relocs on undefined symbols that must be local. + start_stop is set on __start_SECNAME/__stop_SECNAME which + mark section SECNAME and will be defined by linker later. */ if (h->root.type == bfd_link_hash_undefined + && !h->start_stop && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) eh->dyn_relocs = NULL; -- 2.9.4