https://sourceware.org/bugzilla/show_bug.cgi?id=12320
--- Comment #8 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Alan Modra <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6dc01eb471ca225cff0e704924860fe1895087af commit 6dc01eb471ca225cff0e704924860fe1895087af Author: Alan Modra <[email protected]> Date: Sat Feb 21 10:56:43 2026 +1030 PR 12320 ld --as-needed links libgcc_s.so.1 unnecessarily on Solaris The Solaris 2 ABI requires some global symbols to be present as dynamic symbols. These unfortunately interact with ld --as-needed. See the comment above elf-solaris.c:elf_solaris2_add_symbol_hook, a new function added by this patch to ignore those symbol in shared libraries. PR 12320 PR 33177 bfd/ * elf-solaris2.c: New file. * elf-solaris2.h: New file. * elf32-i386.c (elf_backend_add_symbol_hook): Define for Solaris. * elf32-sparc.c (elf_backend_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_solaris2_add_symbol_hook): New. (elf_backend_add_symbol_hook): Define for Solaris. * elf64-x86-64.c (elf_x86_64_solaris2_add_symbol_hook): New. (elf_backend_add_symbol_hook): Define for Solaris. * Makefile.am (BFD32_BACKENDS): Add elf-solaris2.lo. (BFD32_BACKENDS_CFILES): Add elf-solaris2.c. * configure.ac (elfxx_x86): Add elf-solaris2.lo. (elfxx_sparc): Define and use in all sparc_elf*_vec. * po/SRC-POTFILES.in: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. ld/ * emultempl/solaris2.em (elf_solaris2_after_open): New function. (LDEMUL_AFTER_OPEN): Define. (elf_solaris_before_allocation): Delete global_syms, instead use elf_solaris2_global_syms. Ignore globals that are still bfd_link_hash_new, ie. have not been defined by a script. -- You are receiving this mail because: You are on the CC list for the bug.
