From: Greg Kroah-Hartman Date: Tue, 8 Apr 2025 15:27:13 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v5.4.292~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a885de249355b6b63993eb101637b056441c975b;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: arm-9443-1-require-linker-to-support-keep-within-overlay-for-dce.patch --- diff --git a/queue-6.12/arm-9443-1-require-linker-to-support-keep-within-overlay-for-dce.patch b/queue-6.12/arm-9443-1-require-linker-to-support-keep-within-overlay-for-dce.patch new file mode 100644 index 0000000000..b79c926d1e --- /dev/null +++ b/queue-6.12/arm-9443-1-require-linker-to-support-keep-within-overlay-for-dce.patch @@ -0,0 +1,73 @@ +From 4800091d0ce47de62d584cda0c4c4eb2eedbe794 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Thu, 20 Mar 2025 22:33:49 +0100 +Subject: ARM: 9443/1: Require linker to support KEEP within OVERLAY for DCE + +From: Nathan Chancellor + +commit e7607f7d6d81af71dcc5171278aadccc94d277cd upstream. + +ld.lld prior to 21.0.0 does not support using the KEEP keyword within an +overlay description, which may be needed to avoid discarding necessary +sections within an overlay with '--gc-sections', which can be enabled +for the kernel via CONFIG_LD_DEAD_CODE_DATA_ELIMINATION. + +Disallow CONFIG_LD_DEAD_CODE_DATA_ELIMINATION without support for KEEP +within OVERLAY and introduce a macro, OVERLAY_KEEP, that can be used to +conditionally add KEEP when it is properly supported to avoid breaking +old versions of ld.lld. + +Cc: stable@vger.kernel.org +Link: https://github.com/llvm/llvm-project/commit/381599f1fe973afad3094e55ec99b1620dba7d8c +Reviewed-by: Linus Walleij +Signed-off-by: Nathan Chancellor +Signed-off-by: Russell King (Oracle) +[nathan: Fix conflict in init/Kconfig due to lack of RUSTC symbols] +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/Kconfig | 2 +- + arch/arm/include/asm/vmlinux.lds.h | 6 ++++++ + init/Kconfig | 5 +++++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -118,7 +118,7 @@ config ARM + select HAVE_KERNEL_XZ + select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M + select HAVE_KRETPROBES if HAVE_KPROBES +- select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_IS_LLD) ++ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_CAN_USE_KEEP_IN_OVERLAY) + select HAVE_MOD_ARCH_SPECIFIC + select HAVE_NMI + select HAVE_OPTPROBES if !THUMB2_KERNEL +--- a/arch/arm/include/asm/vmlinux.lds.h ++++ b/arch/arm/include/asm/vmlinux.lds.h +@@ -34,6 +34,12 @@ + #define NOCROSSREFS + #endif + ++#ifdef CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY ++#define OVERLAY_KEEP(x) KEEP(x) ++#else ++#define OVERLAY_KEEP(x) x ++#endif ++ + /* Set start/end symbol names to the LMA for the section */ + #define ARM_LMA(sym, section) \ + sym##_start = LOADADDR(section); \ +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -129,6 +129,11 @@ config CC_HAS_COUNTED_BY + # https://github.com/llvm/llvm-project/pull/112636 + depends on !(CC_IS_CLANG && CLANG_VERSION < 190103) + ++config LD_CAN_USE_KEEP_IN_OVERLAY ++ # ld.lld prior to 21.0.0 did not support KEEP within an overlay description ++ # https://github.com/llvm/llvm-project/pull/130661 ++ def_bool LD_IS_BFD || LLD_VERSION >= 210000 ++ + config PAHOLE_VERSION + int + default $(shell,$(srctree)/scripts/pahole-version.sh $(PAHOLE)) diff --git a/queue-6.12/series b/queue-6.12/series index 3efd9424a5..9aea7ee9d9 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -420,3 +420,4 @@ nfsd-fix-management-of-listener-transports.patch nfsd-nfsd_unlink-clobbers-non-zero-status-returned-from-fh_fill_pre_attrs.patch nfsd-never-return-nfs4err_file_open-when-removing-a-directory.patch nfsd-skip-sending-cb_recall_any-when-the-backchannel-isn-t-up.patch +arm-9443-1-require-linker-to-support-keep-within-overlay-for-dce.patch