lkml.org 
[lkml]   [2003]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: size of CRCs in module versions
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/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.026 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site