From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 10 Sep 2020 12:45:44 -0700 From: Kees Cook Subject: Re: [PATCH] kbuild: preprocess module linker script Message-ID: <202009101245.493610D05@keescook> References: <20200904133122.133071-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904133122.133071-1-masahiroy@kernel.org> To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-ia64@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Paul Mackerras , linux-riscv@lists.infradead.org, Will Deacon , Ard Biesheuvel , Anton Ivanov , linux-arch@vger.kernel.org, Mauro Carvalho Chehab , Richard Weinberger , Russell King , Ingo Molnar , Geert Uytterhoeven , Benjamin Herrenschmidt , Fenghua Yu , Albert Ou , Arnd Bergmann , Jeff Dike , Jessica Yu , linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, Tony Luck , Paul Walmsley , linux-arm-kernel@lists.infradead.org, Michal Marek , linux-kernel@vger.kernel.org, Palmer Dabbelt , Michael Ellerman , linuxppc-dev@lists.ozlabs.org List-ID: 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 (https://lkml.org/lkml/2020/8/21/512). > > The difference between vmlinux.lds and module.lds 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/module.lds to arch/*/include/asm/module.lds.h, > which is included from scripts/module.lds.S. > > scripts/module.lds is fine because 'make clean' keeps all the build > artifacts under scripts/. > > You can add arch-specific sections in . > > Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook -- Kees Cook