Skip to content

Commit a889f51

Browse files
fujitaojeda
authored andcommitted
rust: module: place cleanup_module() in .exit.text section
Place cleanup_module() in .exit.text section. Currently, cleanup_module() is likely placed in the .text section. It's inconsistent with the layout of C modules, where cleanup_module() is placed in .exit.text. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Acked-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20250308044506.14458-1-fujita.tomonori@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 7480fd6 commit a889f51

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rust/macros/module.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
278278
#[cfg(MODULE)]
279279
#[doc(hidden)]
280280
#[no_mangle]
281+
#[link_section = \".exit.text\"]
281282
pub extern \"C\" fn cleanup_module() {{
282283
// SAFETY:
283284
// - This function is inaccessible to the outside due to the double

0 commit comments

Comments
 (0)