RISC-V: Relax R_RISCV_[PCREL_]LO12_I/S to R_RISCV_GPREL_I/S for undefined weak.
authorNelson Chu <nelson@rivosinc.com>
Fri, 21 Apr 2023 08:28:38 +0000 (16:28 +0800)
committerNelson Chu <nelson@rivosinc.com>
Fri, 28 Apr 2023 06:27:32 +0000 (14:27 +0800)
commita48ddc3b572eb7fd9325867c4946f6bbb1f9b5b4
tree25eae6fd184e0946a71772e2ebec012d5b94e17c
parente4452aa670e5cec9c78b241d3572c91170598965
RISC-V: Relax R_RISCV_[PCREL_]LO12_I/S to R_RISCV_GPREL_I/S for undefined weak.

bfd/
*elfnn-riscv.c (_bfd_riscv_relax_lui): For undefined weak symbol,
just relax the R_RISCV_LO12_I/S to R_RISCV_GPREL_I/S, and then don't
update the rs1 to zero until relocate_section.
(_bfd_riscv_relax_pc): Likewise, but for R_RISCV_PCREL_LO12_I/S.
bfd/elfnn-riscv.c