mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [QUESTION] How to silence objtool warnings of vmlinux.o
Date: Thu, 14 Aug 2025 10:36:51 +0200	[thread overview]
Message-ID: <20250814083651.GR4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <8737f2ed-3f4a-3cab-1dd1-55ad50f951e6@loongson.cn>

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.


      reply	other threads:[~2025-08-14  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  2:38 Tiezhu Yang
2025-08-14  8:36 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250814083651.GR4067720@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®