Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp909519ybb; Fri, 10 Apr 2020 12:37:22 -0700 (PDT) X-Google-Smtp-Source: APiQypK5V5EiGxkSdOOSlYGsT3kW4VkyHuYR4X8uzZrMqL8scJKFd/KmUiuiyYTQAGyUPvCpk5rB X-Received: by 2002:a37:4117:: with SMTP id o23mr5547473qka.295.1586547442781; Fri, 10 Apr 2020 12:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586547442; cv=none; d=google.com; s=arc-20160816; b=OcPBqclVuUcORqRJsLikjmc/bRvW3wNq8ry2WVDIIMVCdlFUvb0miAz5v2wnZtgZuI 8oZcL6rDpnkU3I7jghobgcCyAikTAeWkPcz7lnLnL5aAIBnbhV9WBSNZqwocKVQQLIEL KEijZdebQ4s2HB9sbcrK2zDYE2pHkb9WV2RSmX0pvsgJNMyVyGFHhxE7DIOT7wibe14C dcoSniHulcwBHFIbBKBpk1dVEVACNP4Gx6dO1H3xtoLw8rYhCtNqePpS+UX3rIa0d5gR 237c4uEiKcImW6v9msPRQSTJfvq45HnEwz5yUZyM7JQZmr/6UYn8A5Dz5mwA1tZ2CrM0 wf7w== 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=j9bvnnYNd1Yd0UB5JHtIibgKt1UNE14vIcgDatYHR48=; b=Dr9gcyNVvzyTbTv19xjPMHUI/VZVIctD77lLudX7u/n81MiEw6iMSasfRPykqE6Nyt L+9O3RbsxXt5BmxcLY2kuWZxoDeCJcp83I8pXdTgkL1KbCNAiHr1hSf33n4Tv6E9lH+M w1oLrsdH1f6eGwwru28hACAV/BwkPqddbI5/NyO3Se5SnswGaJ5PxGkDaP+ZOiF54mER F6esrKob7OOrsd6qagKdNICMwasISzYOidfDWFBpqPEegZYJZ0pnXah3extsIpGvUwGL N24eTpNBLYWH/MOLTtmwXyEn6yqiBHi40EZW9BzOkFZMpZEd9ZPEDxvxW7T4L3CFbjhO vwgg== 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 67si1959891qkm.91.2020.04.10.12.37.08; Fri, 10 Apr 2020 12:37:22 -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 S1726744AbgDJTgW (ORCPT + 99 others); Fri, 10 Apr 2020 15:36:22 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:25452 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgDJTgW (ORCPT ); Fri, 10 Apr 2020 15:36:22 -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; Fri, 10 Apr 2020 12:36:17 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.166.69.226]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 417F7B2C6E; Fri, 10 Apr 2020 15:36:21 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Ingo Molnar , Steven Rostedt , Miroslav Benes , Matt Helsley Subject: [RFC][PATCH 02/36] objtool: Move struct objtool_file into arch-independent header Date: Fri, 10 Apr 2020 12:35:25 -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 The objtool_file structure describing the files objtool works on is not architecture dependent -- it's not x86 only. So we can split it out from the check.h header that will move into arch/x86 and reuse it for future 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 f0ce8ffe7135..ec6ff7f0970c 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_reg cfa; @@ -47,13 +46,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