GNU Binutils Lands New "SFrame" Format Support For Simple Stack Unwinding
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.