implementing custom kernel module loading optimization due to unresolved symbols on CentOS 7
Quick question that's been bugging me - I'm working on a personal project and I'm sure I'm missing something obvious here, but I'm trying to load a custom kernel module on my CentOS 7 system, but I'm working with issues with unresolved symbols when I attempt to insert it... Hereβs a snippet of the Makefile I'm using to build the module: ```makefile obj-m += mymodule.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean ``` I've also ensured that the kernel headers are installed and match the current kernel version. When I load the module using `insmod mymodule.ko`, I get the following behavior: ``` behavior: could not insert 'mymodule': Unknown symbol in module, or unknown parameter ``` After a bit of searching, I used `dmesg` to look for more details and found an output like: ``` my_module_init: Unknown symbol my_dependency_function (err -12) ``` I am certain that `my_dependency_function` is defined in another module that I have loaded previously. I checked the dependencies using `modinfo` on both modules, and it seems they should be linked correctly. I've also tried adding the `EXPORT_SYMBOL(my_dependency_function);` directive in the source file of the dependent module, but that hasn't resolved the scenario. Can anyone suggest what I might have overlooked or how to debug this further? I need to ensure that my kernel module can find its dependencies during loading. Thanks in advance! This is part of a larger web app I'm building. Any ideas what could be causing this? This is part of a larger CLI tool I'm building. Am I missing something obvious? The project is a mobile app built with C. Is there a better approach? This is for a mobile app running on CentOS. Any feedback is welcome!