x86: Restore generic copy of special section fields
Restores generic ELF section field copying for non-Solaris x86 binaries, fixing issues with secondary relocation sections.
A recent change intended to optimize x86 ELF handling inadvertently disabled the generic copying of special section fields for non-Solaris binaries. This led to incorrect sh_link and sh_info values in SHT_SECONDARY_RELOC sections. This commit reverts that optimization for non-Solaris targets, restoring the generic copying mechanism to ensure these fields are set correctly, resolving a bug in relocation processing.
In Details
This commit modifies bfd/elfxx-x86.c to fix an issue where _bfd_elf_x86_copy_special_section_fields short-circuited the call to the generic _bfd_elf_copy_special_section_fields for non-Solaris binaries. This caused SHT_SECONDARY_RELOC sections to be created with zeroed sh_link and sh_info fields. The fix ensures the generic function is called for non-Solaris ABIs, preserving correct section information.
- SHT_SECONDARY_RELOC
- A section type in the ELF format that contains relocation information for sections that are not directly addressable at runtime.
- sh_link
- A field in an ELF section header that contains a section index. Its meaning depends on the section type; for relocation sections, it typically refers to the symbol table section.
- sh_info
- A field in an ELF section header. For relocation sections, it typically indicates the section to which the relocations apply.
- Solaris ABI
- Application Binary Interface for the Solaris operating system, defining how compiled code interacts with the OS and hardware.