Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1543371ybg; Tue, 2 Jun 2020 12:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrFnpZ+uccyeh9V1Vyk6dWnrBMyje3eM7kxrWvLZGW4ZaPFJgudow2Qong7NcMo/UHlfLj X-Received: by 2002:aa7:c38f:: with SMTP id k15mr23461277edq.342.1591127669175; Tue, 02 Jun 2020 12:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591127669; cv=none; d=google.com; s=arc-20160816; b=zxuBGh47fk+13iAG91+mV8IDDIJqzRJ9+A7jCRMtOmonAUMxiDYGrmEsY5h5vBsOIB lJRJOt04byXLnH149qXvlkWkixNpy5+7KAVoZBlHHOmYvLEBG0Rbnt/HQt5aN8vFSSSA MQQKrlmZXuMgEMIHITB5sPmIhb4UmioV/1vbj+hyk/za9uhkTxC46IyO7t6uJoWazW1K bewigbbN+9TCvS0e0jySAf11qOv/Pk3ISRdcbmGE/0oSxYw8pb+LMGomO3uNGciMr8rE og3QXmUJTwZ9ITBbKZvYiEvx2WkdFVxk3i1mqTq2q67DJ5YMJ3UgfqxT0925W0olvD90 x+1Q== 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=hladQ/dDgq1YNVpjHTjRnN3qgfcJQnRUCDW2JyRSxrM=; b=F1yYpLw+HaOp2hz4CQump48cega+Zs0RaKO5b92vom9dHb9mcUkPCingmFbZlriGLO vf+g3gCec3ECFJbFQMQS9LRpLv+QTOnKFk9EKNlAQ1/9xkeVgkiNFqGRx9aemzQi9INh hDVEwNsoWjKqZbKPBCjVrNGNiCoRvQ/txGGqrUtSh49KHSeCZzX5kSJL46WuegHBUBzJ j7eo3CNt2QpqamAL5t+zEqyhq0RDD10QBhymy3xlipHsJwTQ3ZSfvCumaBZQGGWqd304 gQAOlAPUrZPxn5lvjmHsMPT7O8y9Lldpx894GFmBoKdhM55Q3ItWiCgdHJU2F4sigBLc XRbQ== 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 z1si2078608edm.572.2020.06.02.12.54.05; Tue, 02 Jun 2020 12:54:29 -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 S1728581AbgFBTvY (ORCPT + 99 others); Tue, 2 Jun 2020 15:51:24 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:36862 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbgFBTvH (ORCPT ); Tue, 2 Jun 2020 15:51:07 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 2 Jun 2020 12:51:04 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.200.192.49]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 5154140BED; Tue, 2 Jun 2020 12:51:05 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Sami Tolvanen , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v4 24/32] objtool: mcount: Reduce usage of _size wrapper Date: Tue, 2 Jun 2020 12:50:17 -0700 Message-ID: X-Mailer: git-send-email 2.25.1 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-002.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 Use a new loc_size parameter to append_func() rather than use the wrapper's _size macro directly. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h index e1be7243742b..e2de71f99566 100644 --- a/tools/objtool/recordmcount.h +++ b/tools/objtool/recordmcount.h @@ -72,6 +72,7 @@ static int append_func(uint_t const *const mloc0, uint_t const *const mlocp, Elf_Rel const *const mrel0, Elf_Rel const *const mrelp, + unsigned int const loc_size, unsigned int const rel_entsize, unsigned int const symsec_sh_link) { @@ -83,14 +84,14 @@ static int append_func(uint_t const *const mloc0, unsigned const old_shnum = lf->ehdr.e_shnum; /* add section: __mcount_loc */ - sec = elf_create_section(lf, mc_name + (sizeof(Elf_Rela) == rel_entsize) + strlen(".rel"), _size, mlocp - mloc0); + sec = elf_create_section(lf, mc_name + (sizeof(Elf_Rela) == rel_entsize) + strlen(".rel"), loc_size, mlocp - mloc0); if (!sec) return -1; // created sec->sh.sh_size = (void *)mlocp - (void *)mloc0; sec->sh.sh_link = 0;/* TODO objtool uses this? */ sec->sh.sh_info = 0;/* TODO objtool uses this? */ - sec->sh.sh_addralign = _size; + sec->sh.sh_addralign = loc_size; // created sec->sh.sh_entsize = _size; // assert sec->data->d_size == (void *)mlocp - (void *)mloc0 @@ -109,7 +110,7 @@ static int append_func(uint_t const *const mloc0, sec->sh.sh_flags = 0; sec->sh.sh_link = find_section_by_name(lf, ".symtab")->idx; sec->sh.sh_info = old_shnum; - sec->sh.sh_addralign = _size; + sec->sh.sh_addralign = loc_size; // assert sec->data->d_size == (void *)mrelp - (void *)mrel0 memcpy(sec->data->d_buf, mrel0, sec->data->d_size); @@ -231,7 +232,7 @@ static int do_func(unsigned const reltype) } if (!result && mloc0 != mlocp) result = append_func(mloc0, mlocp, mrel0, mrelp, - rel_entsize, symsec_sh_link); + _size, rel_entsize, symsec_sh_link); out: free(mrel0); free(mloc0); -- 2.20.1