[PATCH] elf: Keep section symbols for Solaris symbol sort sections

H.J. Lu hjl.tools@gmail.com
Thu Dec 4 01:20:12 GMT 2025


After

commit d1bcae833b32f1408485ce69f844dcd7ded093a8
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jan 7 06:42:00 2021 -0800

    ELF: Don't generate unused section symbols

x86 ELF linkers no longer generate unused section symbols.  But Solaris
symbol sort sections generated by Solaris linker use section symbols.
When objcopy removes section symbols, it corrupts Solaris symbol sort
sections.  Add section_symbol_used to bfd and set it when Solaris symbol
sort sections are used.  Keep section symbols if section_symbol_used is
set.

PR binutils/33684
* bfd-in2.h: Regenerated.
* bfd.c (bfd): Add section_symbol_used.
* elf.c (_bfd_elf_copy_private_section_data): Set
section_symbol_used if there are Solaris symbol sort sections.
* targets.c (bfd_keep_unused_section_symbols): Also return true
if section_symbol_used is set.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-elf-Keep-section-symbols-for-Solaris-symbol-sort-sec.patch
Type: text/x-patch
Size: 3655 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251204/4b39cac4/attachment.bin>


More information about the Binutils mailing list