Re: [RFC PATCH 4/5] Set KCONFIG_KSYMB as value for kconfig_ksymb module attribute

From: Luis R. Rodriguez
Date: Tue Aug 23 2016 - 15:11:10 EST


On Sat, Aug 20, 2016 at 05:16:50PM +0200, Cristina-Gabriela Moraru wrote:
> 2016-08-18 20:59 GMT+02:00 Luis R. Rodriguez <mcgrof@xxxxxxxxxx>:
> >
> > On Wed, Aug 17, 2016 at 09:27:02PM +0200, Cristina Moraru wrote:
> > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > > index 48958d3..a105916 100644
> > > --- a/scripts/mod/modpost.c
> > > +++ b/scripts/mod/modpost.c
> > > @@ -2245,6 +2245,12 @@ static void add_srcversion(struct buffer *b, struct module *mod)
> > > }
> > > }
> > >
> > > +static void add_kconfig_symbol(struct buffer *b, struct module *mod)
> > > +{
> > > + buf_printf(b, "\n");
> > > + buf_printf(b, "MODULE_INFO(kconfig_symbol, KBUILD_KSYMB);\n");
> >
> > What if its not available? What happens?
> >
>
> If not available KBUILD_KSYMB is "" and so is set in kconfig_symbol.
> More concrete:
>
> prompt:/sys$ cat ./module/mptbase/kconfig_symbol
>
> prompt:/sys$

As I noted in my other e-mail I think its best we just avoid exposing this
then for modules that lack a mapping, and then we make this best effort,
but document the shortcomings very well and super clearly as to why a
backward map is not possible. This then enables us to do work on the build
system to help with this and complete the semantic gap.

Luis