Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp470531ybm; Thu, 28 May 2020 07:28:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXVlErSbwpbtMkKOywE3hzwEXMpKT08LjCOHUOCkj6l5OP4xzl2Sx3OlIE/VduyiL8n42M X-Received: by 2002:a17:906:2503:: with SMTP id i3mr3316846ejb.293.1590676137573; Thu, 28 May 2020 07:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590676137; cv=none; d=google.com; s=arc-20160816; b=BwtdDhtwhnkUuVnJnfOwG6fLSEtusz4lhgdhmuaBN7XAqhC+hLHRBzSWevH62G5DqC /prbvGkmYVZyQWVrJ9etmL5GlrfBK9PPgcAYlO4NHuZyTyCFTbzuHmEe7WV099grcmf/ xEj6duBcTEbxDlzO3P+g5nbsRHgXCFMpdqCuRNaoLAzQRtDgUuot+SMTwhzGYISHB98i ehT/WyLTstUQW5OaxWWSf3elFPXRjrkYKXRNL8Qi/0/2gdE26Vum3GzRAPVTM8mUWdaa Kl8OtruuywE/QomY2TE+6OX/Bw2uEPsKEDjaCrSGinr1fIFpH3DIKybbOhT35Rz51MvA tecQ== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=q8lVaUXox57ggEnjMJi0j+06kub1m1d4QvouQKu1sHk=; b=amMCx8EbkuWLHjJ9BJFuh6iOFKbapR+ZWTUuIrXY+wok9jqPR7bemSTu5YfGRFlYQF QH7n+26RLZbMM6EoruUsa6zMRBLoBJ97oDHV5hA8DxHFLPvoZShKEz8eEwMp44QsZnvZ PqYIhKmGkuvRCfhKoDp9IDRSn3886M0BELSR9wkp77YIO9kF0qT43Wd5ToaL1P54zJ9L r3qbZLpkyFz86CpEG3P+wsbtgEn6G4y8iQVjG3ZnHdiUW/3MRYx7OtTJdKCWWctYVdxm rN2qcgXwusTcZAKEGQzyH/dVns8HuFtO20WMTbcI3EVzALfq7BngHZr4w8Ivk1gWK2K7 ourg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I7YpP8yv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp27si3761168ejb.557.2020.05.28.07.28.34; Thu, 28 May 2020 07:28:57 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I7YpP8yv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391169AbgE1OY2 (ORCPT + 99 others); Thu, 28 May 2020 10:24:28 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:52513 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390932AbgE1OYY (ORCPT ); Thu, 28 May 2020 10:24:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590675863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q8lVaUXox57ggEnjMJi0j+06kub1m1d4QvouQKu1sHk=; b=I7YpP8yvp0PaOosPmfk5/YD1sL71rjyJ3h+x0obkuTvHpp11i4wU747eAMaAk+3uOUcyxZ e7k2Pjt5WD33O7AHWs+Y9Si/wfoXwkGoQzFvvm0aLBm9LU7jz155bkOHlPyXeDnHzdCC3I +PXj7K1gGluWUaGmxrqEqpsrkUI0RZ4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-665ktRubNOSPyk6TEM-yZA-1; Thu, 28 May 2020 10:24:18 -0400 X-MC-Unique: 665ktRubNOSPyk6TEM-yZA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2BEC1054FA4; Thu, 28 May 2020 14:24:17 +0000 (UTC) Received: from treble (ovpn-117-65.rdu2.redhat.com [10.10.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1FEE5DA27; Thu, 28 May 2020 14:24:16 +0000 (UTC) Date: Thu, 28 May 2020 09:24:14 -0500 From: Josh Poimboeuf To: Matt Helsley Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt Subject: Re: [RFC][PATCH 3/3] objtool: Add support for relocations without addends Message-ID: <20200528142414.rzk5mvz4nwhsjcwp@treble> References: <933488b79c91ba040e68847fe53531fd97b18e07.1590597288.git.mhelsley@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <933488b79c91ba040e68847fe53531fd97b18e07.1590597288.git.mhelsley@vmware.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Josh