From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 3B5143857C65 for ; Fri, 9 Oct 2020 21:36:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3B5143857C65 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 99B3F3000A21; Fri, 9 Oct 2020 23:36:15 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 7CF27470868D; Fri, 9 Oct 2020 23:36:15 +0200 (CEST) Message-ID: Subject: Re: crc32, gpl, debuglink, and interoperability. From: Mark Wielaard To: David Anderson , gdb@sourceware.org Date: Fri, 09 Oct 2020 23:36:15 +0200 In-Reply-To: <6eeb0949-c85a-9762-37b0-f08a49b8ba90@linuxmail.org> References: <6eeb0949-c85a-9762-37b0-f08a49b8ba90@linuxmail.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-8.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 21:36:18 -0000 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. >=20 > 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. >=20 > 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. >=20 > 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=3Delfutils.git;a=3Dblob;f=3Dlib/crc32.c;hb=3D= HEAD But it is really a fairly standard crc-32. See the end of=20 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