Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp959950ybm; Wed, 27 May 2020 12:13:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2sLHqKhOrcCHQzLsu/pXU0/RF2yxPqeaP+TePpgG5H8mJ/VVgTgDfvZtPPd6+iBKQxuwx X-Received: by 2002:a17:906:6546:: with SMTP id u6mr938711ejn.543.1590606820586; Wed, 27 May 2020 12:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590606820; cv=none; d=google.com; s=arc-20160816; b=CSMcufcfCkIga4hLr30M9ibbv24+vRIR8d0p2uUfn+oFmNNZRGgLEjBLqi7ssncwZy nVJ2qgtuT52xjHWl2crXHosgoMq3T61Mp/ZkPeVBvqeQcu3aF1cqjLx2PZuOcQFVJ3hK HWALDOhsGXy89nqwrefWXvUuh5R7fvnfJolOo+mvaFgwerJmAIDoYZhTP3gHO+xR+7cp X+bkV++YP18dAoSfqT+EM867O0OcSNxyTTpBjAoLXiEd5zxn9u/G5lPGMsJo7TEVPhL8 o56I4WdlABoZ0YtMnb4J54yDYFVbSofQq6AHSd+5HB34xsqPpz2kwfeSEUpFf3q1KdCX T/OA== 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 :message-id:date:subject:cc:to:from; bh=b9A5TAEoc18HbolcGlvp0Gd4tWPVQ5vjnIRsWBEt5i8=; b=HN6xbFe36IM6gf8V5RL7mGeWIg6DE6XnDeHJkaK4ZoKo6FQ+I7+Hc1iAi/CxDsa18c 2qIqW1P+Nr4KkLKvAg0ifCoTwCdpy7GVY0OO3aO1Q0gxUhfwnmAJziFZlflTkQVGcdeO Y/Tu0AElvfHPjaB+AhDidvWAdDI46y8qihHYFBCs5e0PHJr2IiUOHullYJBcmPuay6en vfLwrbao/VegCJMGUPa8CAQMflrC9gVUn68ocT5kBHRr33BRYVzqNgvOIJMWT2mYjkhF wU/ZciBO5Dq3CclNA9relGpTh8A2GR9tkq2GPP18IFtzIsKtDGZ5mTQEhmx7L492AWv0 uzng== 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 bi4si1516553edb.411.2020.05.27.12.13.17; Wed, 27 May 2020 12:13:40 -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 S2391348AbgE0Qmq (ORCPT + 98 others); Wed, 27 May 2020 12:42:46 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:13177 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390729AbgE0Qmp (ORCPT ); Wed, 27 May 2020 12:42:45 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Wed, 27 May 2020 09:42:42 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.200.192.41]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 9826B4046A; Wed, 27 May 2020 09:42:44 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Matt Helsley Subject: [RFC][PATCH 0/3] objtool: Support implicit addend relocations Date: Wed, 27 May 2020 09:42:30 -0700 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-001.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 Future tools that use objtool to process ELF object files may require reading or even modifying relocations with implicit addends. This series cleans up the naming of the relocation struct in objtool, variable names, and function names to be consistent with a more generic use rather than being specific to those applying explicit addends. From there we switch to the specification compliant method of finding the section the relocations apply to and fall back to the old naming-heuristic basis if that's not available. Finally, add support for implicit addends. Note that we don't completely convert the orc tools to work with both kinds of relocations. I'm hoping to get feedback on whether it makes more sense to convert it or leave it as-is. Matt Helsley (3): objtool: Rename rela to reloc objtool: Find relocation base section using sh_info objtool: Add support for relocations without addends tools/objtool/arch.h | 2 +- tools/objtool/arch/x86/decode.c | 2 +- tools/objtool/check.c | 196 +++++++++++++------------- tools/objtool/check.h | 2 +- tools/objtool/elf.c | 237 +++++++++++++++++++++----------- tools/objtool/elf.h | 27 ++-- tools/objtool/orc_gen.c | 46 +++---- tools/objtool/special.c | 28 ++-- 8 files changed, 311 insertions(+), 229 deletions(-) base-commit: 7c0577f4e609f7278ebd6d21e2de82b42f110944 prerequisite-patch-id: 387905b1da8b1293e7736b28fcc1585583e3e7cf prerequisite-patch-id: 2fd7ac6c4dfd717ab117fc771623c01040188b4e prerequisite-patch-id: bfeefd995e3f80d6fa0edfa2205d98be31fbee4e prerequisite-patch-id: abcb5732607ad17f4c99c06b8bb83c9db1b15c42 prerequisite-patch-id: 5179e659d828bed48051d365f669a8ba3a36c206 -- 2.20.1