Files
binutils-gdb/bfd
Indu Bhagat 832ca9ef67 [SFrame-V3] ld: add --discard-sframe command line option
Add a new command line option --discard-sframe to the linker.
This option allows users to prevent the linker from generating an output
.sframe section.

The rationale for this option is: Consider the case when say, the distro
is shipped with SFrame sections in the installed binaries/libraries. A
user application using these installed libraries, but not enabling
.sframe for itself just yet, will see an output .sframe corresponding to
the pulled in libraries.  This is "partial" .sframe information for the
application.  Adding such an option to the linker, gives user a way to
turn off the .sframe section completely without relying on a linker
script.

Previously, the existing --no-ld-generated-unwind-info option
controlled whether (not just .eh_frame for PLT entries, but also) SFrame
for PLT entries. The new command line option,
--discard-sframe now 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.

bfd/
	* elf-sframe.c (_bfd_elf_parse_sframe): Mark with SEC_EXCLUDE if
	--discard-sframe is in effect.
	* elf64-s390.c (elf_s390_create_dynamic_sections): Use
	discard_sframe to guard .sframe section creation.
	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
include/
	* bfdlink.h (struct bfd_link_info): Add discard_sframe 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.
	* ld.texi: Update documentation.
	* emulparams/sframe-info.sh: New file.
	* emultempl/aarch64elf.em: Add --discard-sframe option
	listing and handling.
	* 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.
ld/testsuite/
	* ld-x86-64/x86-64.exp: New test.
	* ld-x86-64/sframe-command-line-1.d: New test.
	* ld-aarch64/aarch64-elf.exp: New test.
	* ld-s390/s390.exp: New test.
	* ld-x86-64/x86-64.exp: New test.
	* ld-aarch64/sframe-command-line-1.d: New test.
	* ld-s390/sframe-command-line-1.d: New test.
	* ld-x86-64/sframe-command-line-1.d: New test.
2026-01-15 17:02:27 -08:00
..
2026-01-08 09:18:29 -07:00
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 19:30:16 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 19:30:16 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:12:26 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 19:30:16 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 13:14:22 +10:30
2026-01-04 19:30:16 +10:30
2026-01-16 00:00:06 +00:00
2025-07-13 08:57:08 +01:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BFD is an object file library.  It permits applications to use the
same routines to process object files regardless of their format.

BFD is used by the GNU debugger, assembler, linker, and the binary
utilities.

The documentation on using BFD is scanty and may be occasionally
incorrect.  Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.

There is some BFD internals documentation in doc/bfdint.texi which may
help programmers who want to modify BFD.

BFD is normally built as part of another package.  See the build
instructions for that package, probably in a README file in the
appropriate directory.

BFD supports the following configure options:

  --target=TARGET
	The default target for which to build the library.  TARGET is
	a configuration target triplet, such as sparc-sun-solaris.
  --enable-targets=TARGET,TARGET,TARGET...
	Additional targets the library should support.  To include
	support for all known targets, use --enable-targets=all.
  --enable-64-bit-bfd
	Include support for 64 bit targets.  This is automatically
	turned on if you explicitly request a 64 bit target, but not
	for --enable-targets=all.  This requires a compiler with a 64
	bit integer type, such as gcc.
  --enable-shared
	Build BFD as a shared library.
  --with-mmap
	Use mmap when accessing files.  This is faster on some hosts,
	but slower on others.  It may not work on all hosts.

Report bugs in BFD to https://sourceware.org/bugzilla/

Patches are encouraged.  When sending patches, always send the output
of diff -u or diff -c from the original file to the new file.  Do not
send default diff output.  Do not make the diff from the new file to
the original file.  Remember that any patch must not break other
systems.  Remember that BFD must support cross compilation from any
host to any target, so patches which use ``#ifdef HOST'' are not
acceptable.  Please also read the ``Reporting Bugs'' section of the
gcc manual.

Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.

Copyright (C) 2012-2026 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.