* [QUESTION] How to silence objtool warnings of vmlinux.o
@ 2025-08-14 2:38 Tiezhu Yang
2025-08-14 8:36 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2025-08-14 2:38 UTC (permalink / raw)
To: Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel
When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist the
following objtool warnings after silencing all of the other warnings:
LD vmlinux.o
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
vmlinux.o: warning: objtool: kernel_entry+0x0: unreachable instruction
vmlinux.o: warning: objtool: smpboot_entry+0x0: unreachable instruction
All of the above instructions are in arch/loongarch/kernel/head.S,
and there is "OBJECT_FILES_NON_STANDARD_head.o := y" in Makefile
to skip objtool checking for head.o, but OBJECT_FILES_NON_STANDARD
does not work for link time validation of vmlinux.o according to
tools/objtool/Documentation/objtool.txt.
How to silence this kind of objtool warnings?
I appreciate any guidance here.
Thanks,
Tiezhu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [QUESTION] How to silence objtool warnings of vmlinux.o
2025-08-14 2:38 [QUESTION] How to silence objtool warnings of vmlinux.o Tiezhu Yang
@ 2025-08-14 8:36 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2025-08-14 8:36 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: Josh Poimboeuf, linux-kernel
On Thu, Aug 14, 2025 at 10:38:07AM +0800, Tiezhu Yang wrote:
> When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist the
> following objtool warnings after silencing all of the other warnings:
>
> LD vmlinux.o
> 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
> vmlinux.o: warning: objtool: kernel_entry+0x0: unreachable instruction
> vmlinux.o: warning: objtool: smpboot_entry+0x0: unreachable instruction
>
> All of the above instructions are in arch/loongarch/kernel/head.S,
> and there is "OBJECT_FILES_NON_STANDARD_head.o := y" in Makefile
> to skip objtool checking for head.o, but OBJECT_FILES_NON_STANDARD
> does not work for link time validation of vmlinux.o according to
> tools/objtool/Documentation/objtool.txt.
Correct. OBJECT_FILES_NON_STANDARD shouldn't really be used for anything
that ends up in vmlinux.o.
> How to silence this kind of objtool warnings?
> I appreciate any guidance here.
I think for x86 we just annotated it all. Specifically, those
unreachables appear to be due to non function code symbols. You need to
give them a proper UNWIND hint.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-14 8:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-14 2:38 [QUESTION] How to silence objtool warnings of vmlinux.o Tiezhu Yang
2025-08-14 8:36 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®