Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3427654ybb; Mon, 23 Mar 2020 00:28:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt/nXEst6Gr2fm7KU9D3xXwL2AQ0pBD1NrwfDs7h9sXywIdWI9kjVnPWG+GhAm5XxUja6dX X-Received: by 2002:aca:b605:: with SMTP id g5mr16373829oif.159.1584948486735; Mon, 23 Mar 2020 00:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584948486; cv=none; d=google.com; s=arc-20160816; b=VGxFTe/3mnVt1o8K3pbCviHxQHPy8VEQQG+q9baRlF5RP0076Jov7lSV4nvn1i2rXD 2Lx6JkAvH02d+Y4+PRuncMRqQVE1B1ihKeipC9hIhl6bWH3RhUE5LzHftRPTYL0GTLA4 o8gDyqhiQfRJAn62OlCMUt+6jkIFv7r8qlEOyI++zr0JODVwQWg5pE5CxA67hWCR32Vq vgICumOpvDGhBJNXJXUmjawYtRkyp/5afQRobKlIclIibNR6qW1sYtfLH8/vGQyJ29Dt MM+B5CFvZTP+UNkJaR7QaXohkbsuRVApue+EUtKzIo1SqSYiMH67JIBcZ2bIptzEwck/ MJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=ep5it3zdVZNw86zdBIWxPSfzUruC1tm5s5B2XL5+iNE=; b=J4ZQF8P/sX2LpsEasbRygGjEKO5uKjH0LnYMpyg7ZaLwuN/ZXpDiYDfFWNr+gf2+pv CibsW0D/KhD84Xbb72ghvMgqQZMFwXDUe87UCRG7u+aS8X7ZfZ4Yl8eEHeLcFcyK9nLQ pHQzU15EeON82/NS9x7bWot/9uhYyWoqcfY8qltcawFP4UiLYycKsSeWnWwrye9aR1Yz YOoGmP3db111J8MU95T1fgmDS8fuqOYAXHuzs5KY7piIIwnS+mQ70gyliWheCKKE6LnL 8n2Gu8XmjicDjE1FAZFNuYUQpkmMRQNN7C7Xr61lzegiUrG03EmIX54HwJBW5JOGyHq0 UinQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si7407265oif.250.2020.03.23.00.27.53; Mon, 23 Mar 2020 00:28:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbgCWH10 (ORCPT + 99 others); Mon, 23 Mar 2020 03:27:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:59904 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727164AbgCWH1Z (ORCPT ); Mon, 23 Mar 2020 03:27:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C5EF6AC11; Mon, 23 Mar 2020 07:27:23 +0000 (UTC) Date: Mon, 23 Mar 2020 08:27:22 +0100 (CET) From: Miroslav Benes To: Peter Zijlstra cc: tglx@linutronix.de, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, x86@kernel.org, mhiramat@kernel.org, brgerst@gmail.com Subject: Re: [PATCH v2 17/19] objtool: Optimize !vmlinux.o again In-Reply-To: <20200321161151.GB3323@worktop.programming.kicks-ass.net> Message-ID: References: <20200317170234.897520633@infradead.org> <20200317170910.819744197@infradead.org> <20200318132025.GH20730@hirez.programming.kicks-ass.net> <20200321151421.GD2452@worktop.programming.kicks-ass.net> <20200321161151.GB3323@worktop.programming.kicks-ass.net> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Mar 2020, Peter Zijlstra wrote: > On Sat, Mar 21, 2020 at 04:14:21PM +0100, Peter Zijlstra wrote: > > On Fri, Mar 20, 2020 at 05:20:47PM +0100, Miroslav Benes wrote: > > > > > I think there is one more missing in create_orc_entry(). > > > > I'm thikning you're quite right about that.... lemme see what to do > > about that. > > --- > --- a/tools/objtool/elf.c > +++ b/tools/objtool/elf.c > @@ -472,6 +472,14 @@ static int read_symbols(struct elf *elf) > return -1; > } > > +void elf_add_rela(struct elf *elf, struct rela *rela) > +{ > + struct section *sec = rela->sec; > + > + list_add_tail(&rela->list, &sec->rela_list); > + elf_hash_add(elf->rela_hash, &rela->hash, rela_hash(rela)); > +} > + > static int read_relas(struct elf *elf) > { > struct section *sec; > @@ -519,8 +527,7 @@ static int read_relas(struct elf *elf) > return -1; > } > > - list_add_tail(&rela->list, &sec->rela_list); > - elf_hash_add(elf->rela_hash, &rela->hash, rela_hash(rela)); > + elf_add_rela(elf, rela); > nr_rela++; > } > max_rela = max(max_rela, nr_rela); > --- a/tools/objtool/elf.h > +++ b/tools/objtool/elf.h > @@ -127,6 +127,7 @@ struct section *elf_create_rela_section( > int elf_rebuild_rela_section(struct section *sec); > int elf_write(struct elf *elf); > void elf_close(struct elf *elf); > +void elf_add_rela(struct elf *elf, struct rela *rela); > > #define for_each_sec(file, sec) \ > list_for_each_entry(sec, &file->elf->sections, list) > --- a/tools/objtool/orc_gen.c > +++ b/tools/objtool/orc_gen.c > @@ -111,8 +111,7 @@ static int create_orc_entry(struct elf * > rela->offset = idx * sizeof(int); > rela->sec = ip_relasec; > > - list_add_tail(&rela->list, &ip_relasec->rela_list); > - hash_add(elf->rela_hash, &rela->hash, rela_hash(rela)); > + elf_add_rela(elf, rela); > > return 0; > } Yup, looks good. Miroslav