[RFC] Allocate GNU property bits for frame pointer and leaf frame pointer
Florian Weimer
fweimer@redhat.com
Fri Nov 13 16:29:53 GMT 2026
* Jake Adamson:
> Just to reiterate to make sure we are on the same page. The property
> promises that throughout all executable code in the object, the
> architecture's activation-record chain register (as defined by each
> psABI e.g., x29 on AArch64, %rbp on x86-64, s0/fp on RISC-V, or r11
> under AAPCS frame-chain rules on ARM) either retains its incoming
> value from the caller or points to a valid activation record in the
> chain, then backtracers are guaranteed that walking the chain will
> never dereference a register repurposed by register allocation
> (-fomit-frame-pointer) or clobbered by assembly. At worst, an async
> sample in a frameless leaf or shrink-wrapped fast path may miss the
> immediate caller unless handled by a top-frame heuristic, while the
> rest of the chain remains intact.
Yes, I think that's an accurate summary.
> With those changes, the generic definition would shrink to a single bit
> (e.g., under a generic UINT32_AND property, or per-psABI FEATURE_1_AND
> if preferred by the list):
>
> #define GNU_PROPERTY_1_FRAME_CHAIN (1U << 0)
>
> Does framing it around an activation-record chain with each psABI
> defining the concrete register and record rules match what you had in
> mind?
Sounds good to me.
> Also, do folks have a preference between a generic UINT32_AND property
> that could be used for backtracing versus processor-specific
> FEATURE_1_AND bits, given that each psABI still needs to define the
> underlying chain layout?
I think for most ABIs, the intent is clear, so the generic approach
makes sense. IBM Z would either never set the bit, or have a
clarification that the presence of the bit indicates that the object was
built in such a way that it maintains a backchain.
Thanks,
Florian
More information about the Gnu-gabi
mailing list