summaryrefslogtreecommitdiff
path: root/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch')
-rw-r--r--sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch b/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch
new file mode 100644
index 000000000000..5613d8ddc003
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch
@@ -0,0 +1,25 @@
+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;