[packages/mold] upstream fix for arm32
atler
atler at pld-linux.org
Wed Jun 29 12:32:35 CEST 2022
commit 69539fe36c16e19593deb36c548ac43632857222
Author: Jan Palus <atler at pld-linux.org>
Date: Wed Jun 29 11:48:20 2022 +0200
upstream fix for arm32
arm32-reloc.patch | 25 +++++++++++++++++++++++++
mold.spec | 2 ++
2 files changed, 27 insertions(+)
---
diff --git a/mold.spec b/mold.spec
index 31fb14b..669b3db 100644
--- a/mold.spec
+++ b/mold.spec
@@ -7,6 +7,7 @@ Group: Development/Libraries
Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: f7ed6a7246e6ef945494f51e70072ad4
Patch0: atomic.patch
+Patch1: arm32-reloc.patch
URL: https://github.com/rui314/mold
%ifarch %{armv6} riscv64
BuildRequires: libatomic-devel
@@ -32,6 +33,7 @@ especially in rapid debug-edit-rebuild cycles.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%{__rm} -r third-party/{mimalloc,tbb}
diff --git a/arm32-reloc.patch b/arm32-reloc.patch
new file mode 100644
index 0000000..c7c55c0
--- /dev/null
+++ b/arm32-reloc.patch
@@ -0,0 +1,25 @@
+From 52943009b7dce4a0ebb5943092d47e6e33625401 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu at bluewhale.systems>
+Date: Sun, 19 Jun 2022 11:28:37 +0800
+Subject: [PATCH] [ELF] Handle R_ARM_MOVT_PREL and R_ARM_PREL31 as
+ non-address-taking relocations
+
+This is an attempt to fix https://github.com/rui314/mold/issues/545 though
+I don't know if this is a correct fix.
+---
+ elf/arch-arm32.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/elf/arch-arm32.cc b/elf/arch-arm32.cc
+index 65a9dede..1b94e931 100644
+--- a/elf/arch-arm32.cc
++++ b/elf/arch-arm32.cc
+@@ -427,7 +427,7 @@ void InputSection<E>::scan_relocations(Context<E> &ctx) {
+ case R_ARM_PREL31: {
+ Action table[][4] = {
+ // Absolute Local Imported data Imported code
+- { ERROR, NONE, ERROR, ERROR }, // DSO
++ { ERROR, NONE, ERROR, PLT }, // DSO
+ { ERROR, NONE, COPYREL, PLT }, // PIE
+ { NONE, NONE, COPYREL, PLT }, // PDE
+ };
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mold.git/commitdiff/b5cd69c651ba043c3b484427a03a83204ec9ab9b
More information about the pld-cvs-commit
mailing list