From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Fri, 24 Jul 2015 10:10:18 -0700 Subject: Do you know the bug of EXPORT_SYMBOL() In-Reply-To: <20150724054941.GA17034@debian> References: <20150724054941.GA17034@debian> Message-ID: <20150724171018.GA8358@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, Jul 24, 2015 at 01:49:42PM +0800, Navy wrote: > Hi > To my understanding, EXPORT_SYMBOL() is used to export a symbol in > kernel/modules. The the address of the all sysbols is in /proc/kallsyms. > Only symbols exported by EXPORT_SYMBOL() is listed its CRC information > in Module.symvers. So I think the CRC is the key to export a symbol. > I do an experiment: > > ---mdir > | > |---Mod1 > | |---mod1.c > | |---Makefile > | > |---Mod2 > |---mod2.c > |---Makefile > > mod1.c define function *void myfunc(void)* and exported by EXPORT_SYMBOL() > and the CRC info is showed in Module.symvers. mod2.c reference *myfunc* and > compiled successfully. BUT when mod2.ko is insmoded, "unknown symbol" is > complained. mod2.ko CAN'T BE INSMOD. Use 'modprobe' after "properly" installing the kernel modules to the correct location, and then all will be fine. greg k-h