Skip to content

Commit 3be0825

Browse files
ojedajfvogel
authored andcommitted
objtool/rust: add one more noreturn Rust function
commit cee6f9a upstream. Starting with Rust 1.85.0 (currently in beta, to be released 2025-02-20), under some kernel configurations with `CONFIG_RUST_DEBUG_ASSERTIONS=y`, one may trigger a new `objtool` warning: rust/kernel.o: warning: objtool: _R...securityNtB2_11SecurityCtx8as_bytes() falls through to next function _R...core3ops4drop4Drop4drop() due to a call to the `noreturn` symbol: core::panicking::assert_failed::<usize, usize> Thus add it to the list so that `objtool` knows it is actually `noreturn`. Do so matching with `strstr` since it is a generic. See commit 56d680d ("objtool/rust: list `noreturn` Rust functions") for more details. Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs). Fixes: 56d680d ("objtool/rust: list `noreturn` Rust functions") Reviewed-by: Gary Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Updated Cc: stable@ to include 6.13.y. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 4166ac7653402bdbfee6b01ffb95896f05a40ab9) Signed-off-by: Jack Vogel <[email protected]>
1 parent 5bf698e commit 3be0825

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static bool is_rust_noreturn(const struct symbol *func)
218218
str_ends_with(func->name, "_4core9panicking18panic_bounds_check") ||
219219
str_ends_with(func->name, "_4core9panicking19assert_failed_inner") ||
220220
str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference") ||
221+
strstr(func->name, "_4core9panicking13assert_failed") ||
221222
strstr(func->name, "_4core9panicking11panic_const24panic_const_") ||
222223
(strstr(func->name, "_4core5slice5index24slice_") &&
223224
str_ends_with(func->name, "_fail"));

0 commit comments

Comments
 (0)