[PATCH v6 0/4] sframe: Represent .cfi_undefined RA
Jens Remus
jremus@linux.ibm.com
Mon Sep 15 11:05:47 GMT 2025
Changes in V6 (see individual patch notes for further details):
- Reword patch 2 commit subject. (Indu)
- Reword binutils/NEWS and gas/NEWS. (Indu)
- Handle sframe_fre_get_fp_offset like sframe_fre_get_ra_offset and
do not return fixed FP offset if RA undefined. (Indu)
Stack tracer implementations using SFrame, such as Glibc backtrace(),
benefit from the ability to detect whether an outermost frame has been
reached, which indicates that the trace is complete. In DWARF CFI this
is indicated by an "undefined" register rule for the return address
register.
This would enable to implement s390 64-bit (s390x) support for
backtracing using SFrame in Glibc [1], which requires the stack tracer
implementation to reliably detect that an outermost frame has been
reached.
Patch 1 is a leftover form V3 that adds support for SFrame FDEs without
and FREs.
Patch 2 prevents s390x-specific CFA offset decoding to be applied on
error return values as prerequisite for patch 4.
Patch 3 adds an API to libsframe to test a FRE for RA undefined as
prerequisite for patch 4.
Patch 4 represents .cfi_undefined RA as SFrame FRE without any offsets.
RFC V4 of my related Glibc patch series is available on libc-alpha:
[RFC PATCH v4 0/3] s390x: Add support for SFrame stack backtracing,
https://inbox.sourceware.org/libc-alpha/20250725163227.2572964-1-jremus@linux.ibm.com/
Thanks and regards,
Jens
Jens Remus (4):
gas: ld: libsframe: Support for SFrame FDEs without any FREs
libsframe: s390: No further decode if sframe_get_fre_offset returns
err
include: libsframe: Add API to get RA undefined
gas: sframe: Represent .cfi_undefined RA as FRE without offsets
binutils/NEWS | 5 ++
gas/NEWS | 3 +
gas/gen-sframe.c | 79 +++++++++++++++----
gas/gen-sframe.h | 3 +
.../cfi-sframe-aarch64-ra-undefined-1.d | 20 +++++
.../cfi-sframe-aarch64-ra-undefined-1.s | 13 +++
.../cfi-sframe-s390x-ra-undefined-1.d | 21 +++++
.../cfi-sframe-s390x-ra-undefined-1.s | 11 +++
.../cfi-sframe-x86_64-ra-undefined-1.d | 22 ++++++
.../cfi-sframe-x86_64-ra-undefined-1.s | 11 +++
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp | 3 +
include/sframe-api.h | 6 ++
include/sframe.h | 1 +
libsframe/doc/sframe-spec.texi | 10 ++-
libsframe/libsframe.ver | 5 ++
libsframe/sframe-dump.c | 15 +++-
libsframe/sframe.c | 40 ++++++++--
17 files changed, 244 insertions(+), 24 deletions(-)
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.d
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.s
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.d
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.s
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.d
create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.s
--
2.48.1
More information about the Binutils
mailing list