]> www.infradead.org Git - users/hch/misc.git/commit
rust: module: add static pointer to `{init,cleanup}_module()`
authorMiguel Ojeda <ojeda@kernel.org>
Thu, 25 Jul 2024 18:33:18 +0000 (20:33 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 18 Aug 2024 21:34:37 +0000 (23:34 +0200)
commit289088d54623a1a50bb3ff79f7331bbe501ea591
tree458a4cb8718b03743eca2e0342f06552d811ea7e
parent876346536c1b59a5b1b5e44477b1b3ece77647fd
rust: module: add static pointer to `{init,cleanup}_module()`

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@google.com>
Tested-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240725183325.122827-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/macros/module.rs