[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAR-u=EVzPL+iJHoBW62AK2ViD3nVnL79EdxNS03UxmkBA@mail.gmail.com>
Date: Tue, 26 Apr 2022 13:08:45 +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 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.
>
> Can kernel modules override in-kernel strong symbols?
Yes, I think so.
>
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> > ---
> >
> > scripts/mod/modpost.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 14044cd94aaa..73f0b98e3b5a 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -411,9 +411,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
> > list_add_tail(&s->list, &mod->exported_symbols);
> > } else if (!external_module || s->module->is_vmlinux ||
> > s->module == mod) {
> > - warn("%s: '%s' exported twice. Previous export was in %s%s\n",
> > - mod->name, name, s->module->name,
> > - s->module->is_vmlinux ? "" : ".ko");
> > + error("%s: '%s' exported twice. Previous export was in %s%s\n",
> > + mod->name, name, s->module->name,
> > + s->module->is_vmlinux ? "" : ".ko");
> > return s;
> > }
> >
> > --
> > 2.32.0
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists