Re: How to make module work with different kernel versions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Thu, Apr 07, 2005 at 11:07:26AM -0700, Sanjay wrote:
> > Hi,
> > 
> > I have a compiled binary(*.ko) module (under 2.6.7). I wanted it to work
> > with different kernel versions like 2.6.10/11 and different version
> > magic(2.6.7-xxx/2.6.7-ver). Currently it gives the error due to version
> > mismatch saying "insmod: error inserting 'mymod.ko': -1 Invalid module
> > format". Is there anyway I can mask the version and insert the module
> > without any problems?. 
> 
> No.

How can you say this? It is true that normal kernel has protection
(symbols like "alloc_skb_Rsmp_3f2d96f8"), but you can compile the kernel
without this, so that you have symbols like "alloc_skb".

You can also compile modules this way. So it IS possible.
I don't know whether there is a setting in the kernel configuration (I've
seen something...) but anyway - you can hack the stuff in
include/linux/modules/*.ver and the way it is used.

Another possibility would be to hack the module (obj file) to correspond to
the current kernel. It would suffice to rename the symbols. This is also
possible (some way). Maybe it is not easily possible with binutils but who
knows?

	Tomas

> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/

-- 
 "No Software Patents!" -- Allowing patents over software ideas will
seriously affect the Creativity, Productivity and Freedom of all.
Link: http://www.nosoftwarepatents.com/
--
Defend your freedom by signing a petition.
Link: http://petition.eurolinux.org/index_html?LANG=en

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux