Re: size of CRCs in module versions

Kai Germaschewski (kai@tp1.ruhr-uni-bochum.de)
Wed, 16 Apr 2003 00:43:06 -0500 (CDT)


On Tue, 15 Apr 2003, David Mosberger wrote:

> What's the point of using "unsigned long" for storing module version
> CRCs? As far as I can see, the CRCs are 32 bits in size, so using u32
> would be more appropriate (and would avoid wasting space on 64-bit
> platforms).

You're right that 32 bits would be enough to hold the CRC. However, we do
not yet know the checksum at compile time, so the trick I came up with is
to use the linker to fill in the crcs afterwards, using assignment to
absolute values. So while the crcs appear to be numbers to the C code,
they are handled like addresses from the linker side, and things would
most likely go badly wrong if the sizes aren't equal, though I have to
admit I didn't try.

--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/