[PATCH] s390: Emit relocation for 32-bit immediate operand

Jens Remus jremus@linux.ibm.com
Tue Nov 4 13:27:22 GMT 2025


On 11/4/2025 11:23 AM, Andreas Krebbel wrote:
> On 9/15/25 1:10 PM, Jens Remus wrote:
>> IBM Z instruction format RIL-a has a 32-bit immediate operand in
>> instruction bits 16 to 47.  Enable the assembler to emit a 32-bit
>> direct or PC-relative relocation when processing a fixup, similar
>> as it is already done for 16-bit immediate operands in bits 16-31.
>>
>> This enables to assemble the following:
>>
>>     lgfi    %r1,symbol    # R_390_32
>>     lgfi    %r1,symbol-.    # R_390_PC32
>>
>> Furthermore it brings GNU assembler on par with LLVM assembler in
>> that regard.
>>
>> gas/
>>     * config/tc-s390.c (md_apply_fix): Emit 32-bit direct or
>>     PC-relative relocation for 32-bit immediate operand in
>>     instruction bits 16-47.
>>
>> gas/testsuite/
>>     * gas/s390/zarch-reloc.d: Add tests for relocation of RIL-a
>>     32-bit immediate operand.
>>     * gas/s390/zarch-reloc.s: Likewise.
>>
>> Signed-off-by: Jens Remus <jremus@linux.ibm.com>
> 
> Ok. Thanks!

Thank you for the review!  Committed to mainline.

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com

IBM

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list