The RISC-V backend had four defects, each of which alone prevented a
module from loading.
R_RISCV_RELAX, the four thread local storage types and the two
ULEB128 types had no case and failed the load. The addend of the
relocation was never applied. Relocations against a section symbol
were skipped, which left the C++ unwind tables unrelocated.
R_RISCV_PCREL_LO12_I and R_RISCV_PCREL_LO12_S used the symbol of
their own record. The psABI defines this symbol as a label on the
AUIPC instruction and the value as the low twelve bits of the value
computed by the paired R_RISCV_PCREL_HI20. Take the value from the
paired relocation and defer it if that one is not yet applied.
Close#5707.
Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>