[LARTC] Invalid module format

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In kernel 2.5.72 , My modules: demo-module.c
----------------------------------------------------------
#include <linux/init.h>
#include <linux/module.h>

static int __init demo_init(void) {
        printk("initializing..\n");
        return 0;
}

static void __exit demo_exit(void) {
        printk("goodbye!\n");
}

module_init(demo_init);
module_exit(demo_exit);
MODULE_LICENSE("GPL");
------------------------------------------------------------

compile line: 
gcc -I/path-to-linux-tree/include -D__KERNEL__ -DMODULE -O2 
-DKBUILD_MODNAME=demo-module -DKBUILD_BASENAME=demo-module \
    -Wall -Wstrict-prototypes -c -o demo-module.o demo-module.c

---------------------------------------------------------------
# insmod demo-module.o
Error inserting 'demo-module.o': -1 Invalid module format

---------------------------------------------------------------

Insmod tells me "Invalid module format" and the kernel log says "No
module found in object".  

Someone can tell me what's trouble!

                                                            yuan



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux