Re: [RFC PATCH 2/2] objtool/LoongArch: Fix unreachable instruction warnings about head.S
From: Tiezhu Yang
Date: Wed Aug 27 2025 - 22:02:06 EST
On 2025/8/27 上午7:43, Josh Poimboeuf wrote:
On Tue, Aug 26, 2025 at 08:30:23PM +0800, Tiezhu Yang wrote:
On 2025/8/26 下午4:26, Huacai Chen wrote:
On Tue, Aug 26, 2025 at 2:46 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist the
following objtool warnings after silencing all of the other warnings:
...
arch/loongarch/kernel/head.S | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
index e3865e92a917..566a1dbf5fa0 100644
--- a/arch/loongarch/kernel/head.S
+++ b/arch/loongarch/kernel/head.S
@@ -20,6 +20,7 @@
__HEAD
_head:
+ UNWIND_HINT_UNDEFINED
.word IMAGE_DOS_SIGNATURE /* "MZ", MS-DOS header */
.org 0x8
.dword _kernel_entry /* Kernel entry point (physical address) */
@@ -30,6 +31,7 @@ _head:
.long pe_header - _head /* Offset to the PE header */
pe_header:
+ UNWIND_HINT_UNDEFINED
__EFI_PE_HEADER
The efi header is completely not code, the annotations are very strange.
Yes, I think so too, but the aim is only to not checking for objtool,
it seems no other better way.
Objtool is only getting confused because there's data in a text section.
Why not put that in a data section?
Thank you very much, that is to say, these EFISTUB instructions can be
ignored by objtool, I will do it.
Thanks,
Tiezhu