Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp2384860pjr; Tue, 19 May 2020 13:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx385UR6Vhfa+QscDQ8jropf2uiATMw8qYB7INV038tuZ1WvYjH++EMCXfTnjytuj+DMSrb X-Received: by 2002:a05:6402:b38:: with SMTP id bo24mr686488edb.24.1589921908849; Tue, 19 May 2020 13:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589921908; cv=none; d=google.com; s=arc-20160816; b=ohMmdQTXrJy6gucgGPBphe94UGkODqV01/GOhsnG6nIb2mFMOt0iaIE4w2Pz3bwMEP NGF71ocvlQDYWJhR5//i5FpwjdZVZ/kwYWZNjjRFScE8bt7HqxFB3Oz8GWZbtYwD1/hC x0EMyDC2EWbgb383M/WnPeV5wNyCG3haCHDgj8j/rHU+EB7dT0K00g1QibQqmotg3ZWu 8byc35WPh+u9V9+gv53BA3a+viWzBniHzDBgCbyLzxEsL3XVKTviR1/mt5CjoKQ3RHMa lCLbTQno3+4AQX7nMx76zfr9J1au3TeTuBXu28jTvQplE24wU+yC5iD4LxDNzzS02jDL rnMA== 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=lAsdkrzKl7KnMfrB8JMjUThMPS/9sMebfhrQ6HoGx0o=; b=OnXj+KxhLG1tCVwMzrFh8/wTj2QmC6NbVgEfEbPqwhhTrTr1+KYfQ0OwWN3HcwWK3a 75ZByjMcxtkKVdMZLrnQh2MWSdg5fhiwdpvx/WJ/YdwuHrX3DPzM1z0SGwXUm39XnNxv mD2+S01C32AWT3sw1ndjkfxSD8X9+/0eYa/A5rYw2Ei2fNpme7fPZ5b1nCZTnwH3e6xR A4T/GuLYTD0KdgYC4ROMjlYbZ3pubo1FjqKiBlx4cMIzYOaOn7gURIX80SULGJxFIzGZ VaFCJIVntMQRBIqsz+yIVuCrArOr/pL1eEq6CjK3adB5Rt6I95MXnunBFwbUabpiJBGJ Ffog== 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 x7si534392eje.542.2020.05.19.13.58.06; Tue, 19 May 2020 13:58:28 -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 S1726985AbgESUz7 (ORCPT + 99 others); Tue, 19 May 2020 16:55:59 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:4154 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbgESUz4 (ORCPT ); Tue, 19 May 2020 16:55:56 -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; Tue, 19 May 2020 13:55:54 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.200.192.41]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id EF279404B7; Tue, 19 May 2020 13:55:55 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Miroslav Benes , Steven Rostedt , Matt Helsley Subject: [PATCH 2/3] objtool: Move struct objtool_file into arch-independent header Date: Tue, 19 May 2020 13:55:32 -0700 Message-ID: <8a877bc283cbad704c7472ac3ef534d49629dd05.1589913349.git.mhelsley@vmware.com> 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-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 The objtool_file structure describes the files objtool works on, is used by the check subcommand, and the check.h header is included by the orc subcommands so it's presently used by all subcommands. Since the structure will be useful in all subcommands besides check, and some subcommands may not want to include check.h to get the definition, split the structure out into a new header meant for use by all objtool subcommands. Signed-off-by: Matt Helsley --- tools/objtool/check.h | 10 +--------- tools/objtool/objtool.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 tools/objtool/objtool.h diff --git a/tools/objtool/check.h b/tools/objtool/check.h index 24280227ef21..3b59a1cbcff5 100644 --- a/tools/objtool/check.h +++ b/tools/objtool/check.h @@ -7,11 +7,10 @@ #define _CHECK_H #include -#include "elf.h" +#include "objtool.h" #include "cfi.h" #include "arch.h" #include "orc.h" -#include struct insn_state { struct cfi_state cfi; @@ -48,13 +47,6 @@ struct instruction { struct orc_entry orc; }; -struct objtool_file { - struct elf *elf; - struct list_head insn_list; - DECLARE_HASHTABLE(insn_hash, 20); - bool ignore_unreachables, c_file, hints, rodata; -}; - int check(const char *objname, bool orc); struct instruction *find_insn(struct objtool_file *file, diff --git a/tools/objtool/objtool.h b/tools/objtool/objtool.h new file mode 100644 index 000000000000..afa52fe6f644 --- /dev/null +++ b/tools/objtool/objtool.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2020 Matt Helsley + */ + +#ifndef _OBJTOOL_H +#define _OBJTOOL_H +#include +#include +#include + +#include "elf.h" + +struct objtool_file { + struct elf *elf; + struct list_head insn_list; + DECLARE_HASHTABLE(insn_hash, 20); + bool ignore_unreachables, c_file, hints, rodata; +}; +#endif -- 2.20.1