[RFC 00/28] SFrame V3 patchset

Indu Bhagat indu.bhagat@oracle.com
Tue Dec 9 09:07:25 GMT 2025
Hi,

Here is the patchset for SFrame V3.  This addresses the feature set
listed on the wiki
(https://sourceware.org/binutils/wiki/sframe/sframev3todo), except the
following item:

  Add support for AArch64 DW_negate_ra_state_with_pc
  https://sourceware.org/binutils/wiki/sframe/sframev3todo#AArch64_DW_negate_ra_state_with_pc

There are some rough edges in the patchset currently.  Hence an RFC.
  - some noted in the TBD/FIXME in relevant patches.
  - Testing is ongoing.
  - SFrame specification changes are pending.
But in interest of time and upcoming December time off for many of the
reviewers/maintainers, I am sending the set as RFC to get inputs.

These patches apply on the V2 of the preparatory patchset sent before
this series
(https://inbox.sourceware.org/binutils/20251209085925.3709848-1-indu.bhagat@oracle.com/).
The "SFrame V3 patchset" was created with git --format-patch --no-binary for review
purposes.

For ease of review and testing, the complete set is available at branch:
users/ibhagat/sframe-v3-c1.

Thanks,
Indu Bhagat (28):
  [SFrame-V3] readelf: testsuite: sframe: add new SFrame V2 test
  [SFrame-V3] libsframe: testsuite: add a new test for SFrame V2
  [SFrame-V3] libsframe: remove old sframe_decoder_get_funcdesc API
  [SFrame-V3] sframe: use const for sframe_decoder_ctx object arg
  [SFrame-V3] sframe: gas: bfd: ld: format bump to version 3
  [SFrame-V3] libsframe: bump so version to libsframe.so.3.0.0
  [SFrame-V3] libsframe: add V3 APIs for adding and getting SFrame FDE
  [SFrame-V3] sframe: gas: libsframe: use uint16_t for num_fres of FDE
  [SFrame-V3] sframe: gas: libsframe: remove padding field from FDE
  [SFrame-V3] include: libsframe: bfd: gas: testsuite: support for
    signed 64-bit offset in SFrame FDE
  [SFrame-V3] sframe: gas: bfd: add support for signal frames
  [SFrame-V3] gas: sframe: allow SFrame FDEs with 0 FREs for signal
    frames
  [SFrame-V3] include: sframe: s390x: keep unused bits when possible
  [SFrame-V3] include: gas: libsframe: add 8-bits of func_info2 for
    extensibility in FDE
  [SFrame-V3] include: sframe: reserve 4 bits for new FDE types
  [SFrame-V3] gas: sframe: output new FDE type
    SFRAME_FDE_TYPE_FLEX_TOPMOST_FRAME
  [SFrame-V3] libsframe: testsuite: add new argument to offset access
    APIs
  [SFrame-V3] libsframe: textual dump of fde type
    SFRAME_FDE_TYPE_FLEX_TOPMOST_FRAME
  [SFrame-V3] sframe: gas: translate specific CFI directives for
    SFRAME_FDE_TYPE_FLEX_TOPMOST_FRAME
  [SFrame-V3] gas: x86: testsuite: add new testcases for
    SFRAME_FDE_TYPE_FLEX_TOPMOST_FRAME
  [SFrame-V3] gas: sframe: add handling for .cfi_register for FP and RA
  [SFrame-V3] bfd: ld: sframe: avoid unnecessary decoding of SFrame FREs
    at link time
  [SFrame-V3] include: gas: libsframe: split FDE into desc and attr
  [SFrame-V3] gas: sframe: doc: testsuite: add new command line option
    --gsframe-3
  [SFrame-V3] ld: add --no-sframe-info command line option
  [SFrame-V3] ld: discard sframe sections when --no-sframe-info
  [SFrame-V3] ld: testsuite: x86: sframe: check link of signal frame and
    outermost frames
  [SFrame-V3] Revert "gas: sframe: testsuite: add testcase for
    .cfi_register RA"

 bfd/elf-sframe.c                              |  65 +-
 bfd/elf64-s390.c                              |  12 +-
 bfd/elfxx-x86.c                               |  16 +-
 .../binutils-all/x86-64/objdump-sframe-01.d   |   2 +-
 .../binutils-all/x86-64/readelf-sframe-01.d   |   2 +-
 .../testsuite/binutils-all/x86-64/sframe.exp  |  51 ++
 .../x86-64/test-v2-ET_EXEC.sframe.bz2         | Bin 0 -> 3347 bytes
 .../x86-64/test-v2-ET_EXEC.sframe.dump        |  60 ++
 .../x86-64/test-v2-ET_REL.sframe.bz2          | Bin 0 -> 727 bytes
 .../x86-64/test-v2-ET_REL.sframe.dump         |  24 +
 gas/as.c                                      |  15 +-
 gas/as.h                                      |   7 +
 gas/doc/as.texi                               |   7 +-
 gas/gen-sframe.c                              | 546 ++++++++++---
 gas/gen-sframe.h                              |  20 +-
 gas/sframe-opt.c                              |   3 +
 .../gas/cfi-sframe/cfi-sframe-aarch64-1.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-2.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-3.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-4.d     |   2 +-
 .../cfi-sframe-aarch64-pac-ab-key-1.d         |   2 +-
 .../cfi-sframe-aarch64-ra-undefined-1.d       |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-1.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-10.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-11.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-12.d     |   2 +-
 ...86_64-empty-5.d => cfi-sframe-common-13.d} |  12 +-
 .../gas/cfi-sframe/cfi-sframe-common-13.s     |   3 +
 .../gas/cfi-sframe/cfi-sframe-common-1d.d     |  13 +
 .../gas/cfi-sframe/cfi-sframe-common-1d.s     |   3 +
 .../gas/cfi-sframe/cfi-sframe-common-2.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-3.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-4.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-5.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-6.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-7.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-8.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-9.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-1.d       |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-2.d       |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-3.d       |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-err-1.d   |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-err-2.d   |   2 +-
 .../gas/cfi-sframe/cfi-sframe-s390x-err-3.d   |   2 +-
 .../cfi-sframe-s390x-fpra-offset-1.d          |   2 +-
 .../cfi-sframe-s390x-fpra-offset-2.d          |   2 +-
 .../cfi-sframe-s390x-fpra-register-1.d        |   2 +-
 .../cfi-sframe-s390x-fpra-register-2.d        |   2 +-
 .../cfi-sframe-s390x-ra-undefined-1.d         |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-1.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-2.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-3.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-4.d      |  26 +
 .../gas/cfi-sframe/cfi-sframe-x86_64-4.s      |  43 ++
 .../gas/cfi-sframe/cfi-sframe-x86_64-5.d      |  29 +
 .../gas/cfi-sframe/cfi-sframe-x86_64-5.s      |  80 ++
 .../gas/cfi-sframe/cfi-sframe-x86_64-6.d      |  21 +
 .../gas/cfi-sframe/cfi-sframe-x86_64-6.s      |  13 +
 .../cfi-sframe/cfi-sframe-x86_64-empty-1.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-2.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-3.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-4.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-5.s    |  11 -
 .../cfi-sframe-x86_64-empty-pr33277.d         |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-pr33170.d    |   2 +-
 .../cfi-sframe-x86_64-ra-undefined-1.d        |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-signal-1.d   |  18 +
 .../cfi-sframe/cfi-sframe-x86_64-signal-1.s   |  12 +
 gas/testsuite/gas/cfi-sframe/cfi-sframe.exp   |   7 +-
 gas/testsuite/gas/cfi-sframe/common-empty-1.d |   2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-2.d |   2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-3.d |   2 +-
 .../gas/scfi/x86_64/scfi-cfi-sections-1.d     |   2 +-
 .../gas/scfi/x86_64/scfi-dyn-stack-1.d        |   2 +-
 include/bfdlink.h                             |   4 +
 include/sframe-api.h                          | 111 ++-
 include/sframe.h                              | 105 ++-
 ld/Makefile.am                                |   3 +-
 ld/Makefile.in                                |   4 +-
 ld/configure                                  |  11 +-
 ld/configure.ac                               |   6 +
 ld/emulparams/aarch64elf.sh                   |   1 +
 ld/emulparams/aarch64linux.sh                 |   1 +
 ld/emulparams/elf64_s390.sh                   |   1 +
 ld/emulparams/elf_x86_64.sh                   |   1 +
 ld/emulparams/sframe_info.sh                  |  15 +
 ld/ldlex.h                                    |   2 +
 ld/lexsup.c                                   |  15 +-
 ld/testsuite/ld-aarch64/sframe-simple-1.d     |   2 +-
 ld/testsuite/ld-s390/sframe-plt-1.d           |   2 +-
 ld/testsuite/ld-s390/sframe-simple-1.d        |   2 +-
 .../ld-x86-64/sframe-command-line-1.d         |   8 +
 ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d     |   2 +-
 ld/testsuite/ld-x86-64/sframe-link-1.d        |  38 +
 ld/testsuite/ld-x86-64/sframe-plt-1.d         |   2 +-
 ld/testsuite/ld-x86-64/sframe-pltgot-1.d      |   2 +-
 ld/testsuite/ld-x86-64/sframe-pltgot-2.d      |   2 +-
 ld/testsuite/ld-x86-64/sframe-reloc-1.d       |   2 +-
 ld/testsuite/ld-x86-64/sframe-signal.s        |  14 +
 ld/testsuite/ld-x86-64/sframe-simple-1.d      |   2 +-
 ld/testsuite/ld-x86-64/sframe-start.s         |  11 +
 ld/testsuite/ld-x86-64/x86-64.exp             |   2 +
 libsframe/Makefile.in                         |  34 +
 libsframe/libsframe.ver                       |  14 +-
 libsframe/libtool-version                     |   2 +-
 libsframe/sframe-dump.c                       | 418 ++++++++--
 libsframe/sframe.c                            | 728 ++++++++++++++----
 libsframe/testsuite/libsframe.decode/DATA-V2  | Bin 0 -> 98 bytes
 libsframe/testsuite/libsframe.decode/DATA2    | Bin 98 -> 100 bytes
 .../testsuite/libsframe.decode/decode.exp     |   6 +
 .../testsuite/libsframe.decode/frecnt-v2.c    |  90 +++
 libsframe/testsuite/libsframe.decode/local.mk |   6 +-
 .../testsuite/libsframe.encode/encode-1.c     |  26 +-
 .../testsuite/libsframe.find/findfre-1.c      |  48 +-
 .../testsuite/libsframe.find/findfunc-1.c     |  56 +-
 .../testsuite/libsframe.find/plt-findfre-1.c  |  33 +-
 .../testsuite/libsframe.find/plt-findfre-2.c  |  38 +-
 117 files changed, 2491 insertions(+), 588 deletions(-)
 create mode 100644 binutils/testsuite/binutils-all/x86-64/sframe.exp
 create mode 100644 binutils/testsuite/binutils-all/x86-64/test-v2-ET_EXEC.sframe.bz2
 create mode 100644 binutils/testsuite/binutils-all/x86-64/test-v2-ET_EXEC.sframe.dump
 create mode 100644 binutils/testsuite/binutils-all/x86-64/test-v2-ET_REL.sframe.bz2
 create mode 100644 binutils/testsuite/binutils-all/x86-64/test-v2-ET_REL.sframe.dump
 rename gas/testsuite/gas/cfi-sframe/{cfi-sframe-x86_64-empty-5.d => cfi-sframe-common-13.d} (53%)
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-13.s
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1d.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1d.s
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-4.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-4.s
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-5.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-5.s
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-6.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-6.s
 delete mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-5.s
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-signal-1.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-signal-1.s
 create mode 100644 ld/emulparams/sframe_info.sh
 create mode 100644 ld/testsuite/ld-x86-64/sframe-command-line-1.d
 create mode 100644 ld/testsuite/ld-x86-64/sframe-link-1.d
 create mode 100644 ld/testsuite/ld-x86-64/sframe-signal.s
 create mode 100644 ld/testsuite/ld-x86-64/sframe-start.s
 create mode 100644 libsframe/testsuite/libsframe.decode/DATA-V2
 create mode 100644 libsframe/testsuite/libsframe.decode/frecnt-v2.c

-- 
2.43.0



More information about the Binutils mailing list