Skip to content

Commit 6e738d6

Browse files
committed
objtool/rust: relax slice condition to cover more noreturn Rust functions
JIRA: https://issues.redhat.com/browse/RHEL-114921 commit cbeaa41 Author: Miguel Ojeda <ojeda@kernel.org> Date: Tue May 20 20:55:55 2025 +0200 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: stable@vger.kernel.org # Needed in 6.12.y and later. Cc: John Hubbard <jhubbard@nvidia.com> Cc: Timur Tabi <ttabi@nvidia.com> Cc: Kane York <kanepyork@gmail.com> Cc: Josh Poimboeuf <jpoimboe@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Reported-by: Joel Fernandes <joelagnelf@nvidia.com> Fixes: 56d680d ("objtool/rust: list `noreturn` Rust functions") Closes: https://lore.kernel.org/rust-for-linux/20250513180757.GA1295002@joelnvbox/ [1] Tested-by: Joel Fernandes <joelagnelf@nvidia.com> Link: https://lore.kernel.org/r/20250520185555.825242-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
1 parent c6b10f2 commit 6e738d6

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
@@ -231,7 +231,8 @@ static bool is_rust_noreturn(const struct symbol *func)
231231
str_ends_with(func->name, "_7___rustc17rust_begin_unwind") ||
232232
strstr(func->name, "_4core9panicking13assert_failed") ||
233233
strstr(func->name, "_4core9panicking11panic_const24panic_const_") ||
234-
(strstr(func->name, "_4core5slice5index24slice_") &&
234+
(strstr(func->name, "_4core5slice5index") &&
235+
strstr(func->name, "slice_") &&
235236
str_ends_with(func->name, "_fail"));
236237
}
237238

0 commit comments

Comments
 (0)