[PATCH v2] efistub: Only link libstub to final vmlinux

Josh Poimboeuf jpoimboe at kernel.org
Thu Oct 16 08:49:20 PDT 2025


On Thu, Oct 16, 2025 at 04:52:20PM +0200, Ard Biesheuvel wrote:
> On Tue, 14 Oct 2025 at 18:47, Josh Poimboeuf <jpoimboe at kernel.org> wrote:
> > The idea is that libstub code doesn't belong in vmlinux.o because it's
> > not a part of the kernel proper, and doesn't need to be validated or
> > modified by objtool for any reason.
> >
> 
> I don't see a reason to change this on architectures that a) do not
> use objtool and b) link the EFI stub into vmlinux. If LoongArch wants
> to change this, that is fine, but that still does not mean it needs to
> change on other architectures too.
> 
> EFI related boot errors are a nightmare to debug, and I will be the
> one getting the reports when this regresses arm64 on hardware that 2
> people on the planet have access to.

The idea was to have more consistency, so vmlinux.o never has libstub,
regardless of arch, but that's your call.

I'd still propose we keep the KBUILD_VMLINUX_LIBS_PRELINK mechanism to
allow other arches to opt in as needed.

And that variable might even be useful for other cases (x86 startup
code?)

-- 
Josh



More information about the linux-riscv mailing list