[PATCH] x86: Add _bfd_elf_x86_copy_special_section_fields

H.J. Lu hjl.tools@gmail.com
Mon Dec 8 23:43:36 GMT 2025


When Linux/x86 objcopy is used on Solaris binary, it sets EI_OSABI to
ELFOSABI_SOLARIS, but it doesn't set the sh_info and sh_link fields of
Solaris specific sections.

Add _bfd_elf_x86_copy_special_section_fields to return false for Solaris
binary to properly set the sh_info and sh_link fields of Solaris specific
sections.

PR binutils/33705
* elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
Removed.
(elf_backend_copy_special_section_fields): Likewise.
* elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
Likewise.
(elf_backend_copy_special_section_fields): Likewise.
* elfxx-x86.c (_bfd_elf_x86_copy_special_section_fields): New.
* elfxx-x86.h (_bfd_elf_x86_copy_special_section_fields): Likewise.
(elf_backend_copy_special_section_fields): Likewise.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Add-_bfd_elf_x86_copy_special_section_fields.patch
Type: text/x-patch
Size: 8017 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251209/f3aa4225/attachment.bin>


More information about the Binutils mailing list