[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250917011007.4540-2-yangtiezhu@loongson.cn>
Date: Wed, 17 Sep 2025 09:10:04 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/4] objtool/LoongArch: Fix fall through warning about efi_boot_kernel()
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.
After more analysis, one simple way is to ignore these EFISTUB functions
in validate_branch() of objtool since they are useless for stack unwinder.
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
tools/objtool/check.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index d14f20ef1db1..2dcebf75d95e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3567,6 +3567,10 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
!strncmp(func->name, "__pfx_", 6))
return 0;
+ /* Ignore EFISTUB functions which are useless for stack unwinder */
+ if (!strncmp(func->name, "__efistub_", 10))
+ return 0;
+
if (file->ignore_unreachables)
return 0;
--
2.42.0
Powered by blists - more mailing lists