From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by sourceware.org (Postfix) with ESMTPS id 60B90385BF9E for ; Wed, 17 Mar 2021 17:13:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 60B90385BF9E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dodji@seketeli.org Received: from localhost (unknown [88.120.130.27]) (Authenticated sender: dodji@seketeli.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 8A9D8240006; Wed, 17 Mar 2021 17:13:46 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id CA08358000E; Wed, 17 Mar 2021 18:13:44 +0100 (CET) From: Dodji Seketeli To: Matthias Maennich Cc: libabigail@sourceware.org, gprocida@google.com, kernel-team@android.com Subject: Re: [PATCH 20/20] symtab: Add support for MODVERSIONS (CRC checksums) Organization: Me, myself and I References: <20200619214305.562-1-maennich@google.com> <20210127125853.886677-1-maennich@google.com> <20210127125853.886677-21-maennich@google.com> X-Operating-System: Fedora 34 X-URL: http://www.seketeli.net/~dodji Date: Wed, 17 Mar 2021 18:13:44 +0100 In-Reply-To: <20210127125853.886677-21-maennich@google.com> (Matthias Maennich's message of "Wed, 27 Jan 2021 12:58:53 +0000") Message-ID: <87mtv1wvnb.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 17:13:50 -0000 Matthias Maennich a =C3=A9crit: > The Linux Kernel has a mechanism (MODVERSIONS) to checksum symbols based > on their type. In a way similar to what libabigail does, but different. > The CRC values for symbols can be extracted from the symtab either by > following the __kcrctab_ entry or by using the __crc_ > value directly. > > This patch adds support for extracting those CRC values and storing them > as a property of elf_symbol. Subsequently, 'crc' gets emitted as an > attribute of 'elf-symbol' in the XML representation. This is pretty cool btw. Personally, I would have tied the CRC to the decl instead of the ELF symbol. I know in the kernel land, symbols and decls are usually thought of interchangeably but conceptually, they are not the same thing. The linux kernel CRCs are computed from the types of the declarations that are associated to the ELF symbol. I am talking about the genksyms machinery. Se we are really talking about the declarations and types here. They are storing in ELF because there is no concept of decls and types in ELF. But we do have that in libabigail. So I really think it makes more sense to have this tied to decls instead of ELF symbols. If tomorrow we build or get a hash for decls and types we'll have to re-do this again, at the decl level. As a matter of fact, the feature already exists for type units in DWARF for instance. We just don't support that yet. But we might have to support it in the future. So the more I think about this, the more I think we should add an "artifact_hash" property to type_or_decl_base instead of putting this into the ELF symbol. What do you think? [...] Cheers, --=20 Dodji