[uClibc]insmod problem
Igor Trevisan
igor.trevisan at bluewind.it
Thu Jan 9 15:03:19 UTC 2003
Thans Phil (and also thanks Stuart!)
for you timely answer.
I was surely starting from a wrong point, considering
my compile command line but...
I'm still looking at a
# insmod ./frrele.o
Using ./frrele.o
insmod: unresolved symbol printk
#
sad error message!
The include path I specified is correct but... no good news!
Any ather possibilities?
Hoping so...
Igor.
On 9 Jan 2003 at 9:45, Phil Wilshire wrote:
>
> HI Igor
> here is your problem,
>
> arm-uclibc-gcc -c frrele.c
>
> You want a module so yuou have to do a bit more work.
>
> 1/ you need to define __KERNEL__ and MODULE in your compiler flags
> you specified MODULE in the c file which is not the best way.
>
> 2/ You have to let the compiler konw where to find the kernel headers
>
> try
> arm-uclibc-gcc -DMODULE -D__KERNEL__ -I<kernel src dir>/include -c
> frrele.c
>
> where kernel src dir is the location of your kernel source..
>
> regards
> Phil Wilshire
>
> Igor Trevisan wrote:
>
> >
> > Hi,
> >
> > I'm using uClibc-0.9.16 and Busybox-0.60.5 compiled for an arm-linux
> > platform. I have to write the driver for a simple rele device and I
> > was starting with a very simple demo:
> >
> > *********************** frrele.c *********************************
> > #define MODULE
> > #include <linux/module.h>
> > #include <linux/kernel.h>
> > //#include <linux/modversions.h>
> >
> > int init_module(void)
> > {
> > printk("<1>Initializing rele module...\n");
> >
> > return 0;
> > }
> >
> > void cleanup_module(void)
> > {
> > printk("<1>Goodbye from rele module...\n");
> > }
> > **************************** eof *********************************
> >
> > I compiled it with
> > arm-uclibc-gcc -c frrele.c, I moved frrele.o into
> > the target File System and finally I tried to use insmod to install
> > the new module. This is what I obtain...
> >
> > # insmod ./frrele.o
> > Using ./frrele.o
> > insmod: unresolved symbol printk
> > #
> >
> > What's wrong?!
> > Any suggestion is appreciated!
> > Thanks in advance...
> > Igor.
> >
> > _______________________________________________
> > uClibc mailing list
> > uClibc at uclibc.org
> > http://uclibc.org/mailman/listinfo/uclibc
>
> --
> SDCS -- System Design & Consulting Services LLC, http://www.sysdcs.com
> ** Embedded Linux Training ** email me for details 630 Springhouse
> Sq., Leesburg VA 20175 t: 703 669 9766 f: 703 669 9768
More information about the uClibc
mailing list