How to Link static or shared library to Kernel Module?
问题 There is a function in aaa.c int myadd(int a, int b){ return a+b; } and aaa.c was built into a static library using gcc -c aaa.c -o aaa.o && ar -cr libaaa.a aaa.o and a shared library using gcc -c aaa.c -o aaa.o && gcc -shared -fPCI -o libaaa.so aaa.o Then I wrote a file call.c, and try to call function myadd() in libaaa.so, but failed. Please give me some advice, test.c: #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("Dual BSD/GPL"); extern int