Skip to contentSkip to conversation

objtool/rust: add one more `noreturn` Rust function for Rust 1.99.0

PATCH Applied Miguel Ojeda 3 participants 3 messages Jul 10 – Jul 11

Subsystems (3)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 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
index 10b18cf9c360..f03dd59e7fca 100644
@@ -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

Applied
#1 lore raw
Quoted 17 lines · Miguel Ojeda

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.

Quoted 8 lines

Applied to rust-fixes -- thanks!

I changed a Link: to Closes:

Tags still welcome for a day or so.

Cheers,
Miguel

reviewer Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 16 lines · Miguel Ojeda

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.

Quoted 8 lines