Skip to content

Commit cbeaa41

Browse files
committed
objtool/rust: relax slice condition to cover more noreturn Rust functions
Developers are indeed hitting other of the `noreturn` slice symbols in Nova [1], thus relax the last check in the list so that we catch all of them, i.e. *_4core5slice5index22slice_index_order_fail *_4core5slice5index24slice_end_index_len_fail *_4core5slice5index26slice_start_index_len_fail *_4core5slice5index29slice_end_index_overflow_fail *_4core5slice5index31slice_start_index_overflow_fail These all exist since at least Rust 1.78.0, thus backport it too. See commit 56d680d ("objtool/rust: list `noreturn` Rust functions") for more details. Cc: [email protected] # Needed in 6.12.y and later. Cc: John Hubbard <[email protected]> Cc: Timur Tabi <[email protected]> Cc: Kane York <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Peter Zijlstra <[email protected]> Reported-by: Joel Fernandes <[email protected]> Fixes: 56d680d ("objtool/rust: list `noreturn` Rust functions") Closes: https://lore.kernel.org/rust-for-linux/20250513180757.GA1295002@joelnvbox/ [1] Tested-by: Joel Fernandes <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 1957460 commit cbeaa41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/objtool/check.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ static bool is_rust_noreturn(const struct symbol *func)
230230
str_ends_with(func->name, "_7___rustc17rust_begin_unwind") ||
231231
strstr(func->name, "_4core9panicking13assert_failed") ||
232232
strstr(func->name, "_4core9panicking11panic_const24panic_const_") ||
233-
(strstr(func->name, "_4core5slice5index24slice_") &&
233+
(strstr(func->name, "_4core5slice5index") &&
234+
strstr(func->name, "slice_") &&
234235
str_ends_with(func->name, "_fail"));
235236
}
236237

0 commit comments

Comments
 (0)