]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: 9443/1: Require linker to support KEEP within OVERLAY for DCE
authorNathan Chancellor <nathan@kernel.org>
Thu, 20 Mar 2025 21:33:49 +0000 (22:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:40 +0000 (14:39 +0200)
commit59fc42318305cb38efb4f5565408150419be8451
tree412c0ccd805a409c00eb294bc98c0a34a16998b1
parentc6f2a8146da1c30d947bbdddd5cd84566ed8ae5d
ARM: 9443/1: Require linker to support KEEP within OVERLAY for DCE

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 <linus.walleij@linaro.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
[nathan: Fix conflict in init/Kconfig due to lack of RUSTC symbols]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/Kconfig
arch/arm/include/asm/vmlinux.lds.h
init/Kconfig