[PATCH] IBM zSystems: Accept (. - 0x100000000) PCRel32 operands

Andreas Krebbel krebbel@linux.ibm.com
Tue May 3 11:17:22 GMT 2022


On 5/3/22 12:48, Ilya Leoshkevich wrote:
> as does not accept instructions like brasl %r0,.-0x100000000, because
> of two problems with the overflow check:
> 
> 1. PCRel32 operands are signed, but are treated as unsigned.
> 
> 2. The allowed range for these operands is [-(1 << 32), (1 << 32) - 1],
>    and not [-(1 << 31), (1 << 31) - 1].
> 
> Fix the first problem by setting fx_signed in the s390 backend.
> Fix the second problem by introducing fx_shift and setting it in the
> s390 backend.
> 
> gas/ChangeLog:
> 
>         * config/tc-s390.c (md_gather_operands): Set fx_signed and
> 	fx_shift for PCRel operands.
>         * write.c (fix_new_internal): Initialize fx_shift.
>         (fixup_segment): Handle fx_shift.
>         * write.h (struct fix): Add fx_shift.
>         * testsuite/gas/s390/s390.exp: Add zarch-z900-err.
>         * testsuite/gas/s390/esa-z900.d: New test.
>         * testsuite/gas/s390/esa-z900.s: New test.
>         * testsuite/gas/s390/zarch-z900-err.l: New test.
>         * testsuite/gas/s390/zarch-z900-err.s: New test.

S/390 parts are ok. Thanks!

Andreas



More information about the Binutils mailing list