Re: size of CRCs in module versions

From: David Mosberger (davidm@napali.hpl.hp.com)
Date: Wed Apr 16 2003 - 01:25:15 EST


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

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

Yes, it's not easy (possible) to do it in C, but I suspect most 64-bit
assemblers/linkers can do it. For example, on ia64, you can do:

        .global foo

        data4 foo

Which will yield a DIR32LSB relocation (32-bit direct value), which is
exactly what we'd need here.

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



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:17 EST