[SFrame-V3] ld: add --no-sframe-info command line option
Add a new command line option `--no-sframe-info` to the linker. This option
allows users to prevent the linker from generating .sframe sections,
including the linker-generated (internal) SFrame sections for PLT entries.
Previously, the existing `--no-ld-generated-unwind-info` option
controlled whether (not just .eh_frame for PLT entries, but also) SFrame
for PLT entries. This change decouples SFrame from other unwind formats
(like .eh_frame), allowing for more control over the output binary's
SFrame data.
The option is added for architectures that currently support SFrame:
AArch64, s390x, and x86_64.
In a subsequent commit, we will tie this option with discard of all
input .sframe sections.
TBD:
- For aarch64, is adding to both aarch64elf.sh and aarch64linux.sh
necessary? The desired outcome is to allow the new command line for
aarch64 elf, amd64 elf, s390x elf only. Confirm.
bfd/
* elf64-s390.c (elf_s390_create_dynamic_sections): Use
no_ld_sframe_info to guard .sframe section creation.
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
include/
* bfdlink.h (struct bfd_link_info): Add no_ld_sframe_info bitfield.
ld/
* ldlex.h (enum option_values): Add OPTION_NO_LD_SFRAME_INFO.
* lexsup.c (elf_sframe_list_options): New function.
(ld_list_options): Add sframe_info argument. Update callers.
* emulparams/sframe_info.sh: New file.
* emulparams/aarch64elf.sh: Source sframe_info.sh.
* emulparams/aarch64linux.sh: Likewise.
* emulparams/elf64_s390.sh: Likewise.
* emulparams/elf_x86_64.sh: Likewise.
* Makefile.am: Update to handle sframe_info.sh and new list options.
* configure.ac: Handle SFRAME_INFO target variable.
* Makefile.in: Regenerate.
* configure: Regenerate.