Re: [PATCH] kbuild: preprocess module linker script

From: Kees Cook
Date: Thu Sep 10 2020 - 15:46:34 EST

On Fri, Sep 04, 2020 at 10:31:21PM +0900, Masahiro Yamada wrote:
> 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/*/kernel/ because 'make clean' descends into
> it. I moved arch/*/kernel/ to arch/*/include/asm/,
> which is included from scripts/
> 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>

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

Kees Cook