Re: [PATCH] objtool/rust: add one more `noreturn` Rust function

"Gary Guo" <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Sat Aug 15, 2026 at 3:55 PM BST, Miguel Ojeda wrote:
> On Wed, Aug 5, 2026 at 4:45 PM Miguel Ojeda <[email protected]> wrote:
>>
>> When the pointer formatting series [1] is applied and KUnit tests
>> are enabled, `objtool` would report an error with any of our
>> supported Rust versions. For instance, with Rust 1.97.1:
>
> With the version that I applied of that series, this was not strictly
> needed anymore.

I am seeing this function causing issue on my 1.85.1 -Os build, although the
error message is different this time:

rust/kernel.o: warning: objtool: _RNvXs2_NtNtCsaNryh1j6xD7_4core3str6traitseINtNtNtB9_3ops5index5IndexINtNtBJ_5range9RangeFromjEE5indexCsldbe0TGTmNx_6kernel+0x1d: stack state mismatch: cfa1=4+8 cfa2=4+16

Disassembly shows that the function call before the warning location is a call
to _4core3str16slice_error_fail, and objtool thought it can return (which will
end up with a unbalanced stack if it does return).

Applying the patch fixes the issue.

Best,
Gary
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.