Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19686775rwd; Wed, 28 Jun 2023 12:45:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+g+jlOvrFU2RPEw6KcdZfhKHjfo2KOiPquSrHG1hkxzn0NvhTtrOgQx0Nsd4QrN/g7KCb X-Received: by 2002:a17:907:9449:b0:988:b58d:5e0 with SMTP id dl9-20020a170907944900b00988b58d05e0mr24051869ejc.16.1687981544529; Wed, 28 Jun 2023 12:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687981544; cv=none; d=google.com; s=arc-20160816; b=t953cCw4UD7ItaCJZ+1tE9py6AKnLqwostlhHcNNSwaPdoNtKsDMVv41C5SSdy/DjG coP6zblpP/rdLjHv9nFm2BO+TDnBJlT1NkUOq3qod+cRwaq4VGEzQbZ4gZVt/sTuXjhZ ZjoFG4Pc0KJGJ0Ov6B56+wcATpufxZI6BOgyjUQAcOR+ZwbTBSg7bZO5yPTR014yRS+p TUCqzTesjhMmXmgUweisrWGwx266eQwRUGYQ8uBwzn1jNC9oOQczdhgi9VGslOsP8iQN uTPN7set7RlahYuU8fWIVHcYnH6IbMiF1yTkwtT1GY4xflFJAvY50UscjAIZu92pFzOx DNAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Xn2BdDIsixleW0Us8abiaWOPBvctMAbH6QL8qcvYYmI=; fh=LZghZ2BHOy/p5iIPcBm76epCOHbw490NTOVPSbLN0po=; b=KPCB1ug2CRJ4rizDlRcCTbN2FqALHE+LAlJeEsxv0/FlmQ3JtxZTvrMe7+ogaf/CQV SUObwTNL34znturw8FnjtsQswrgAZJwN4zyxmML1MyMIITv5ahlgub2CbvFmY+IROyBl oFgVNCfaVN9y7l3qXD3s1jqJW9/kE/5bVjc1eUstraNKNNHrfMbYI/tn0xYwzKYmHkMa CV5XgjkB1bAOSJkCfv13QpnSgZtdGQSyVqaO/AYjGyeG1eARF9uOZ4FbE5rG6Ed/SZvX CFicGavXCGC3M18WBScr/JEJr/n2KxMsptakua3Ubx2tsmYfX2Xf8fCUCYX5v5/+uwFn 15eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kMIC4L0r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx6-20020a170906ca4600b0098f99532db4si4426796ejb.664.2023.06.28.12.45.19; Wed, 28 Jun 2023 12:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kMIC4L0r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbjF1Tcq (ORCPT + 99 others); Wed, 28 Jun 2023 15:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231839AbjF1Tch (ORCPT ); Wed, 28 Jun 2023 15:32:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2ACB10F0 for ; Wed, 28 Jun 2023 12:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Xn2BdDIsixleW0Us8abiaWOPBvctMAbH6QL8qcvYYmI=; b=kMIC4L0rPzyHuVRd2VVpyoPu+8 /603BunLqW70Bl0e+owrJHLtvsmJ+GtWLgSEFWp0CaEgqm12nuQipeAM2ibxihyW7EXscbKa/s/Lp qlkHgyL3TU6LP/nB4nBQWT2jaio5KldYWqvY3FEwz4bHI6reEvOovkosDMq4UhhqyQwPsJ13qWrqt Lm7rKKe2p1aLaTRfdh+XfRc9Xy/uF5AZttHdciSLRTDt5lUzZKyLHuFf4iQehvAbn428MRJ1t7TFu YA/Ybz1O39a0Oic58SdEabutvK4/Ce6MZLwvvW2aDkiYX1L0vs/JtQ/taUl9XHqE1dFgpTpUAvDl9 B4oFLurg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qEau0-00498Q-90; Wed, 28 Jun 2023 19:32:32 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 67F39300118; Wed, 28 Jun 2023 21:32:31 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 44C10214D80C4; Wed, 28 Jun 2023 21:32:31 +0200 (CEST) Date: Wed, 28 Jun 2023 21:32:31 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Michal Kubecek , linux-kernel@vger.kernel.org Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size") Message-ID: <20230628193231.GX83892@hirez.programming.kicks-ass.net> References: <20230628115825.ahqejf5y4hgxhyqj@lion.mk-sys.cz> <20230628151654.zqwy5zsc2cymqghr@treble> <20230628154432.4drtq4pivlkkg6v2@lion.mk-sys.cz> <20230628160631.ryt4icjeck627efs@lion.mk-sys.cz> <20230628164554.womrvwq7chnjtva4@lion.mk-sys.cz> <20230628170530.derop5w2gtmgjeis@treble> <20230628172659.6qwbswgz4ki24wyv@lion.mk-sys.cz> <20230628181019.cmgfbygxfvwamzur@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230628181019.cmgfbygxfvwamzur@treble> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 11:10:19AM -0700, Josh Poimboeuf wrote: > On Wed, Jun 28, 2023 at 07:26:59PM +0200, Michal Kubecek wrote: > > I digged some more and my guess is that the problem is that > > elf_open_read() does > > > > memset(elf, 0, offsetof(struct elf, sections)); > > > > but commit eb0481bbc4ce ("objtool: Fix reloc_hash size") added > > num_relocs after sections so that it is not zeroed (0xbabababababababa > > is probably some kind of poison). > > Argh, that memset() is subtle as heck. Peter, why?!? Well, at the time struct elf had a bunch of fairly large hash tables embedded inside it. memset() on those was a significant performance fail -- esp. since we called objtool on every .o file. struct elf { Elf *elf; GElf_Ehdr ehdr; int fd; char *name; struct list_head sections; DECLARE_HASHTABLE(symbol_hash, 20); DECLARE_HASHTABLE(symbol_name_hash, 20); DECLARE_HASHTABLE(section_hash, 16); DECLARE_HASHTABLE(section_name_hash, 16); DECLARE_HASHTABLE(rela_hash, 20); }; Those embedded hash-tables have gone away, but apparently someone forgot about this thing :/ Yes, this can go, struct elf is no longer like that.