I'm having trouble dynamically loading modules into the
2.2.10-rmk2 kernel. I have broken the problem down to
a very trivial kernel module; it consists of the following 2
C files:
fooX.c:
---------------------------------
#define MODVERSIONS
#include <linux/modversions.h>
#define EXPORT_SYMTAB
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h> /* printk() */
extern void foo(void);
int
init_module(void)
{
printk("init_module: entered\n");
foo();
printk("init_module: exit\n");
return 0;
}
void
cleanup_module(void)
{
printk("cleanup_module: entered\n");
printk("cleanup_module: exit\n");
}
fooY.c
------------------------------------
#define MODVERSIONS
#include <linux/modversions.h>
#include <linux/kernel.h> /* printk() */
void foo(void)
{
printk("foo enter ");
printk("foo ");
printk("foo ");
printk("foo ");
printk("foo exit\n");
}
----------
I build it like:
/opt/INETlgnu/bin/armv4l-inet-linux-gcc -o fooX.o -mapcs-32 -mshort-load-bytes
-mcpu=strongarm110 -Wall -O2 -pipe -Wstrict-prototypes -D DEBUG=4 -D __KERNEL__
-D MODULE -c fooX.c
/opt/INETlgnu/bin/armv4l-inet-linux-gcc -o fooY.o -mapcs-32 -mshort-load-bytes
-mcpu=strongarm110 -Wall -O2 -pipe -Wstrict-prototypes -D DEBUG=4 -D __KERNEL__
-D MODULE -c fooY.c
/opt/INETlgnu/bin/armv4l-inet-linux-ld -o foo.o -r fooX.o fooY.o
----------------
Every time this module is loaded it gets kernel Ooops
from, I think, printk() or on the return from printk().
The funny thing is that if put the function foo() in the
fooX.c source file, thus reducing the module to 1 .o file,
then the module loads and print, and unloads as expected.
Am I building this thing wrong ?
Suggestions, please.
--
[EMAIL PROTECTED]
Inet Technologies Inc.
Plano, Texas
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]