]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
objtool/rust: add one more `noreturn` Rust function for Rust 1.89.0
authorMiguel Ojeda <ojeda@kernel.org>
Sat, 12 Jul 2025 16:01:02 +0000 (18:01 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 14 Jul 2025 21:09:02 +0000 (23:09 +0200)
Starting with Rust 1.89.0 (expected 2025-08-07), under
`CONFIG_RUST_DEBUG_ASSERTIONS=y`, `objtool` may report:

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

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

    core::panicking::panic_nounwind_fmt

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>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250712160103.1244945-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
tools/objtool/check.c

index f23bdda737aaa5e0a104540402d18e8861573ab9..3257eefc41ed220d5798af787422cf4b025e40b1 100644 (file)
@@ -224,6 +224,7 @@ static bool is_rust_noreturn(const struct symbol *func)
               str_ends_with(func->name, "_4core9panicking14panic_explicit")                            ||
               str_ends_with(func->name, "_4core9panicking14panic_nounwind")                            ||
               str_ends_with(func->name, "_4core9panicking18panic_bounds_check")                        ||
+              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, "_4core9panicking36panic_misaligned_pointer_dereference")      ||