[V2 25/36] [SFrame-V3] gas: sframe: testsuite: reject .cfi_register REG_SP, REG
Indu Bhagat
indu.bhagat@oracle.com
Thu Jan 8 08:09:00 GMT 2026
On 1/7/26 6:18 AM, Jens Remus wrote:
> On 1/7/2026 9:42 AM, Indu Bhagat wrote:
>
> Maybe change commit title as follows to align with the previous:
>
> gas: sframe: testsuite: skip SFrame FDE if .cfi_register SP, reg
>
>
> Please add a short commit message why this is the right thing to do.
> For instance:
>
> SFrame does not track the SP. For recovering of the SP SFrame relies on
> the architecture/ABI's CFA definition:
>
> CFA = SP [+ offset // on s390x]
>
> Which results in the following implicit CFA value offset rule for SP:
>
> SP = CFA [- offset // on s390x]
>
> Where offset is zero for most architectures/ABIs, except s390x.
>
> Therefore .cfi_register SP, reg directives must be rejected, as they
> cannot be represented in SFrame.
>
OK. Thanks.
>> gas/
>> * gas/gen-sframe.c (s390_sframe_xlate_do_register): Check for
>> REG_SP and reject while generating a warning.
>> (sframe_xlate_do_register): Likewise.
>> gas/testsuite/
>> * gas/cfi-sframe/cfi-sframe-s390x-err-4.d: New test.
>> * gas/cfi-sframe/cfi-sframe-s390x-err-4.s: Likewise.
>> * gas/cfi-sframe/cfi-sframe-x86_64-empty-5.d: Likewise.
>> * gas/cfi-sframe/cfi-sframe-x86_64-empty-5.s: Likewise.
>> * gas/cfi-sframe/cfi-sframe.exp: Add new tests.
>
> Reviewed-by: Jens Remus <jremus@linux.ibm.com>
>
Thanks for reviewing.
> What about rejecting .cfi_offset SP, offset directives as well? Except
> for s390x, where the SP is saved in most cases on the stack, due to the
> use of the Store Multiple (STMG) and Load Multiple (LMG) instructions
> in the prologue and epilogue.
>
OK. Have noted this down. Will address it in a separate patch once this
series is in.
> Regards,
> Jens
More information about the Binutils
mailing list