[PATCH v4 0/4] sframe: Represent .cfi_undefined RA

Indu Bhagat indu.bhagat@oracle.com
Tue Jul 29 07:02:54 GMT 2025


On 7/25/25 9:35 AM, Jens Remus wrote:
> On 25.07.2025 18:23, Jens Remus wrote:
>> Changes in V4 (see individual patch notes for further details):
>> - Represent RA undefined as SFrame FRE without any offsets instead of
>>    SFrame FDE without any FREs and a RA undefined flag set. (Indu)
>> - New patches 2 and 4.
>>
>> Stack tracer implementations using SFrame, such as Glibc backtrace(),
>> benefit from the ability to detect whether an outermost frame has been
>> reached, which indicates that the trace is complete.  In DWARF CFI this
>> is indicated by an "undefined" register rule for the return address
>> register.
>>
>> This would enable to implement s390 64-bit (s390x) support for
>> backtracing using SFrame in Glibc [1], which requires the stack tracer
>> implementation to reliably detect, that an outermost frame has been
>> reached.
> 
>> I'll send a RFC V4 of my related Glibc patch series [1] next.
>>
>> [1]: [RFC PATCH v3 0/2] s390x: Add support for SFrame stack backtracing,
>>       https://inbox.sourceware.org/libc-alpha/20250723142347.2159793-1-jremus@linux.ibm.com/
> 
> I posted the new version of my related Glibc patch series as
> "[RFC PATCH v4 0/3] s390x: Add support for SFrame stack backtracing":
> https://inbox.sourceware.org/libc-alpha/20250725163227.2572964-1-jremus@linux.ibm.com/
> 

Thanks for sharing this.

Yeah, even though a stack tracer may first invoke 
sframe_fre_get_ra_undefined_p and take necessary action, I think we 
should still update the libsframe's sframe_fre_get_*_offset APIs to 
reflect the case of RA undefined clearly.  Comments on this in the 
relevant patch.


More information about the Binutils mailing list