LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-15-2018, 04:31 AM   #1
SUSESailor
Member
 
Registered: Jul 2015
Posts: 69

Rep: Reputation: Disabled
Invalid module format "no symbol version for module_layout"


Hello, all.

I just compiled a module for my kernel, following all of the instructions, but when I modprobe the module, I get the "Invalid module format" error and dmesg reports "no symbol version for module_layout".

Now, my research tells me that this would happen if I compiled the module without a Module.symvers file, but I did have one. It was in the particular source directory where I was compiling the module, and it was copied from the one in the main source directory. That one had been generated locally through the make modules command. I got no error messages about a missing Module.symvers when I was compiling the module.

The only thing I can think of is that it is still seeing the old module that I had compiled before I generated the Module.symvers file, but if that's true, how do I get rid of the old module and replace it with the new one?

Thanks in advance!
 
Old 07-16-2018, 02:49 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 2,975

Rep: Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795
"make modules_install" should replace the old copy in /lib/modules/`uname -r`.

Make sure that you have removed the module from the running kernel using modprobe -r before trying to load the new copy.
 
Old 07-16-2018, 03:31 PM   #3
SUSESailor
Member
 
Registered: Jul 2015
Posts: 69

Original Poster
Rep: Reputation: Disabled
There never was any old module to rmmod. I am adding a new module that hadn't previously been compiled into the kernel.

The thing is that I had previously tried to compile the new module without Module.symvers and it gave me the exact same error as above. And even with the new one having been compiled WITH Module.symvers, I still get the same error message. So, the only thing I can think of is that the old version of the new module that was compiled without Module.symvers is still the one it's trying to load.

And I manually removed the old attempt at compiling the module from the /lib/modules directory before copying in the new one and running depmod -A.
 
Old 07-17-2018, 09:08 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 2,975

Rep: Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795Reputation: 795
You shouldn't need to copy the Module.symvers file. The -C $KDIR tells make where to find the kernel source.

https://elixir.bootlin.com/linux/lat...ld/modules.txt
 
Old 07-17-2018, 08:11 PM   #5
SUSESailor
Member
 
Registered: Jul 2015
Posts: 69

Original Poster
Rep: Reputation: Disabled
Okay, then why am I getting this error message?

All of the research that I did says that you get this error message if you compile an external module without Module.symvers. Well, now I've done it both ways - with and without Module.symvers - and I still get the error message. The module still doesn't load and it still tells me "no symbol version for module_layout."

What do I do?
 
Old 07-22-2018, 08:44 AM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,667

Rep: Reputation: 217Reputation: 217Reputation: 217
This might be a basic question, but are you sure you compile your module against the kernel you load it to? Could you show us your Makefile and the build command please?
 
Old 07-25-2018, 01:15 AM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,327

Rep: Reputation: 965Reputation: 965Reputation: 965Reputation: 965Reputation: 965Reputation: 965Reputation: 965Reputation: 965
Did you run depmod?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
First time module building on ARM: "disagrees about version of symbol module_layout" tzippy Linux - Kernel 1 06-02-2013 08:09 AM
insmod hello.ko: -1 Invalid module format ("vermagic" and "uname -r" are the same!) courteous Linux - Kernel 8 02-16-2011 11:09 PM
rt61pci kernel module fails to load in -current "Invalid module format" Interject Slackware 6 03-20-2010 01:48 AM
What is the error "invalid module format" and "insert kernel module"? shayori Linux - Newbie 8 02-25-2010 03:48 AM
Cisco VPN Client on FC6 2.6.20 "invalid module format" rrautens Fedora 16 06-07-2007 09:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration