Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp27657ybt; Thu, 18 Jun 2020 17:14:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6ZGTNPzolQaAcz7hMb8Z14bjaSMNyWgIkhjpiwpKduVDnvGQG0SxA/bbnAyP+xOXppieH X-Received: by 2002:a50:c181:: with SMTP id m1mr701825edf.27.1592525695247; Thu, 18 Jun 2020 17:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592525695; cv=none; d=google.com; s=arc-20160816; b=qkdKmCQTxebb2Fc5h61krZJHBo5D8QqUw/zr+LDs9GaoTlZiKTW+o5c29ZuVOKnNRO MBA4sXk/QIrZZy48eoV3uOqHeJz0Q9MlZ2bLxrK3TV+hxINg+Mril5B84S857OT1K7AZ jyZkY0C7wwwYDVaPK3gDgvOXMPSdIPaehjEt0m1p6Vq5RUpVE1fIR9WJvYeoUvAy8CBx sxS7o+Ngo7fvmUtSaTfMtsa1ApjOh8B/UlfF2l767nBZ22dxWde7A9G1iXwxK5imOrlP TgEOYPSwyrvpD0X7u2LHpX8u8hyLF4ZracpDMPWkdtunJ/qWecRBvCDOsJWELH6Rka0M roPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kSZSaRjzKJ+R328A58zy41P8TSgUZCVGnHBU0pdC6Gw=; b=wmUSdc6QeGuShYylzcMOiFmfJxXpVYZLbEFRS925glrwQupl0H/RwgSjzBNP8uZO2R IHLc7MXU4a2Ijy2pev6lUJ7+AxFORX0bng6t4FNWAoMLGnOYKBmbGwsnlbX+jOR5GqWK WUb6EgxltQI7F+vPJ+1aJvDdMqs7OHo8ItOBp4pMtfXBkLpVOMRVo2kJKaHEfOLW/1a1 HtL/QiJFq33m4aK7ElTvltu9GhZ9eCSaIEgp3To8sNzeM0b7VhoQBfUpZ+wx3Z/lJk1e jLG2NIjhhBiEBoNqKg2a310DQ/mAKbLdpP8SDYzJYVCbgK+l4WP+eJVJ2CE8stoF3QVs dRIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c16si2842091ejx.310.2020.06.18.17.14.32; Thu, 18 Jun 2020 17:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731317AbgFRUjW (ORCPT + 99 others); Thu, 18 Jun 2020 16:39:22 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:3944 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730866AbgFRUjH (ORCPT ); Thu, 18 Jun 2020 16:39:07 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Thu, 18 Jun 2020 13:39:00 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.129.221.29]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id E5C91B2661; Thu, 18 Jun 2020 16:39:03 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v5 07/51] objtool: mcount: Move nhdr into find_symtab() Date: Thu, 18 Jun 2020 13:37:53 -0700 Message-ID: <7bf31e46fa228ea4d8e47f4767b2c6f2e4180942.1592510545.git.mhelsley@vmware.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-001.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since it's no longer needed in the rest of do_func() we can move it to where it's needed rather than pass it as a parameter. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h index b46e855d32bf..4bd61c9d1fd5 100644 --- a/tools/objtool/recordmcount.h +++ b/tools/objtool/recordmcount.h @@ -229,9 +229,10 @@ static int get_shstrndx(Elf_Ehdr const *ehdr, Elf_Shdr const *shdr0) } static void find_symtab(Elf_Ehdr *const ehdr, Elf_Shdr const *shdr0, - unsigned const nhdr, Elf32_Word **symtab, + Elf32_Word **symtab, Elf32_Word **symtab_shndx) { + unsigned const nhdr = get_shnum(ehdr, shdr0); Elf_Shdr const *relhdr; unsigned k; @@ -593,7 +594,6 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname, { Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) + (void *)ehdr); - unsigned const nhdr = get_shnum(ehdr, shdr0); Elf_Shdr *const shstr = &shdr0[get_shstrndx(ehdr, shdr0)]; char const *const shstrtab = (char const *)(_w(shstr->sh_offset) + (void *)ehdr); @@ -638,7 +638,7 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname, return -1; } - find_symtab(ehdr, shdr0, nhdr, &symtab, &symtab_shndx); + find_symtab(ehdr, shdr0, &symtab, &symtab_shndx); list_for_each_entry(sec, &lf->sections, list) { char const *txtname; -- 2.20.1