objtool/rust: relax slice condition to cover more `noreturn` Rust functions
Subsystems (3)
Miguel Ojeda
maintainerPATCH 1/1 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 56d680dd23c3 ("objtool/rust: list noreturn Rust functions") for more details.
---
I tested it with the Timur's alex branch, but a Tested-by is appreciated. Thanks!
tools/objtool/check.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/objtool/check.c +2 -1
@@ -230,7 +230,8 @@ static bool is_rust_noreturn(const struct symbol *func)str_ends_with (func->name,"_7___rustc17rust_begin_unwind" ) ||strstr (func->name,"_4core9panicking13assert_failed" ) ||strstr (func->name,"_4core9panicking11panic_const24panic_const_" ) || - (strstr (func->name,"_4core5slice5index24slice_" ) && + (strstr (func->name,"_4core5slice5index" ) && +strstr (func->name,"slice_" ) &&str_ends_with (func->name,"_fail" )); }
base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21 --
2.49.0
Quoted 15 lines · Miguel Ojeda
Developers are indeed hitting other of the
noreturnslice 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_failThese all exist since at least Rust 1.78.0, thus backport it too.
See commit
56d680dd23c3("objtool/rust: listnoreturnRust functions") for more details.
Quoted 7 lines
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 our nova-core warnings.
thanks,
- Joel
Quoted 27 lines
Signed-off-by Miguel Ojeda <[email protected]>---
I tested it with the Timur'salexbranch, but a Tested-by is appreciated. Thanks!tools/objtool/check.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/objtool/check.c +2
-1@@ -230,7 +230,8 @@ static bool is_rust_noreturn(const struct symbol *func)str_ends_with (func->name,"_7___rustc17rust_begin_unwind" ) ||strstr (func->name,"_4core9panicking13assert_failed" ) ||strstr (func->name,"_4core9panicking11panic_const24panic_const_" ) || - (strstr (func->name,"_4core5slice5index24slice_" ) && + (strstr (func->name,"_4core5slice5index" ) && +strstr (func->name,"slice_" ) &&str_ends_with (func->name,"_fail" )); }base-commit:
a5806cd506af5a7c19bcd596e4708b5c464bfd21--
2.49.0
Miguel Ojeda
AppliedQuoted 16 lines · Miguel Ojeda
Developers are indeed hitting other of the
noreturnslice 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_failThese all exist since at least Rust 1.78.0, thus backport it too.
See commit
56d680dd23c3("objtool/rust: listnoreturnRust functions") for more details.
Quoted 9 lines
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]>Signed-off-by Miguel Ojeda <[email protected]>
Applied to rust-next early so that others can benefit on -next -- thanks everyone!
Cheers,
Miguel