I compiled simple drive for Linux kernel for ARM system:

$ uname -a

Linux CR5 4.4.171-cr5 #2 Tue Mar 10 11:49:00 CET 2020 armv7l GNU/Linux

To compile i used the config file from the up ruining system located at:


i downloaded a vanilla kernel, checkout to tag 4.4.5, replace the config file ,compile the kernel, and then compile the drive with the tool-chine for arm

gcc-linaro-7.2.1-2017.11-i686_arm-linux-gnueabi The drive contain simple code

    #include <linux/module.h>
    #include <linux/kernel.h>

    int init_module(void) {
        printk(KERN_INFO "Hello world.\n");
        return 0;

    void cleanup_module(void) {
        printk(KERN_INFO "Goodbye world.\n");

i used insmod to load the driver but the err message to terminal is:

insmod: ERROR: could not insert module test_module.ko: Invalid module format

at the dmesg i get this message

test_module: disagrees about version of symbol module_layout

However, when i compere between running module in the system with my module with readelf -a

The ELF Header are the same and the File Attributes are the same.

what can i check more? Maybe the module loading was blocked by kernel? how can i check that? some one hes a lead for my what i can do next?


  • simple c program is ruining fine, so i guess the tool-chine is fine
  • insmod -f not work as well



problem was at the layout , even all the same same layout was changed

found answer here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.