diff options
-rw-r--r-- | rust/macros/module.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 411dc103d82e..571ffa2e189c 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -258,6 +258,12 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { #[cfg(MODULE)] #[doc(hidden)] + #[used] + #[link_section = \".init.data\"] + static __UNIQUE_ID___addressable_init_module: unsafe extern \"C\" fn() -> i32 = init_module; + + #[cfg(MODULE)] + #[doc(hidden)] #[no_mangle] pub extern \"C\" fn cleanup_module() {{ // SAFETY: @@ -269,6 +275,12 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { unsafe {{ __exit() }} }} + #[cfg(MODULE)] + #[doc(hidden)] + #[used] + #[link_section = \".exit.data\"] + static __UNIQUE_ID___addressable_cleanup_module: extern \"C\" fn() = cleanup_module; + // Built-in modules are initialized through an initcall pointer // and the identifiers need to be unique. #[cfg(not(MODULE))] |