Re: [PATCH v3 1/3] objtool/LoongArch: Fix fall through warning about efistub
From: Josh Poimboeuf
Date: Wed Sep 17 2025 - 18:32:35 EST
On Wed, Sep 17, 2025 at 07:27:14PM +0800, Tiezhu Yang wrote:
> When compiling with LLVM and CONFIG_LTO_CLANG is set, there exists
> the following objtool warning:
>
> vmlinux.o: warning: objtool: __efistub_efi_boot_kernel()
> falls through to next function __efistub_exit_boot_func()
>
> This is because efi_boot_kernel() doesn't end with a return instruction
> or an unconditional jump, then objtool has determined that the function
> can fall through into the next function.
>
> At the beginning, try to do something to make efi_boot_kernel() ends with
> an unconditional jump instruction, but this modification seems not proper
> and makes LoongArch different to other architectures.
>
> Furthermore, it is not proper to link efistub separately for LoongArch,
> ARM64 and RISC-V too due to there is technical reason why vmlinux.o needs
> efistub linked in.
>
> For example, there are two ways of populating the core kernel's struct
> screen_info via the stub, the latter is preferred because it makes the
> EFIFB earlycon available very early, but it only works if the EFI stub
> is part of the core kernel image itself. For more information, please
> see the comments in drivers/firmware/efi/libstub/screen_info.c.
Hm? Of course libstub needs to be linked into *vmlinux*. But that
doesn't mean it needs to be in vmlinux.o.
Why not build libstub.a separately, and then link it with vmlinux.o
during the final vmlinux link, as x86 does?
--
Josh