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

Andreas Krebbel krebbel@linux.ibm.com
Tue Nov 4 10:23:45 GMT 2025


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!

Andreas




More information about the Binutils mailing list