Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0
@ 2026-11-14  0:17 Miguel Ojeda
  0 siblings, 0 replies; only message in thread
From: Miguel Ojeda @ 2026-11-14  0:17 UTC (permalink / raw)
  To: Miguel Ojeda, Josh Poimboeuf, Peter Zijlstra
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan, rust-for-linux, stable

Starting with Rust 1.101.0 (expected 2026-12-24), `objtool` may report:

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

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

    core::panicking::unreachable_default_msg

Rust now outlines the constant messages of the panicking macros [1],
thus `unreachable!()` (i.e. without arguments) calls that new function
instead of `core::panicking::panic`, which is already in the list.

The same change introduced the equivalent `noreturn` functions for
`panic!()`, `todo!()` and `unimplemented!()`, which lead to the same
warning when those are used:

    core::panicking::panic_default_msg
    core::panicking::todo_default_msg
    core::panicking::unimplemented_default_msg

Thus add the mangled ones to the list so that `objtool` knows they are
actually `noreturn`.

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

Cc: stable@vger.kernel.org # 6.12.x (Rust is pinned in older LTSs)
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://github.com/rust-lang/rust/pull/163766 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 tools/objtool/check.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 931c5c412f15..4ef5bf97d333 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -206,9 +206,13 @@ static bool is_rust_noreturn(const struct symbol *func)
 	       str_ends_with(func->name, "_4core9panicking9panic_fmt")					||
 	       str_ends_with(func->name, "_4core9panicking14panic_explicit")				||
 	       str_ends_with(func->name, "_4core9panicking14panic_nounwind")				||
+	       str_ends_with(func->name, "_4core9panicking16todo_default_msg")				||
+	       str_ends_with(func->name, "_4core9panicking17panic_default_msg")				||
 	       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, "_4core9panicking23unreachable_default_msg")			||
+	       str_ends_with(func->name, "_4core9panicking25unimplemented_default_msg")			||
 	       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")	||

base-commit: ee83899302a0457a3ba47464a13e8682bd7ba27d
-- 
2.56.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-14  0:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14  0:17 [PATCH] objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0 Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox