diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-15 04:10:58 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-15 04:10:58 -0700 |
commit | de2b347055d7d3f9764e7c19f3bf8913cb1b5bb9 (patch) | |
tree | 8fbb1d10ba0a2b0c15c42b54c69c80db890b3a73 | |
parent | 1fcda1fa00cf64039c12eca99b5673f3dba312ff (diff) | |
download | binutils-gdb-users/hjl/pr21562.tar.gz |
ppc: Don't discard relocs on __start_SECNAME/__stop_SECNAMEusers/hjl/pr21562
__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.
-rw-r--r-- | bfd/elf32-ppc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index a4814fcdbb8..92cc18b465c 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; |