]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
objtool/rust: add one more `noreturn` Rust function for Rust 1.99.0
authorMiguel Ojeda <ojeda@kernel.org>
Fri, 10 Jul 2026 17:32:52 +0000 (19:32 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Sat, 11 Jul 2026 12:20:54 +0000 (14:20 +0200)
Starting with Rust 1.99.0 (expected 2026-10-01), under
`CONFIG_RUST_DEBUG_ASSERTIONS=y`, `objtool` may report:

    rust/kernel.o: warning: objtool: _R..._6kernel12module_param9set_paramaEB4_()
    falls through to next function _R..._6kernel12module_param9set_paramhEB4_()

(and many others) due to calls to the `noreturn` symbol [1]:

    core::panicking::panic_null_reference_constructed

Thus add the mangled one to the list so that `objtool` knows it is
actually `noreturn`.

See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
for more details.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>
Link: https://github.com/rust-lang/rust/pull/158796
Reported-by: Alice Ryhl <aliceryhl@google.com>
Closes: https://lore.kernel.org/rust-for-linux/alEBInX9gD1M5NAr@google.com/
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260710173252.191781-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
tools/objtool/check.c

index 10b18cf9c360822a3fef5e4087c15785627361d4..f03dd59e7fca18f4948db55759c64b16ca6646b9 100644 (file)
@@ -206,6 +206,7 @@ static bool is_rust_noreturn(const struct symbol *func)
               str_ends_with(func->name, "_4core9panicking18panic_nounwind_fmt")                        ||
               str_ends_with(func->name, "_4core9panicking19assert_failed_inner")                       ||
               str_ends_with(func->name, "_4core9panicking30panic_null_pointer_dereference")            ||
+              str_ends_with(func->name, "_4core9panicking32panic_null_reference_constructed")          ||
               str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference")      ||
               str_ends_with(func->name, "_7___rustc17rust_begin_unwind")                               ||
               strstr(func->name, "_4core9panicking13assert_failed")                                    ||