manish, thanks for reply, but as i said i compiled my_mod2 (which is one of the binaries in my final module my_mod.ko) with a different version of gcc, so is there any information stored in the ELF file (my_mod2.o), if yes then please tell me where? Thanks pankaj --- Manish Regmi <regmi.manish@xxxxxxxxx> wrote: > 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 > Vision without action is merely a dream, action without vision is wastage of time, vision and action together can change the world .... __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/