Re: crc32, gpl, debuglink, and interoperability.

Mark Wielaard <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hi David,

On Fri, 2020-10-09 at 13:59 -0700, David Anderson wrote:
> I'm the maintainer of libdwarf and dwarfdump and wish to
> interoperate with gdb/debuglink by reading the appropriate
> sections and validating the crc32 when appropriate.
> 
> The crc32 used in binutils for debuglink is under plain GPLV3.
> Linking to sucn a thing (from what I've been able to find and
> somewhat-understand) means the GPL applies to the linked work.
> That is not appropriate for the libdwarf library.
> 
> So how can I get permission to use LGPL v2.1 (which most of
> libdwarf is) or LGPL v3?  on the relevant crc32 function (in
> bfd/opncls.c)?  In other words extract the source and apply
> an LGPL to the one function calculating the debuglink crc.
> 
> At present interoperability with debuglink is impossible  in
> libdwarf (so impossible in dwarfdump) and I would like to
> make it work.

If you like a dual GPLv2+/LGPLv3+ license better, then you can find an
implementation in elfutils too:
https://sourceware.org/git/?p=elfutils.git;a=blob;f=lib/crc32.c;hb=HEAD

But it is really a fairly standard crc-32. See the end of 
https://www.sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
 for the polynomial used. You can use that to generate the crc-32
table. Then all you need to know is that you start with 0xFFFFFFFF and
that the CRC is inverted when the calculation is done.

Cheers,

Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.