objtool/rust: add one more `noreturn` Rust function for Rust 1.99.0
Subsystems (3)
Miguel Ojeda
maintainerPATCH 1/1 objtool/rust: add one more `noreturn` Rust function for Rust 1.99.0
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.
--- tools/objtool/check.c | 1 + 1 file changed, 1 insertion(+)
tools/objtool/check.c +1 -0
@@ -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") ||
base-commit: 22ed4af6f0a9f55e6900b69708d3359a01d65b2d --
2.55.0
Miguel Ojeda
AppliedQuoted 17 lines · Miguel Ojeda
Starting with Rust 1.99.0 (expected 2026-10-01), under
CONFIG_RUST_DEBUG_ASSERTIONS=y,objtoolmay 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
noreturnsymbol [1]:
core::panicking::panic_null_reference_constructedThus add the mangled one to the list so that
objtoolknows it is actuallynoreturn.See commit
56d680dd23c3("objtool/rust: listnoreturnRust functions") for more details.
Quoted 8 lines
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).Cc Josh Poimboeuf <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Petr Pavlu <[email protected]>Reported-by Alice Ryhl <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>
Applied to rust-fixes -- thanks!
I changed a Link: to Closes:
Tags still welcome for a day or so.
Cheers,
Miguel
Quoted 16 lines · Miguel Ojeda
Starting with Rust 1.99.0 (expected 2026-10-01), under
CONFIG_RUST_DEBUG_ASSERTIONS=y,objtoolmay 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
noreturnsymbol [1]:
core::panicking::panic_null_reference_constructedThus add the mangled one to the list so that
objtoolknows it is actuallynoreturn.See commit
56d680dd23c3("objtool/rust: listnoreturnRust functions") for more details.
Quoted 8 lines
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).Cc Josh Poimboeuf <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Petr Pavlu <[email protected]>Reported-by Alice Ryhl <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>