PR27451, -z start_stop_gc for powerpc64

Alan Modra amodra@gmail.com
Tue Mar 2 11:09:56 GMT 2021


PowerPC64 has its own gc_mark_dynamic_ref.

	PR 27451
	* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore synthesized
	linker defined start/stop symbols when start_stop_gc.

diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index dcd427b383..8a32fa47f7 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

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list