Re: [PATCH v3 24/28] kbuild: Generate the noreturn list and validate modules against it

From: Nicolas Schier

Date: Thu Sep 24 2026 - 08:25:07 EST


On Mon, Sep 21, 2026 at 03:31:25PM -0700, Josh Poimboeuf wrote:
> Most of the remaining hard-coded noreturn functions are exported symbols
> which live in vmlinux.o. The objtool vmlinux.o pass can detect them
> automatically, but modules can't.
>
> Instead of hard-coding them in noreturns.h, dynamically generate the
> list in a new scripts/noreturns.builtin file, which objtool on modules
> can then read. That allows most of the remaining hard-coded noreturn
> entries to go away, including the Rust ones. Note this means that
> modules need to be linked after vmlinux.o has been built and analyzed by
> objtool.
>
> Objtool running on OOT modules will also need to read the generated
> file. Its location in scripts/ should ensure it gets installed with
> kernel build files automatically.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> ---
> Makefile | 8 +++++
> scripts/.gitignore | 1 +
> scripts/Makefile.modfinal | 15 ++++++--
> scripts/Makefile.vmlinux_o | 2 ++
> tools/objtool/Documentation/objtool.txt | 8 ++---
> tools/objtool/check.c | 46 -------------------------
> tools/objtool/noreturns.h | 17 ++-------
> 7 files changed, 29 insertions(+), 68 deletions(-)
>

Reviewed-by: Nicolas Schier <n.schier@xxxxxxxxx>

--
Nicolas