aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-03-02 21:25:20 +1030
committerAlan Modra <amodra@gmail.com>2021-03-02 21:49:56 +1030
commitb80e421f9136117389be9d96210b35b3d562d725 (patch)
tree218091e1eab9d0be37a1b4bf1d7488c037a9412e /bfd/elf64-ppc.c
parentf5b9c288a3057f0f04e74f00fdb0e79d171d54a8 (diff)
downloadfsf-binutils-gdb-b80e421f9136117389be9d96210b35b3d562d725.zip
fsf-binutils-gdb-b80e421f9136117389be9d96210b35b3d562d725.tar.gz
fsf-binutils-gdb-b80e421f9136117389be9d96210b35b3d562d725.tar.bz2
PR27451, -z start_stop_gc for powerpc64
PowerPC64 has its own gc_mark_dynamic_ref. bfd/ PR 27451 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore synthesized linker defined start/stop symbols when start_stop_gc. ld/ * testsuite/ld-powerpc/startstop.d, * testsuite/ld-powerpc/startstop.r, * testsuite/ld-powerpc/startstop.s: New test. * testsuite/ld-powerpc/powerpc.exp: Run it.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 769fff9..ab0e0d3 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5749,6 +5749,9 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
if ((eh->elf.root.type == bfd_link_hash_defined
|| eh->elf.root.type == bfd_link_hash_defweak)
+ && (!eh->elf.start_stop
+ || eh->elf.root.ldscript_def
+ || !info->start_stop_gc)
&& ((eh->elf.ref_dynamic && !eh->elf.forced_local)
|| ((eh->elf.def_regular || ELF_COMMON_DEF_P (&eh->elf))
&& ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL