GNU Binutils Lands New "SFrame" Format Support For Simple Stack Unwinding

Written by Michael Larabel in GNU on 17 November 2022 at 09:00 AM EST. 1 Comment
GNU
Being merged this week to GNU Binutils is initial support for reading and writing to new "SFrame" sections of binaries.

SFrame is short for the Simple Frame Format and is for keeping around the minimal amount of necessary information for stack unwinding. The hope with SFrame is to allow for fast, online back-tracing using a simple unwinder.

This SFrame work for GNU Binutils was led by Indu Bhagat of Oracle. The GNU Assembler "Gas" has added a new option "--gsframe" to generate .sframe sections.
gas interprets the CFI directives to generate DWARF-based .eh_frame info. These internal DWARF structures are now consumed by gen-sframe.[ch] sub-system to, in turn, create the SFrame unwind information. These internal DWARF structures are read-only for the purpose of SFrame unwind info generation.

SFrame unwind info generation does not impact .eh_frame unwind info generation. Both .eh_frame and .sframe can co-exist in an ELF file, if so desired by the user.

Recall that SFrame unwind information only contains the minimal necessary information to generate backtraces and does not provide information to recover all callee-saved registers. The reason being that callee-saved registers other than FP are not needed for stack unwinding, and hence are not included in the .sframe section.

GNU Binutils also merged libsframe as the library for decoding the .sframe sections, inspecting .sframe sections, and related handling. Binutil's readelf and objdump have also been updated with support for reading the new SFrame sections when present and using the new "--sframe" option.

This SFrame work is currently focused on x86_64 and AArch64 targets. While this initial GNU Binutils work has been merged, the SFrame unwinder has yet to be upstreamed.


See the new SFrame commits for more details on this work for simple stack unwinding and in particular is the new SFrame spec file for those interested in the format.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week