binutils Newspaper
NOVEMBER 30, 2026
sframe — Proposed

sframe: Fix RA and FP stack recovery rules

v2 patch corrects typos and dereferences pointers for RA and FP stack recovery rules in sframe.

This patch series updates the Stack Frame (sframe) library to fix interpreted typos and correctly implement stack recovery rules for Return Address (RA) and Frame Pointer (FP). Version 2 includes changes to the documentation (sframe-spec.texi) and corrects the interpretation of stack recovery rules by dereferencing pointers (e.g., *(CFA + offset)) instead of direct addition.

In Details

This patch modifies the sframe library, which is part of binutils and used for stack unwinding information. It corrects how the Return Address (RA) and Frame Pointer (FP) are recovered from the stack based on Call Frame Information (CFI) directives. The changes involve fixing typos in documentation and ensuring that stack offsets are dereferenced correctly when calculating the addresses of RA and FP.

For Context
sframe
A library or mechanism for managing and interpreting stack frame information, crucial for stack unwinding and debugging.
RA
Return Address, the memory address of the instruction to which the program control should return after a subroutine call.
FP
Frame Pointer, a register that points to the base of the current stack frame, used to access local variables and parameters.
CFA
Call Frame Address, a value that represents the address of the current stack frame, often used as a reference point for locating other stack variables like RA and FP.
stack recovery rules
Rules used during stack unwinding to determine the values and locations of registers (like RA and FP) from saved information on the stack.
Filed Under: sframestack unwindingCFIRAFP