0

I have built an external kernel module with exported functions which builds and loads fine, including showing the exported functions in the /proc/kallsyms with a "T" when loaded. I now want to call those functions from a existing kernel module that is compiled with the kernel build. I have added the path to the external module's module.symvers file to the internal module's makefile using KBUILD_EXTRA_SYMBOLS and build the external module before recompiling the kernel. However I continue to get the following error:

ERROR: "external_function" [net/mac80211/mac80211.ko] undefined!  
scripts/Makefile.modpost:92 recipe for target '__modpost' failed  
make[1]: *** [__modpost] Error 1  
Makefile:1211: recipe for target 'Modules' failed  
make: [modules] Error 2. 

Is it even possible to call an external module from an internal one?

  • 1
    There are two methods: a) you must compile-in your new module; b) introduce a callback operations. – 0andriy Mar 15 '22 at 09:48
  • Does this answer your question? [How to export symbol from Linux kernel module in this case?](https://stackoverflow.com/questions/27769368/how-to-export-symbol-from-linux-kernel-module-in-this-case) – 0andriy Mar 15 '22 at 10:00
  • Also read this: https://stackoverflow.com/q/63256621/2511795 – 0andriy Mar 15 '22 at 10:02
  • Thanks, @0andriy. I would have prefered to keep it as an out-of-tree module but I've converted it to in-tree and it works fine. – Paul Zanna Mar 17 '22 at 00:47

0 Answers0