From: Boqun Feng <boqun.feng@gmail.com>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: ojeda@kernel.org, alex.gaynor@gmail.com,
rust-for-linux@vger.kernel.org, gary@garyguo.net,
bjorn3_gh@protonmail.com, benno.lossin@proton.me,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu
Subject: Re: [PATCH v1] rust: module: place cleanup_module() in .exit.text section
Date: Fri, 7 Mar 2025 21:32:31 -0800 [thread overview]
Message-ID: <Z8vWbxp7BS3fKd5f@Mac.home> (raw)
In-Reply-To: <20250308044506.14458-1-fujita.tomonori@gmail.com>
On Sat, Mar 08, 2025 at 01:45:06PM +0900, FUJITA Tomonori wrote:
> Place cleanup_module() in .exit.text section. Currently,
> cleanup_module() is likely placed in the .text section. It's
Do you mind compiling a module and using readelf or other tools to show
which section the symbol cleanup_module() is? Putting that information
in the changelog would be nice, and it also shows the actual effect of
your patch. Thanks!
Regards,
Boqun
> inconsistent with the layout of C modules, where cleanup_module() is
> placed in .exit.text.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> ---
> rust/macros/module.rs | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/rust/macros/module.rs b/rust/macros/module.rs
> index cdf94f4982df..36daa149a691 100644
> --- a/rust/macros/module.rs
> +++ b/rust/macros/module.rs
> @@ -275,6 +275,7 @@ mod __module_init {{
> #[cfg(MODULE)]
> #[doc(hidden)]
> #[no_mangle]
> + #[link_section = \".exit.text\"]
> pub extern \"C\" fn cleanup_module() {{
> // SAFETY:
> // - This function is inaccessible to the outside due to the double
>
> base-commit: 6ad64bf91728502fe8a4d1419c0a3e4fd323f503
> --
> 2.43.0
>
next prev parent reply other threads:[~2025-03-08 5:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 4:45 [PATCH v1] rust: module: place cleanup_module() in .exit.text section FUJITA Tomonori
2025-03-08 5:23 ` Jarkko Sakkinen
2025-03-08 5:32 ` Boqun Feng [this message]
2025-03-08 5:39 ` FUJITA Tomonori
2025-03-24 19:18 ` Miguel Ojeda
2025-05-09 4:16 ` FUJITA Tomonori
2025-05-09 7:27 ` Miguel Ojeda
2025-05-22 9:47 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z8vWbxp7BS3fKd5f@Mac.home \
--to=boqun.feng@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.