Rust-for-linux archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Thomas Bertschinger <tahbertschinger@gmail.com>
Cc: rust-for-linux@vger.kernel.org, ojeda@kernel.org,
	alex.gaynor@gmail.com,  wedsonaf@gmail.com
Subject: Re: [PATCH] rust: place generated init_module() function in .init.text
Date: Mon, 5 Feb 2024 15:48:50 +0100	[thread overview]
Message-ID: <CAH5fLgjPNP1WHhJiWWtHnPd-DMOC_NnFUUTsfrZ5MNddUWq+qQ@mail.gmail.com> (raw)
In-Reply-To: <20240205144638.GB296718@fedora-laptop>

On Mon, Feb 5, 2024 at 3:46 PM Thomas Bertschinger
<tahbertschinger@gmail.com> wrote:
>
> On Mon, Feb 05, 2024 at 10:45:19AM +0100, Alice Ryhl wrote:
> > On Sat, Feb 3, 2024 at 7:28 PM Thomas Bertschinger
> > <tahbertschinger@gmail.com> wrote:
> > >
> > > diff --git a/rust/macros/module.rs b/rust/macros/module.rs
> > > index d62d8710d77a..d09be1bee397 100644
> > > --- a/rust/macros/module.rs
> > > +++ b/rust/macros/module.rs
> > > @@ -225,6 +225,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
> > >              #[cfg(MODULE)]
> > >              #[doc(hidden)]
> > >              #[no_mangle]
> > > +            #[link_section = \".init.text\"]
> > >              pub extern \"C\" fn init_module() -> core::ffi::c_int {{
> > >                  __init()
> > >              }}
> >
> > Perhaps this function should be made unsafe? I don't think there's
> > currently anything preventing safe non-init Rust code from calling it
> > directly as-is.
> >
> > Alice
>
> That's a good point. That makes sense to me; I can work on a v2 that does
> this.

With that fixed, you may add

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

      reply	other threads:[~2024-02-05 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 18:27 [PATCH] rust: place generated init_module() function in .init.text Thomas Bertschinger
2024-02-03 18:50 ` Martin Rodriguez Reboredo
2024-02-03 20:26   ` Thomas Bertschinger
2024-02-05  9:45 ` Alice Ryhl
2024-02-05 14:46   ` Thomas Bertschinger
2024-02-05 14:48     ` Alice Ryhl [this message]

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=CAH5fLgjPNP1WHhJiWWtHnPd-DMOC_NnFUUTsfrZ5MNddUWq+qQ@mail.gmail.com \
    --to=aliceryhl@google.com \
    --cc=alex.gaynor@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tahbertschinger@gmail.com \
    --cc=wedsonaf@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).