[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <pgzg3tdudow4ww3tnqdvmppufbpbf6ws5adjjcwc7g3ou7yoih@mzk7iwh7trbe>
Date: Mon, 24 Nov 2025 17:49:30 -0800
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc: Huacai Chen <chenhuacai@...nel.org>, Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>, Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
"Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>, Ard Biesheuvel <ardb@...nel.org>, loongarch@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-riscv@...ts.infradead.org, linux-efi@...r.kernel.org,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH v2] efistub: Only link libstub to final vmlinux
On Sun, Nov 23, 2025 at 11:37:14AM +0800, Tiezhu Yang wrote:
> On 11/23/25 10:29, Huacai Chen wrote:
> > Is it possible to improve objtool that can handle indirect __noreturn functions?
Someday that will be possible via a new compiler feature or plugin. But
today it can't be done.
> > Is it possible to improve objtool that can handle
> > OBJECT_FILES_NON_STANDARD event LTO is enabled?
No, that is purely a makefile construct which should in general be
avoided anyway for a variety of reasons.
> > Is it possible to improve objtool that only ignore __efistub prefix
> > for LoongArch?
> [...]
> static int validate_branch()
> {
> ...
> if (arch_is_efistub(func))
> return 0;
>
> if (file->ignore_unreachables)
> return 0;
>
> WARN("%s() falls through to next function %s()",
> func->name, insn_func(insn)->name);
> func->warned = 1;
>
> return 1;
> ...
> }
That only silences the warning, it doesn't prevent objtool from doing
the actual stack validation or ORC generation. Neither of which makes
sense for libstub.
And objtool has many other features beyond just stack validation and
ORC. None of those make sense for libstub either.
To fully exclude all libstub code from objtool, these arch_is_efistub()
checks would need to be sprinkled all over the place.
That would be a lot more fragile than just excluding libstub from
vmlinux.o in the first place.
--
Josh
Powered by blists - more mailing lists