Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp913151ybb; Fri, 10 Apr 2020 12:42:38 -0700 (PDT) X-Google-Smtp-Source: APiQypL224sWWtPtOECjv7nYYXFk7rkv9qeMbajElI7RffMy2BIOY4l7I3k9KJi2Pvd1EH7QmQcG X-Received: by 2002:ac8:75d0:: with SMTP id z16mr769074qtq.281.1586547758789; Fri, 10 Apr 2020 12:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586547758; cv=none; d=google.com; s=arc-20160816; b=fMuyp/ROd2v0Fmf3sPJCD3svMdr13Ig4WxeqtNGiiPk+HaPM51PGLP/cw14ZSl6/m0 nUXpAZMI38TYRx6BxfFnLoOeaK+umFCj612tj0HLrzx33Qd5vaBknk49vxjaIbRLRqRo +cRvB0WKua2dL9guLdjc/XfdCDoj4LQEj0W8zN6Rma0vpJCG51TgB1XxbdeLgeaQZj7X Lw/aq3n88tmcujxkRF1rW7ibz0qb4SBmQBWLESwryMmgmTPgAR9iOiRmjIG7byzmcgWL 2LXe3z29YRc61sveq5pxoI+zEFcLgEPaX3P/ZhJBwXTw7jAvLH7FgZ9ymYab+GNYODDc vPJg== 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=QnNFdHlh4gmsb/jcCdS/5owTZ9wgivni5jwJwijW2jk=; b=UFzUB6uogpZRNHmricSKDO8pxbez3g7iTae8FyLjLr2ViVMJipzDdvBd6aJj/eVa2i A8M9P5AFvpMqI3/49xiavzqK97YEgCbfLYIZHtig0lFF+RP9FEmkjbKfKSFsh8Z4XG6t D7K8POPhCMGN+jmsJDCricmccEJCiPsZWJ3SaCieE5LWpv0a+bE6G/Tto8JfJztwmnjk Uf/Q2Bg59vIyiafBaivXl3XudbpvA1SwwDh9cHb3W9YzvZ5yQam7yi0ADX1P73wU95YP HSK+6B5xXL+1WkYp3NYvzm+UmOhoxeLJmBArku0VLix85l9P51H1tWtHbb8JqteglWRE x9jg== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si2281641qtw.271.2020.04.10.12.42.23; Fri, 10 Apr 2020 12:42:38 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgDJTlb (ORCPT + 99 others); Fri, 10 Apr 2020 15:41:31 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:36243 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgDJTl2 (ORCPT ); Fri, 10 Apr 2020 15:41:28 -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; Fri, 10 Apr 2020 12:39:27 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.166.69.226]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 0C8B240BC0; Fri, 10 Apr 2020 12:39:32 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Ingo Molnar , Steven Rostedt , Miroslav Benes , Matt Helsley Subject: [RFC][PATCH 34/36] objtool: mcount: Remove wrapper for ELF relocation type Date: Fri, 10 Apr 2020 12:35:57 -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 Remove the last use of the Elf_Rela wrapper #defines 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 a16611a352e5..e6aa1feb234d 100644 --- a/tools/objtool/recordmcount.c +++ b/tools/objtool/recordmcount.c @@ -574,7 +574,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) @@ -592,7 +592,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 7db08ad9b4a7..d116032522e1 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; @@ -70,7 +67,7 @@ static int do_func(unsigned const reltype) return -1; } - is_rela = (sizeof(Elf_Rela) == rel_entsize); + is_rela = (rela_size == rel_entsize); mc_name = is_rela ? ".rela__mcount_loc" : ".rel__mcount_loc"; -- 2.20.1