lkml.org 
[lkml]   [2006]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: GPL-only symbols issue
    Date
    On Tuesday, 09 May 2006 07:57, Ram Pai wrote:
    > On Mon, 2006-05-08 at 21:25 -0700, Greg KH wrote:
    > > On Mon, May 08, 2006 at 09:12:15AM +0200, Jan Beulich wrote:
    > > > Sam,
    > > >
    > > > would it seem reasonable a request to detect imports of GPL-only
    > > > symbols by non-GPL modules also at build time rather than only at run
    > > > time, and at least warn about such?

    I would appreciate such a check: it avoids unnecessary errors later. See
    my proposed patch in the next message.

    > > Ram has some tools that might catch this kind of thing. He's posted his
    > > scripts to lkml in the past, try looking in the archives.
    >
    > The patches are at
    >
    > http://sudhaa.com/~ram/misc/kernelpatch
    >
    > The patch of interest for you would be modpost.patch
    > I have a script and some code that can poke into a given .ko file and
    > warn against symbols that don't match what the kernel exports.

    I like the extension that modpost.patch adds. Statistics gathering like your
    other patch does doesn't need to be in the mainline kernel IMVHO, but I don't
    really mind. Here is a bugfix to modpost.patch:

    Index: linux-2.6.16/scripts/mod/modpost.c
    ===================================================================
    --- linux-2.6.16.orig/scripts/mod/modpost.c
    +++ linux-2.6.16/scripts/mod/modpost.c
    @@ -811,8 +817,12 @@ static void read_dump(const char *fname,
    *d != '\0')
    goto fail;

    - if (!(strcmp(export, "EXPORT_GPL_ONLY")))
    + if (strcmp(export, "EXPORT_SYMBOL_GPL") == 0)
    export_type = 1;
    + else if (strcmp(export, "EXPORT_SYMBOL") == 0)
    + export_type = 0;
    + else
    + goto fail;

    if (!(mod = find_module(modname))) {
    if (is_vmlinux(modname)) {
    Andreas
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-05-09 19:33    [W:0.045 / U:0.608 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site