Skip to content
Advertisement

insmod fails with “Unknown symbol in module”

I am working on Linuxmint Cinnamon 19 Ubuntu 18.04, kernel version 4.15.0-20-generic

The following I see during compilation:

JavaScript

Then I try to install the module with sudo insmod elevator.ko

JavaScript

Seeing in the logs: dmesg | tail

JavaScript

Makefile

JavaScript

elevator.c

JavaScript

issue_request.c

JavaScript

start_elevator.c

JavaScript

stop_elevator.c

JavaScript

Functions are static and there is only one makefile in same directory. So my question is: Why can’t the elevator.ko be loaded and how to fix?

Advertisement

Answer

That’s an easy one. Near the top are these:

JavaScript

Your module will not load due to the undefined symbols. Once those are resolved when building, module loading should work better. It looks like your link is using only 1 object file. Though I don’t have access to confirm, try adjusting your Makefile to list all object files; it could be that obj-m is incomplete and should list the same files as those with obj-y.

If you run into other undefined symbols while loading the module and they’re external to your module, there’s probably a dependency issue. For that case, copy your module to /lib/modules/...... and try loading with modprobe

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement