Re: "Unknown symbol in module" Question in 2.6.26

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

 



Moudles Code:#############################################################mod1.c#include<linux/init.h>#include<linux/module.h>#include<linux/kernel.h>
static int func1(void){       printk("In Func: %s...\n",__func__);       return 0;}
EXPORT_SYMBOL(func1);
static int __init hello_init(void){       printk("Module 1,Init!\n");       return 0;}
static void __exit hello_exit(void){       printk("Module 1,Exit!\n");}
module_init(hello_init);module_exit(hello_exit);
#############################################################mod2.c#include<linux/init.h>#include<linux/kernel.h>#include<linux/module.h>
static int func2(void){       extern int func1(void);       func1();       printk("In Func: %s...\n",__func__);       return 0;}
static int __init hello_init(void){       printk("Module 2,Init!\n");       func2();       return 0;}
static void __exit hello_exit(void){       printk("Module 2,Exit!\n");}
module_init(hello_init);module_exit(hello_exit);
################################################################Makefileifneq ($(KERNELRELEASE),)obj-m   := XXXX.oelseKDIR    := /lib/modules/$(shell uname -r)/buildPWD             := $(shell pwd)
default:       $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:       rm -rf Module.symvers *.ko *.o *.mod.c .*.cmd .tmp_versions
endif
#############################################################
2008/8/2 fisherman <ipconfigme@xxxxxxxxx>:> module A and module B, module A export symbol func a, module B using func a.> Both  modules using GPL.>> #insmod ./mod1.ko> #insmod ./mod2.ko>> #tail /var/log/kern.log> Aug  1 23:47:27 dell-desktop kernel: [ 7029.008527] mod2: no symbol> version for func1> Aug  1 23:47:27 dell-desktop kernel: [ 7029.008534] mod2: Unknown symbol func1>> But  in /proc/kallsyms, we can find the func a's symbol.>> I test modules in 2.6.22 and 2.6.24, both can be right insmoded without errors.>> BTW: The 2.6.26 kernel is compiled by myself.> CONFIG_MODULES=y> # CONFIG_MODULE_FORCE_LOAD is not set> CONFIG_MODULE_UNLOAD=y> # CONFIG_MODULE_FORCE_UNLOAD is not set> CONFIG_MODVERSIONS=y> CONFIG_MODULE_SRCVERSION_ALL=y> CONFIG_KMOD=y>> --> Best Regards :-)> -------------------------------------------> Wang Yao(王耀),wangyao@xxxxxxxxxxxxx ipconfigme@xxxxxxxxx wangyao01@baidu.com> wangyao08@xxxxxxxxxxxxxxxxxx> HomePage: http://cudev.cublog.cn> IBM Club Harbin Institute Of Technology> Address:NO.92 West Da-Zhi Street,NanGang District,Harbin,Heilongjiang>


-- Best Regards :-)-------------------------------------------Wang Yao(王耀),wangyao@xxxxxxxxxxxxx ipconfigme@xxxxxxxxx wangyao01@baidu.comwangyao08@xxxxxxxxxxxxxxxxxxxxxxxxxx: http://cudev.cublog.cnIBM Club Harbin Institute Of TechnologyAddress:NO.92 West Da-Zhi Street,NanGang District,Harbin,Heilongjiang?韬{.n?????%??檩jw?)p??{.n???罐??'??q??????????v??m??赙zY蘖?锄+?@


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux