Re: [PATCH v2] kbuild: preprocess module linker script

From: Jessica Yu
Date: Sat Sep 19 2020 - 06:26:17 EST

+++ Masahiro Yamada [08/09/20 13:27 +0900]:
There was a request to preprocess the module linker script like we
do for the vmlinux one. (

The difference between and is that the latter
is needed for external module builds, thus must be cleaned up by
'make mrproper' instead of 'make clean'. Also, it must be created
by 'make modules_prepare'.

You cannot put it in arch/$(SRCARCH)/kernel/, which is cleaned up by
'make clean'. I moved arch/$(SRCARCH)/kernel/ to
arch/$(SRCARCH)/include/asm/, which is included from

scripts/ is fine because 'make clean' keeps all the
build artifacts under scripts/.

You can add arch-specific sections in <asm/>.

Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
Tested-by: Jessica Yu <jeyu@xxxxxxxxxx>
Acked-by: Will Deacon <will@xxxxxxxxxx>

Acked-by: Jessica Yu <jeyu@xxxxxxxxxx>

Thanks for working on this!