Alan Stern writes:
> On Thu, 19 Dec 2002, Dick St.Peters wrote:
> > Note: Contrary to an earlier posting, the symbol extensions do NOT
> > make modules dependent on specific kernels - they do exactly the
> > opposite. It is when CONFIG_MODVERSIONS is not set that modules must
> > match the kernel version. When CONFIG_MODVERSIONS is set, the
> > extensions are computed from only the things the module actually
> > depends on. Then a module built for one kernel version can be used
> > with a different kernel version as long as the things the module
> > depends on don't change.
> Really? That's not what I thought. My understanding was that without
> CONFIG_MODVERSIONS, the kernel symbols would not have any extensions
Correct so far.
> That way, a module compiled without the extensions would have a
> good chance of matching the kernel's symbols, even if it had been compiled
> for a different kernel.
This was probably the impetus for MODVERSIONS. The symbols could
match even when the module wouldn't work in the kernel (such as the
API having changed - different arguments, etc.) Then the only way
insmod can avoid loading a non-working module is to make sure BOTH all
the symbols match AND the kernel versions match.
In other words, with CONFIG_MODVERSIONS set, the test is to compare
the symbols, including the extensions, without requiring the kernel
version match. Without it set, the test is to compare both the
symbols and the kernel version.
> With CONFIG_MODVERSIONS set, the symbol
> extensions are added, so a module would not be loadable unless it also had
> been compiled with symbol extensions and the extensions matched -- which
> in practice means the module was compiled for that specific kernel.
Actually, in practice, the extensions don't change very often, making
most modules recyclable - which was the idea in the first place.
As for whether the module must also be compiled with MODVERSIONS,
that's what is documented, but it's not always necessary. I'm not at
all sure when or why it is and isn't, but I have a bunch of examples
of modules without extensions loaded and running in kernels with
them. I think I've also seen cases where insmod balked.
Dick St.Peters, stpeters,AT,NetHeaven,DOT,com
Gatekeeper, NetHeaven, Saratoga Springs, NY