EXPORT_SYMBOL in kernel module | undefined symbol during insmod

拟墨画扇 提交于 2019-12-19 19:44:56

问题


I have a exported functions foo() and foo1() from a.ko (a kernel module), foo1() takes input parameter, a function pointer. I invoke foo1() from b.ko, and pass foo() as the input parameter.

I see a insmod failure for b.ko (unknown symbol foo ), even though a.ko has been insmoded before b.ko.

Any explanations/solutions ?

Thanks, Lucky


回答1:


There are two ways to solve this, 1) Compile both the kernel modules in the same Makefile i.e. objs-m := a.o b.o. 2) Include **KBUILD_EXTRA_SYMBOLS=<"absolute path to the Module.symvers of the kernel module which is exporting function or variable"> in the Makefile of the kernel module which will use exported function or variable.



来源:https://stackoverflow.com/questions/17193532/export-symbol-in-kernel-module-undefined-symbol-during-insmod

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!