Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp31117ybt; Thu, 18 Jun 2020 17:21:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyisvWO0bvoBAF4pK+OZ73yVPVGKN/W+ujq+dCmhANUb3wuV6Dcrrpcs6fI2VDfIAGFxNG9 X-Received: by 2002:a17:906:ecfa:: with SMTP id qt26mr928382ejb.493.1592526062285; Thu, 18 Jun 2020 17:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592526062; cv=none; d=google.com; s=arc-20160816; b=gvQjzmO5IOqvtoE/HosNe0TVFPPRY4TsiP2dyBIYLvWpPINHPuUfDugMVJA2dKwvle 8x9+KCwthytKzQPY7NAgWTCG7Fg49IKSag0bwbq1lX+Oomc3642//9va1VqO5xBkVCf4 XVkoGYyyHk1jqUbq9/RsGsMi3HAHDhSNlKb5uTLJsFWi5ORA7cN5IUaN5yDjGRfj9qED mNgsWDIomWmoW8maK8nTP0wWOqMNz91yDQOAKdwkR8gJUC+GnJR7uHP2wB57fo8yPMMi sgY0CzJT1RVSaljJSVZD4oJuyz/YktnwzHQBN1I1pC/DV5uxWn0tXLCLX8ATmX/YRJUY nbXg== 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=HeHqI7T+BFDrDpt0HDb/Tc1qEtSdo/DTefFMc2v5nLI=; b=yBVPTWqW+c5fTfetD/0AaY1BaoxP8sJ44bA3B4pIGLus5bAjHZSwA30xH8v61ulLuY Yu7xv+WKkzlYlOYVF5FHRq3Fbf9uw3c0Tf7Y4pLbBdKfnqwE8a4UXEE5vCEMdQUaYDhi LJ8v+2piESSMhXTgMqta7X+2tTdmfQV4k3bGFQxLNoL4uj8tN7ktKRhYzvCKegPK2lgv 9rqUW0xEobU68vFJ99RuCGrWjb6TizZp6vWHwDyaTFk8k5kbih9qhdSMM7SRv51jdIqT evWyqPUL70IK79FrxNPAcvSDJeki17j0YCsN5MkP4f2sl3FsO57FIA8TKfPL/wQNHbp7 O2yg== 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 m27si2877455ejd.630.2020.06.18.17.20.40; Thu, 18 Jun 2020 17:21:02 -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 S1732330AbgFRUmM (ORCPT + 99 others); Thu, 18 Jun 2020 16:42:12 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:48844 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731337AbgFRUjb (ORCPT ); Thu, 18 Jun 2020 16:39:31 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 18 Jun 2020 13:39:22 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.129.221.29]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 4CFFBB265A; Thu, 18 Jun 2020 16:39:25 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v5 33/51] objtool: mcount: Remove wrapper for ELF relocation type Date: Thu, 18 Jun 2020 13:38:19 -0700 Message-ID: <2dc80025d1c8c251f65c18c29393ea70d2e344d9.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-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 Remove the last uses of the Elf_Rela wrapper by passing the size of the relocations we're dealing with as a parameter. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 4 ++-- tools/objtool/recordmcount.h | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/objtool/recordmcount.c b/tools/objtool/recordmcount.c index b9f15fc1f40e..6db035252b6c 100644 --- a/tools/objtool/recordmcount.c +++ b/tools/objtool/recordmcount.c @@ -575,7 +575,7 @@ static int do_file(char const *const fname) is_fake_mcount = MIPS_is_fake_mcount; } loc_size = 4; - rc = do32(reltype); + rc = do32(reltype, sizeof(Elf32_Rela)); break; case ELFCLASS64: { if (lf->ehdr.e_ehsize != sizeof(Elf64_Ehdr) @@ -593,7 +593,7 @@ static int do_file(char const *const fname) is_fake_mcount = MIPS_is_fake_mcount; } loc_size = 8; - rc = do64(reltype); + rc = do64(reltype, sizeof(Elf64_Rela)); break; } } /* end switch */ diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h index 2dd303d51b78..07fc93917736 100644 --- a/tools/objtool/recordmcount.h +++ b/tools/objtool/recordmcount.h @@ -18,18 +18,15 @@ * Copyright 2010 Steven Rostedt , Red Hat Inc. */ #undef do_func -#undef Elf_Rela #ifdef RECORD_MCOUNT_64 # define do_func do64 -# define Elf_Rela Elf64_Rela #else # define do_func do32 -# define Elf_Rela Elf32_Rela #endif /* Overall supervision for Elf32 ET_REL file. */ -static int do_func(unsigned const reltype) +static int do_func(unsigned const reltype, size_t rela_size) { /* Upper bound on space: assume all relevant relocs are for mcount. */ unsigned totrelsz; @@ -68,7 +65,7 @@ static int do_func(unsigned const reltype) return -1; } - is_rela = (sizeof(Elf_Rela) == rel_entsize); + is_rela = (rela_size == rel_entsize); /* add section: __mcount_loc */ mlocs = elf_create_section(lf, mc_name, sizeof(*mloc0), 0); -- 2.20.1