Re: modversion clarification.

Kai Germaschewski
2002-07-26T02:27:34Z

On Thu, 25 Jul 2002, Pat Suwalski wrote:

> henrique wrote:
> > When you try to load the module, the insmod will check if the symbols of your
> > module are the same of the current running kernel. If the symbols are the
> > same the module will be loaded. So you can use your module on all kernels
> > that have the same CRC for the kernel functions your module uses.

Yes, provided that module and kernel have the same version string
("2.4.18-preX").

> So then is that not opposite of what modversion says it does, which is
> to allow modules to be more comptible across multiple kernel versions?

No. If you enable modversions, that will always cause stricter checking -
without modversions, basically only the comparison of the version string
protects you from inserting an incompatible module. If you have
modversions enabled, the generated checksums provide additional checking
for mismatching ABIs (interfaces).

> Basically, the problem is that if module.h is included and MODVERSION is
> not defined, and the module wants to export symbols (EXPORT_SYMTAB is
> defined), then module.h automatically ifdefs modversions.h even if the
> kernel is not configured to use it (and thus the file does not exist).

The build process in 2.4 will generate a modversions.h file no matter what
CONFIG_MODVERSION says (but it'll be empty if it's switched off). For some
insight in what magic happens I put a lengthy comment into the 2.5 version
of include/linux/module.h - "So how does the CONFIG_MODVERSIONS magic
work?", if you're interested you may want to check that out.

--Kai