Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp547178ybm; Thu, 28 May 2020 09:07:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKvJD1VjYH96NBgqqGV6qy0hdO/5Qt2JAA1Irz/UW7o5EYpmu35DPA7oLfKSxVJN2jdOUK X-Received: by 2002:aa7:cdcb:: with SMTP id h11mr2996697edw.218.1590682041807; Thu, 28 May 2020 09:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590682041; cv=none; d=google.com; s=arc-20160816; b=M27sCi5MGQYSHVTSMdruFBO6ICdUWvGWTXzdmQGqpU+nhmlbZpB5WJd8+JpstMwInv yxhbnQceyXSp2V1n8/IcQm7/NPqbBVxXlXfzrRYw50YLwseCId4Me7W+9mKeU0fv7Whc jgziOKZDXKZ0U4fdGNlkKrUa2r6mCv8JdUcefVC+pvxKjKoe/saNxOAzv/PzwM82ap0E E/yIaRD9CflDuj0RChZbOGom+dZeef4m5DPRcfN2Xx8ssthsA+necck7KV7f5NePf/g5 NdxjOKwGSh4RoEf7Rmzq8AiV/4Pl1/A7nkVgQoXm09/6cJn6FFdPohU1/hXCWspU4cfN P7DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=0erePZcaFe2O5u6nXXU4H+ThKWvrhlWMPFK0jUOb+7I=; b=G26lf1JCQPbTXq1Fz0c0aUY+eOwETjaluTi2RfgDFkSYgZ8mDqDTGD+hREVwiK6abm 9m0yTJ+BepME+KnodGDP5kkP42baHgt/5ARB8DyAtakoAPBGvyNNRugJuiSyZIulUybG bf+0pDLFkJR2Iy8o2labxPjtlOX6TM3kqViLC3cFvE0uYuMtKrphayiRbf4HrCPse5h+ 92rwm+TFaVBco5gPGGw8DM7JkX6YfjiLFXOTncolBTWTvQW5c0jU5Ef7LNllQbpnD/AH 82Ueg5j6mGdQTn6FQcD0LlmMTN+cnQia2HkA5jSCyyWCI64W3hRK3ZowTU9KGgOF9gSf daTg== 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 r10si3791339ejj.249.2020.05.28.09.06.57; Thu, 28 May 2020 09:07:21 -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 S2404860AbgE1QFI (ORCPT + 99 others); Thu, 28 May 2020 12:05:08 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:17500 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404688AbgE1QFG (ORCPT ); Thu, 28 May 2020 12:05:06 -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, 28 May 2020 09:05:02 -0700 Received: from localhost (unknown [10.200.192.41]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 0782FB1646; Thu, 28 May 2020 12:05:05 -0400 (EDT) Date: Thu, 28 May 2020 09:05:05 -0700 From: Matt Helsley To: Josh Poimboeuf CC: , Peter Zijlstra , Steven Rostedt Subject: Re: [RFC][PATCH 3/3] objtool: Add support for relocations without addends Message-ID: <20200528160505.GX9040@rlwimi.vmware.com> Mail-Followup-To: Matt Helsley , Josh Poimboeuf , linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt References: <933488b79c91ba040e68847fe53531fd97b18e07.1590597288.git.mhelsley@vmware.com> <20200528142414.rzk5mvz4nwhsjcwp@treble> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200528142414.rzk5mvz4nwhsjcwp@treble> 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 On Thu, May 28, 2020 at 09:24:14AM -0500, Josh Poimboeuf wrote: > On Wed, May 27, 2020 at 09:42:33AM -0700, Matt Helsley wrote: > > @@ -525,16 +556,8 @@ static int read_relocs(struct elf *elf) > > return -1; > > } > > memset(reloc, 0, sizeof(*reloc)); > > - > > - if (!gelf_getrela(sec->data, i, &reloc->rela)) { > > - WARN_ELF("gelf_getrela"); > > + if (read_reloc(sec, i, reloc, &symndx)) > > return -1; > > - } > > I try to avoid function pointers, them being slow and ugly and all. > > Since it's just a single call site, I'd rather a direct call. For > example, call read_reloc(), which has an if-then to decide which > subfunction to call. OK, I'll take the function pointers out in favor of switches. Cheers, -Matt Helsley