diff options
author | Alan Modra <amodra@gmail.com> | 2021-03-02 21:25:20 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-03-02 21:49:56 +1030 |
commit | b80e421f9136117389be9d96210b35b3d562d725 (patch) | |
tree | 218091e1eab9d0be37a1b4bf1d7488c037a9412e /bfd | |
parent | f5b9c288a3057f0f04e74f00fdb0e79d171d54a8 (diff) | |
download | binutils-b80e421f9136117389be9d96210b35b3d562d725.zip binutils-b80e421f9136117389be9d96210b35b3d562d725.tar.gz binutils-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')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 44286c2..c4c4fa2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2021-03-02 Alan Modra <amodra@gmail.com> + PR 27451 + * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore synthesized + linker defined start/stop symbols when start_stop_gc. + +2021-03-02 Alan Modra <amodra@gmail.com> + * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimise got indirect to pc-relative or toc-relative for undefined symbols. 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 |