This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add crc32 function to libiberty


Michael Snyder wrote:
Eli Zaretskii wrote:
Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
From: Ian Lance Taylor <iant@google.com>
Date: Fri, 24 Jul 2009 17:40:09 -0700

Does anybody on the gdb side know the polynomial or any other
information?
AFAICS, this was introduced by Jim Blandy.  Jim, are can you help us
here?

There may be some confusion here. At least I'm confused.


Jim added gnu_debuglink_crc32() to utils.c in 2003 (to be used
by symfile.c), but I added static ulong crc32() to remote.c some
time around 1997-1998 (argh, there's no changelog entry) while
working on tracepoints.

Ian's new function bears a closer resemblance to the one in
remote.c than to the one in utils.c, other than the fact that
it uses a pre-computed table.  I'm not familiar with Jim's
version, and don't know whether they compute the same result.

I'm not seeking credit here -- in fact, I'd prefer to avoid it,
since I frankly don't remember where I came up with the algorithm.
;-(

Michael

OK, google gives millions of hits for the crc const 0x04c11db7 used by Ian's and my (remote.c) algorithm. I can't find my way to an original source, but apparently the algorithm was published as a part if IEEE 802.3 (ethernet), and is in very wide use (mpeg, png, v.42, posix cksum...)

If you want to know the actual polynomial, this MIGHT be it
(I guarantee nothing):
x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1


Happy googling!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]