ld: Always output local symbol for relocatable link

Alan Modra amodra@gmail.com
Mon Nov 21 21:21:00 GMT 2022


Remove this code dating back to commit 98790d3a95fc entirely, what it
was trying to do is done elsewhere.

	PR ld/29761
	* elflink.c (elf_link_output_symstrtab): Don't handle symbols
	in SEC_EXCLUDE sections here.

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 81b34129463..a141c9eb0e8 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9995,10 +9995,7 @@ elf_link_output_symstrtab (void *finf,
   if (ELF_ST_BIND (elfsym->st_info) == STB_GNU_UNIQUE)
     elf_tdata (flinfo->output_bfd)->has_gnu_osabi |= elf_gnu_osabi_unique;
 
-  if (name == NULL
-      || *name == '\0'
-      || (!bfd_link_relocatable (flinfo->info)
-	  && (input_sec->flags & SEC_EXCLUDE)))
+  if (name == NULL || *name == '\0')
     elfsym->st_name = (unsigned long) -1;
   else
     {

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list