[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASnQ2QXV9=CyTLq+3rzJ-n8hEhgtuRmj8hBHmX8-8n_cg@mail.gmail.com>
Date: Wed, 27 Apr 2022 03:33:10 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>
Subject: Re: [PATCH 16/27] modpost: make multiple export error
On Wed, Apr 27, 2022 at 1:40 AM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> On Mon, Apr 25, 2022 at 9:10 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> >
> > On Tue, Apr 26, 2022 at 3:48 AM Nick Desaulniers
> > <ndesaulniers@...gle.com> wrote:
> > >
> > > On Sun, Apr 24, 2022 at 12:09 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> > > >
> > > > This is currently a warning, but I think modpost should stop building
> > > > in this case.
> > > >
> > > > If the same symbol is exported multiple times and we let it keep going,
> > > > the sanity check becomes difficult.
> > > >
> > > > Only the legitimate case is that an external module overrides the
> > > > corresponding in-tree module to provide a different implementation
> > > > with the same interface.
> > >
> > > Could the same module export a weak version of a symbol, and a strong one?
> >
> > No. There is no concept like EXPORT_SYMBOL_WEAK.
> >
> > I am talking about kmod things.
> > You can modprobe an external module instead of the in-kernel one.
>
> Ok, this patch seems fine to me.
> Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
> --
> Thanks,
> ~Nick Desaulniers
Nick,
If useful, I can add more commits to the commit description.
I know one example in the tree that exploits this feature.
$ make allmodconfig all
You will get drivers/nvdimm/libnvdimm.ko, then
$ make M=tools/testing/nvdimm
You will get tools/testing/nvdimm/libnvdimm.ko
The latter is a mocked one that exported the same symbols
as drivers/nvdimm/libnvdimm.ko
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists