[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Symbol Versioning [Was Re: Unresolved Symbol in Module]
Aiee :)
Hello!
I'd like to add just a few minor stuff (please forgive my if I'm wrong
and `drive me' to the right way :) I'm still trying to learn too)
We've to distinguish amongst two major scenario:
1) kernel not compiled with CONFIG_MODVERSIONS
2) kernel compiled with CONFIG_MODVERSIONS
1) If you compile your module with CONFIG_MODVERSIONS, you won't be
able to load it (for the reason explained in a previous post);
so you should compile without CONFIG_MODVERSIONS.
Disadvantage doing this is that you'll be able [1] to load a module
on kernel version X, only when that module is been compiled on
a kernel versions X too, even if the symbols' API used by the module
it's not changed on the kernel you're trying to load the module.
Yeah, you can force it with -f switch, but this could cause issues
(maybe Oops, panic if something goes wrong) since the API could
be changed ...
2) If you don't compile your module with CONFIG_MODVERSIONS, then
you'll be able to load it on kernel X only if it (the module) is
been compiled on kernel versions X too [1].
If you compile your module with CONFIG_MODVERIONS than you'll be
able to load it on ANY kernel you want, if the module's version symbol
and kernel version symbol match (that is if the API is the same).
[1]:
Otherwise you'll get an error about versioning.
You can force the loading using -f insmod switch but you have to be sure
that the symbols used by your module are the same (API) on the kernel
you're trying to load the module ...
If not, you can get Oops/panic or nothing, depending on the kind of
issue.
On Fri, Mar 09, 2001 at 11:32:14AM +0000, Mark McLoughlin wrote:
> o in each of your c files, at the top (before you include linux/kernel.h)
>
> #idef CONFIG_MODVERSIONS
> #include <linux/modversions.h>
> #endif
Usually I start a kernel module with something like this
(I hope this is right :)):
#include <linux/autoconf.h> /* <linux/config.h> should be good too */
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
# define MODVERSIONS
# include <linux/modversions.h>
#endif
(ok, you can do this in different ways. What I'd like to point out is
to include <linux/autoconf.h> to get the kernel compilation options)
Hope what I said is just a little bit right, otherwise forgive me please :)
bye bye
-- gg sullivan
--
Lorenzo Cavallaro `Gigi Sullivan' <sullivan@sikurezza.org>
Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml