From https://github.com/rui314/mold/pull/590
From 68bd00caa7c7946f380f72a5dd263e7c1d436e9f Mon Sep 17 00:00:00 2001
From: Alex Fan <alex.fan.q@gmail.com>
Date: Thu, 28 Jul 2022 14:04:21 +1000
Subject: [PATCH] [ELF][RISCV] add missing R_RISCV_SET32 in EhFrameSection

Signed-off-by: Alex Fan <alex.fan.q@gmail.com>
---
 elf/arch-riscv64.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elf/arch-riscv64.cc b/elf/arch-riscv64.cc
index 8761c6ac..0c589118 100644
--- a/elf/arch-riscv64.cc
+++ b/elf/arch-riscv64.cc
@@ -183,6 +183,9 @@ void EhFrameSection<E>::apply_reloc(Context<E> &ctx, const ElfRel<E> &rel,
   case R_RISCV_SET16:
     *(ul16 *)loc = val;
     return;
+  case R_RISCV_SET32:
+    *(ul32 *)loc = val;
+    return;
   case R_RISCV_32_PCREL:
     *(ul32 *)loc = val - this->shdr.sh_addr - offset;
     return;
