[openwrt/openwrt] generic: fix broken ARM gc sections patch

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 15 15:44:07 PDT 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/71446d8052da52b2deb43349197ddcdf0373d416

commit 71446d8052da52b2deb43349197ddcdf0373d416
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Apr 15 23:21:19 2025 +0200

    generic: fix broken ARM gc sections patch
    
    Upstream version of ARM gc sections skip eeping some section. It was
    reported some kernel load hang hence restore what we original did and
    introduce a new patch that add the additional entry on top of the
    upstream version.
    
    Fixes: #18500
    Fixes: 7843f21c5120 ("generic: replace ARM gc sections patch with upstream version")
    Tested-by: Stefan Kalscheuer <stefan at stklcode.de> (Turris Omnia)
    Link: https://github.com/openwrt/openwrt/pull/18503
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...arm32-fix-boot-hang-with-HAVE_LD_DEAD_COD.patch | 79 ++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/target/linux/generic/pending-6.6/200-ARM-9404-1-arm32-fix-boot-hang-with-HAVE_LD_DEAD_COD.patch b/target/linux/generic/pending-6.6/200-ARM-9404-1-arm32-fix-boot-hang-with-HAVE_LD_DEAD_COD.patch
new file mode 100644
index 0000000000..2e5d1d9148
--- /dev/null
+++ b/target/linux/generic/pending-6.6/200-ARM-9404-1-arm32-fix-boot-hang-with-HAVE_LD_DEAD_COD.patch
@@ -0,0 +1,79 @@
+From cf3d39cfd29ab7bcbd6aa79d4a2f132817969e3d Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Tue, 15 Apr 2025 23:16:40 +0200
+Subject: [PATCH] ARM: 9404/1: arm32: fix boot hang with
+ HAVE_LD_DEAD_CODE_DATA_ELIMINATION
+
+It was reported that some SoC (mvebu based for example) hang on kernel
+loading. A variant of the feature was present in OpenWrt from long ago
+and adding the additional entry with KEEP, fix the problem.
+
+Fixes: ed0f94102251 ("ARM: 9404/1: arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION")
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ arch/arm/include/asm/vmlinux.lds.h | 10 +++++-----
+ arch/arm/kernel/vmlinux.lds.S      |  4 ++--
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/arch/arm/include/asm/vmlinux.lds.h
++++ b/arch/arm/include/asm/vmlinux.lds.h
+@@ -48,7 +48,7 @@
+ #define IDMAP_TEXT							\
+ 		ALIGN_FUNCTION();					\
+ 		__idmap_text_start = .;					\
+-		*(.idmap.text)						\
++		KEEP(*(.idmap.text))					\
+ 		__idmap_text_end = .;					\
+ 
+ #define ARM_DISCARD							\
+@@ -108,12 +108,12 @@
+ 	. = ALIGN(8);							\
+ 	.ARM.unwind_idx : {						\
+ 		__start_unwind_idx = .;					\
+-		*(.ARM.exidx*)						\
++		KEEP(*(.ARM.exidx*))					\
+ 		__stop_unwind_idx = .;					\
+ 	}								\
+ 	.ARM.unwind_tab : {						\
+ 		__start_unwind_tab = .;					\
+-		*(.ARM.extab*)						\
++		KEEP(*(.ARM.extab*))					\
+ 		__stop_unwind_tab = .;					\
+ 	}
+ 
+@@ -125,7 +125,7 @@
+ 	__vectors_lma = .;						\
+ 	OVERLAY 0xffff0000 : NOCROSSREFS AT(__vectors_lma) {		\
+ 		.vectors {						\
+-			*(.vectors)					\
++			KEEP(*(.vectors))				\
+ 		}							\
+ 		.vectors.bhb.loop8 {					\
+ 			*(.vectors.bhb.loop8)				\
+@@ -143,7 +143,7 @@
+ 									\
+ 	__stubs_lma = .;						\
+ 	.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) {		\
+-		*(.stubs)						\
++		KEEP(*(.stubs))						\
+ 	}								\
+ 	ARM_LMA(__stubs, .stubs);					\
+ 	. = __stubs_lma + SIZEOF(.stubs);				\
+--- a/arch/arm/kernel/vmlinux.lds.S
++++ b/arch/arm/kernel/vmlinux.lds.S
+@@ -104,13 +104,13 @@ SECTIONS
+ 	}
+ 	.init.tagtable : {
+ 		__tagtable_begin = .;
+-		*(.taglist.init)
++		KEEP(*(.taglist.init))
+ 		__tagtable_end = .;
+ 	}
+ #ifdef CONFIG_SMP_ON_UP
+ 	.init.smpalt : {
+ 		__smpalt_begin = .;
+-		*(.alt.smp.init)
++		KEEP(*(.alt.smp.init))
+ 		__smpalt_end = .;
+ 	}
+ #endif




More information about the lede-commits mailing list