[RFC 0/5] glibc: Add SFrame support for stack backtracking

claudiu.zissulescu-ianculescu@oracle.com claudiu.zissulescu-ianculescu@oracle.com
Tue Mar 18 13:03:28 GMT 2025


From: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>

Hello,

I am sharing a set of patches that introduce support for decoding the
.sframe section and enable stack backtracking.

The "Simple Frame" (SFrame) stack trace format provides essential
information for performing a stack trace, including the program
counter (PC) value, canonical frame address (CFA), frame pointer (FP),
and return address (RA).

The SFrame stack backtracking is implemented alongside the existing
DWARF backtracking. Unlike the DWARF implementation, which relies on
libgcc, the SFrame implementation is directly integrated into glibc.

This series of patches is divided into three parts:

    - Adding SFrame support to _dl_find_object
    - Implementing .sframe section decoding and generic stack tracing functions
    - Architecture-specific patches for x86 and AARCH64

Thank you,
Claudiu

Claudiu Zissulescu (5):
  elf: Add SFrame support to _dl_find_object function
  elf: Add SFrame stack tracing
  configure: Add --enable-sframe option
  x86: Add SFrame support for x86 architecture
  aarch64: Add SFrame support for aarch64 architecture

 Makeconfig                                    |   8 +-
 bits/dl_find_object.h                         |   6 +
 config.make.in                                |   1 +
 configure                                     | 128 ++++
 configure.ac                                  |  43 ++
 debug/backtrace.c                             |  43 +-
 dlfcn/dlfcn.h                                 |   3 +
 elf/dl-find_object.h                          |  51 +-
 manual/dynlink.texi                           |  24 +
 sysdeps/aarch64/bits/dl_find_object.h         |  28 +
 sysdeps/generic/Makefile                      |   1 +
 sysdeps/generic/sframe-read.c                 | 577 ++++++++++++++++++
 sysdeps/generic/sframe-read.h                 | 101 +++
 sysdeps/generic/sframe.c                      | 140 +++++
 sysdeps/generic/sframe.h                      | 359 +++++++++++
 sysdeps/generic/uw-sigframe.h                 |  17 +
 sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h |  70 +++
 sysdeps/unix/sysv/linux/x86/uw-sigframe.h     |  99 +++
 sysdeps/x86/bits/dl_find_object.h             |   2 +
 19 files changed, 1691 insertions(+), 10 deletions(-)
 create mode 100644 sysdeps/aarch64/bits/dl_find_object.h
 create mode 100644 sysdeps/generic/sframe-read.c
 create mode 100644 sysdeps/generic/sframe-read.h
 create mode 100644 sysdeps/generic/sframe.c
 create mode 100644 sysdeps/generic/sframe.h
 create mode 100644 sysdeps/generic/uw-sigframe.h
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/uw-sigframe.h

-- 
2.48.1



More information about the Libc-alpha mailing list