Re: modversion clarification.

Kai Germaschewski (kai@tp1.ruhr-uni-bochum.de)
Thu, 25 Jul 2002 21:30:41 -0500 (CDT)


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/