Re: [PATCH v3 1/6] rust: module: add static pointer to `{init,cleanup}_module()`

From: Gary Guo
Date: Wed Aug 07 2024 - 06:25:06 EST


On Thu, 25 Jul 2024 20:33:18 +0200
Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:

> Add the equivalent of the `___ADDRESSABLE()` annotation in the
> `module_{init,exit}` macros to the Rust `module!` macro.
>
> Without this, `objtool` would complain if enabled for Rust (under IBT
> builds), e.g.:
>
> samples/rust/rust_print.o: warning: objtool: cleanup_module(): not an indirect call target
> samples/rust/rust_print.o: warning: objtool: init_module(): not an indirect call target
>
> Tested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Tested-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/macros/module.rs | 12 ++++++++++++
> 1 file changed, 12 insertions(+)