Skip to content

Commit 19f5ca4

Browse files
committed
objtool/rust: add one more noreturn Rust function for Rust 1.87.0
Starting with Rust 1.87.0 (expected 2025-05-15), `objtool` may report: rust/core.o: warning: objtool: _R..._4core9panicking9panic_fmt() falls through to next function _R..._4core9panicking18panic_nounwind_fmt() rust/core.o: warning: objtool: _R..._4core9panicking18panic_nounwind_fmt() falls through to next function _R..._4core9panicking5panic() The reason is that `rust_begin_unwind` is now mangled: _R..._7___rustc17rust_begin_unwind Thus add the mangled one to the list so that `objtool` knows it is actually `noreturn`. See commit 56d680d ("objtool/rust: list `noreturn` Rust functions") for more details. Alternatively, we could remove the fixed one in `noreturn.h` and relax this test to cover both, but it seems best to be strict as long as we can. 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]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 92a09c4 commit 19f5ca4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/objtool/check.c

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ static bool is_rust_noreturn(const struct symbol *func)
227227
str_ends_with(func->name, "_4core9panicking19assert_failed_inner") ||
228228
str_ends_with(func->name, "_4core9panicking30panic_null_pointer_dereference") ||
229229
str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference") ||
230+
str_ends_with(func->name, "_7___rustc17rust_begin_unwind") ||
230231
strstr(func->name, "_4core9panicking13assert_failed") ||
231232
strstr(func->name, "_4core9panicking11panic_const24panic_const_") ||
232233
(strstr(func->name, "_4core5slice5index24slice_") &&

0 commit comments

Comments
 (0)