]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
s390: Emit relocation for 32-bit immediate operand
authorJens Remus <jremus@linux.ibm.com>
Tue, 4 Nov 2025 10:51:07 +0000 (11:51 +0100)
committerJens Remus <jremus@linux.ibm.com>
Tue, 4 Nov 2025 10:51:07 +0000 (11:51 +0100)
commitcf312b990e90c72e1fd41af1f052b130c13e78a8
tree83e51ef3f1b63d38e398a55d15810d98034a93d5
parentc38cda45dd53b3ce3f9bd1f84ca3cba75081aaee
s390: Emit relocation for 32-bit immediate operand

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>
gas/config/tc-s390.c
gas/testsuite/gas/s390/zarch-reloc.d
gas/testsuite/gas/s390/zarch-reloc.s