Re: insmod question.

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

 



On 7/1/06, pankaj chauhan <chauhan_ait@xxxxxxxxxxx> wrote:
hi all,

i have a module say my_mod.ko, which is composed to
two two binaries say my_mod1.o and my_mod2.o. I am
trying to insmod this module on 2.6.11, which is
compiled by gcc 3.4.3, If i compile my_mod1 and
my_mod2 with gcc3.4.3 and my_mod.ko gets insmoded with
no problems. But if my_mod2.o is compiled with gcc
2.95 then my_mod.ko does not get insmoded and it says
"Invalid module format: unknown error 8".

I understand that the kernel and the module should be
compiled with same gcc version to work properly (for
which i do'nt know the reason, if somebody please tell
me the reason that will be great). But what i do'nt
understand is that what is the difference when i
compile my_mod2 with gcc 3.4 or 2.95, and how it is
detected that my_mod2.o is compiled with a different
gcc version, as far as i understand there is no
information about the compiler in ELF file which tells
you that which compiler version was used to for
compilation (please correct me if i am wrong).

There is a string called version magic which stores info on kernel
version, compiler version etc. The kernel compares the module's
vermagic with that of kernls.

regards
Manish Regmi

--
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