]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Fix BFD_RELOC_RISCV_PCREL_LO12_S patch issue
authorSun Sunny <sunny.sun@corelabtech.com>
Thu, 4 Jul 2024 03:03:37 +0000 (03:03 +0000)
committerNelson Chu <nelson@rivosinc.com>
Thu, 4 Jul 2024 13:36:48 +0000 (21:36 +0800)
commitc83ea305e21e1363b62747984c1b7286cb7a2ca8
treed7cd6d25dcbe5f61ae8644bc22140a995d682101
parentf9d218de5c7b2eeeca9b32c9222a63c7376a8ddd
RISC-V: Fix BFD_RELOC_RISCV_PCREL_LO12_S patch issue

In commit dff565fcca8137954d6ad571ef39f6aec5c0429c, the fixups
for PCREL_LO12_I and PCREL_LO12_S were mixed, so the "IMM"
field were applied to incorrect position, this caused incorrect
src registers to be encoded.

gas/
* config/tc-riscv.c (md_apply_fix): Fix PCREL_LO12_S issue.
* testsuite/gas/riscv/ixup-local.s: Updated for PCREL_LO12_S cases.
* testsuite/gas/riscv/fixup-local-relax.d: Likewise.
* testsuite/gas/riscv/fixup-local-norelax.d: Likewise.

Signed-off-by: Jianwei Sun <sunny.sun@corelabtech.com>
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/fixup-local-norelax.d
gas/testsuite/gas/riscv/fixup-local-relax.d
gas/testsuite/gas/riscv/fixup-local.s