Re: Making module versions (Was: OFFTOPIC: binary modules, bad idea!)

Michael Elizabeth Chastain (mec@shout.net)
Fri, 26 Dec 1997 23:34:15 -0600


Hello kernel hackers,

I have given up on any CONFIG_MODVERSIONS work for a while, because it's
too much work for too little payoff.

Roderich Schupp writes:
> I understand why __kysmtab_bar goes into into section __ksymtab.
> My nit was: why does the string "bar_R123" need a section attribute
> (into ".kstrtab"), too? Someone told me that otherwise the loader might
> be tempted to put the string into the same section, i.e. __ksymtab
> (which would be a spoiler), but I can't reproduce that...

Actually the C compiler would choose the section, not the loader.
There are lots of versions and variants of gcc in the world, including
all the different architectures, and there are a lot of flags for gcc.
With an explicit specification, one can easily see that the code is
correct. "Be conservative in what you send" isn't just for networks;
it is a good rule for using programming language constructs, too.

> Isn't that was insmod already does? As far as I can tell insmod
> insists on being a self-contained mini-linker (without employing
> the help of ld or the like).

Yes, it does. It has to bind names to values, and it has to do
this directly into memory rather than into an output file. I don't
think it would be useful to coerce gnu ld into this role. It is
a similar function to ld.so, though.

Michael Chastain
<mailto:mec@shout.net>
"love without fear"