[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250901072156.31361-3-yangtiezhu@loongson.cn>
Date: Mon, 1 Sep 2025 15:21:55 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>
Cc: loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH v1 2/3] objtool/LoongArch: Fix unreachable instruction warnings about EFISTUB
When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist the
following objtool warnings:
vmlinux.o: warning: objtool: .head.text+0x0: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x18: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x38: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x3c: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x40: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x44: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x54: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x58: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x6c: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x84: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x94: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x9c: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0xc4: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0xf8: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0xfc: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x104: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x10c: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x11c: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x120: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x124: unreachable instruction
vmlinux.o: warning: objtool: .head.text+0x144: unreachable instruction
The instructions in the .head.text section are related with EFISTUB,
they are image header and can be ignored by objtool, so just check the
section name in ignore_unreachable_insn() to ignore it.
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 2dcebf75d95e..b7397b0f9f79 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4039,6 +4039,10 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio
!strcmp(insn->sec->name, ".altinstr_aux"))
return true;
+ /* Ignore EFISTUB instructions usually in the .head.text section. */
+ if (!strcmp(insn->sec->name, ".head.text"))
+ return true;
+
/*
* Whole archive runs might encounter dead code from weak symbols.
* This is where the linker will have dropped the weak symbol in
--
2.42.0
Powered by blists - more mailing lists