[PATCH v5 2/4] libsframe: Support for SFrame FREs without any offsets

Indu Bhagat indu.bhagat@oracle.com
Wed Jul 30 08:09:16 GMT 2025


On 7/29/25 8:16 AM, Jens Remus wrote:
> SFrame FREs without any offsets will later be used to represent
> .cfi_undefined RA in SFrame.
> 
> As a result the API to get the CFA offset can return an error value, if
> there are no offsets.  Do not apply the s390x-specific decoding of CFA
> offset on the error return value.
> 
> libsframe/
> 	* sframe.c (sframe_fre_get_cfa_offset): Do not apply s390x-
> 	specific decoding to error return value.
> 
> Signed-off-by: Jens Remus <jremus@linux.ibm.com>

I find the commit title stale. I would say something along the lines of:

libsframe: s390x: no further decode if sframe_get_fre_offset returns err

Other than that, LGTM.  Thanks!

Reviewed-by: Indu Bhagat <indu.bhagat@oracle.com>

> ---
> 
> Notes (jremus):
>      Changes in V5:
>      - New patch.  Do not alter sframe_fre_get_cfa_offset error return value.
>        (Indu)
> 
>   libsframe/sframe.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libsframe/sframe.c b/libsframe/sframe.c
> index 678b42feddc0..2bd9da573f00 100644
> --- a/libsframe/sframe.c
> +++ b/libsframe/sframe.c
> @@ -698,12 +698,15 @@ int32_t
>   sframe_fre_get_cfa_offset (sframe_decoder_ctx *dctx,
>   			   sframe_frame_row_entry *fre, int *errp)
>   {
> -  int32_t offset = sframe_get_fre_offset (fre, SFRAME_FRE_CFA_OFFSET_IDX, errp);
> +  int err;
> +  int32_t offset = sframe_get_fre_offset (fre, SFRAME_FRE_CFA_OFFSET_IDX, &err);
>   
>     /* For s390x undo adjustment of CFA offset (to enable 8-bit offsets).  */
> -  if (sframe_decoder_get_abi_arch (dctx) == SFRAME_ABI_S390X_ENDIAN_BIG)
> +  if (!err && sframe_decoder_get_abi_arch (dctx) == SFRAME_ABI_S390X_ENDIAN_BIG)
>       offset = SFRAME_V2_S390X_CFA_OFFSET_DECODE (offset);
>   
> +  if (errp)
> +    *errp = err;
>     return offset;
>   }
>   



More information about the Binutils mailing list