]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Fixed missed GOT relocation against a symbol that has a defined value
authorNelson Chu <nelson@rivosinc.com>
Thu, 14 Aug 2025 04:01:38 +0000 (12:01 +0800)
committerNelson Chu <nelson@rivosinc.com>
Thu, 4 Sep 2025 08:32:18 +0000 (16:32 +0800)
commitcea397848b868c62993864dbef684877bceef1fc
tree8861ccc9123ec84c6eeb93de892d859506f5f3e9
parent8b91a77eda91d4ce5a582647795032dec6899e4e
RISC-V: Fixed missed GOT relocation against a symbol that has a defined value

SImilar to aarch64, commit eac4eb8ecb26

There are two problems when GOT relocation against a symbol that has a defined
value,
1. Pesudo la with pic and pseudo lga lost the relocations.
2. %got_pcrel_hi generates R_RISCV_GOT_HI20 with addend, which is wrong since
   commit 50331d64f108.

The solution is to use deferred_expression for GOT relocation.  Maybe other
relocations also have same problem and need the deferred_expression, but we can
add in the future patches.
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/force_reloc.d [new file with mode: 0644]
gas/testsuite/gas/riscv/force_reloc.s [new file with mode: 0644]