Re: to find out Unresolved symbel when I insert device driver?

Jens.Toerring_at_physik.fu-berlin.de
Date: 01/29/04


Date: 29 Jan 2004 13:48:03 GMT

somez72 <somez72@chollian.net> wrote:
> I have a device driver module souce.
> 1) in red hat 9.0. ( kernel version 2.4.20 ), module compile is OK and it
> seems like working

> well.(produced xxyy_module.o )

> just when I issue insmod xxyy_module.o , I got warning.

> "Warning: loading xxyy_moudule.o will taint the kernel: no license"
> "See http://www.tux.org/lkml/#export-tained for information about tained
> modules"
> "Module xxyy_module.o loaded, with warnings"

That's because you don't specify explicitely in the module that it's
either under the GPL or a similar free license. There are some binary
only modules (which obviously aren't under the GPL)and you get this
warning to make it clear to you that you know you're using which is
considered to be legally to be at least in a grey area and that you
won't get any help when there are problems with the kernel while that
module is loaded. You can easily get around the warning by a including
lines like

#if defined MODULE_LICENSE
MODULE_LICENSE( "GPL" );
#endif

Of course then the module must be under the GPL license!

> 2) in my new installed kernel ( kernel version 2.4.18), compile is
> OK(produced xxyy_module.o)
> but when I issue insmode xxy_module.o , I got error message as follows.

> "xxyy_module.o: unresolved symbol register_chrdev_Re70f806e"
> "xxyy_module.o: unresolved sysbol irq_stat_Rc0ba6f96"

> I want to export "register_chrdev_Re70f806e and irq_stat_Rc0ba6f96 "
> function,
> for exporting, I searched all kernel tree ( in above kernel 2.4.20) to
> find out prototype of two functions.
> ( grep -rn register_chrdev_Re70f806e / && grep -rn irq_stat_Rc0ba6f96 / ).
> I searched every direcotory under / , and I just found a number of Binary
> file matches
> (for example : /lib/modules/kernel/drives/pcmcia/ps.o ...... )

> I cant't find function prototype of it,
> Could someone help?, How can I find out prototype of that unresolved
> funtions.

I have had exactly the same problem (but with the RH9.0 2.4.20 kernel
sources). I found that it's due to the kernel headers distributed with
RedHat 9.0 being seriously broken - some of the functions are declared
for a kernel with versioning, while others are for a kernel without
versioning (register_chrdev() and unregister_chrdev() being one of the
examples). You will have to recreate the kernel headers from scratch.

1. Save the '.config' file in the main source directory somewhere else
2. Do a "make mproper"
3. Copy back the '.config' file into the main source directory
4. Reconfigure the kernel using e.g. "make oldconfig"
5. Do a "make dep"

Now you should have a clean set of kernel include files, which you now
can use to compile your module. Afterwards the problem should have gone
away.
                                      Regards, Jens

-- 
  \   Jens Thoms Toerring  ___  Jens.Toerring@physik.fu-berlin.de
   \__________________________  http://www.physik.fu-berlin.de/~toerring


Relevant Pages

  • Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
    ... You have _read_ the licence, ... themselves, then this License, and its terms, do not apply to those ... This is why kernel modules can have their own, ... by the GPL. ...
    (Linux-Kernel)
  • Re: [PATCH] Ban module license tag string termination trick
    ... It is a law. ... So - no problem with the GPL. ... on distribution of the kernel - but on the running. ... it means that a vendor of closed-source ...
    (Linux-Kernel)
  • RE: GPL issues
    ... the GPL cannot set its own scope. ... to give my answer to the original question -- if a kernel ... you should be okay if you develop an API for a kernel to ... work on any kernel (Linux or not, ...
    (Linux-Kernel)
  • [PATCH] Ban module license tag string termination trick
    ... Proposed patch to prohibit loading modules that use early C string ... When this is interpreted back again in the kernel module loader, ... having wrongfully access to GPL symbols. ...
    (Linux-Kernel)
  • Re: freed_symbols [Re: People, not GPL [was: Re: Driver Model]]
    ... Try doing a little more checking of your history Rob. ... Tell me I can not publish a GPL w/ source code project which returns the ... Tell anyone they can not change anything they want in the kernel, ... > barrier, so if you do your work in user land you're not in any way ...
    (Linux-Kernel)