Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2049492ybk; Mon, 11 May 2020 10:38:09 -0700 (PDT) X-Google-Smtp-Source: APiQypI5mf5Gg2UMrxTppeQxBQrv7ErDWIEVr9cKIQwg+HAR5+ar5n1PtfYGBX9D9sBavUyQN29N X-Received: by 2002:a05:6402:14d7:: with SMTP id f23mr9275703edx.187.1589218688983; Mon, 11 May 2020 10:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589218688; cv=none; d=google.com; s=arc-20160816; b=oNQdhb50qapNYuUhB6auNMe6cRVI2BNtUQiZYLL3D5wjavdATpJuGut4X99HrSvL5h Y3Bd9agajKkL7pjvtF4emVu+meUgCLH9a7mWMhIai5vfIREzLeJ/Fc8TU+aRhq3Barfq i0QWgOmWUir3jL2ap62E2iiR1WNpsGB5xYfbawiApGT1K767Aud6TxqaYQRbDxhC8mMT Vb0cPGVCZMzXcHIY8P+zX0Fkc1yCXrS+DeBuPpcrFbPayVxmQ9o/OtwnFWz21bIteKmO VlmzQcPdqAEsRTH7h/CwlCG4AsQ/yZvYSJXr/zBbU6yEK7RI91uT4O6pWs5OCC3wEoAo Mu/w== 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=Xkbtj/0a/H9kGLAt0ahtTdeYP+FOWqT46c7Hjb1wzok=; b=dfBYqgBTlZro9lj866M8fqKLBU1mt8w8+F6PJ100+oq9q1BpW7tyDd+eKbE0sPIRtK tzMp/9wfHOAhncO/FdqNxVmJZVZOWw/WNd8BUvRjq4vw4T5N4H+uZMZh1QviWAh34VI8 DtV8tDSynyXrHxiqosaLWYx0/BOVYRpO5MpzXUhjY48dXgKoHdoP/BbX3hLuKnLkqh/k IPL6P30ZpnC1VajZYd6QTPyDszhV/tkPfbO3bGpHOg8GZRW5GCE/iXanj4mE5O2fJrX2 idiAQdmtpd/CFOqhWq1nLFv9NoeMp4Qi1HWqvdDNny9fe/KMwqTL4bT3gTabeXG2ZAL+ ofuA== 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 f12si6749996eja.218.2020.05.11.10.37.45; Mon, 11 May 2020 10:38:08 -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 S1731037AbgEKRfi (ORCPT + 99 others); Mon, 11 May 2020 13:35:38 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:26400 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731027AbgEKRfg (ORCPT ); Mon, 11 May 2020 13:35:36 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Mon, 11 May 2020 10:35:35 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.200.192.41]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 96B59401AA; Mon, 11 May 2020 10:35:35 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Miroslav Benes , Steven Rostedt , Matt Helsley Subject: [RFC][PATCH 2/5] objtool: Move struct objtool_file into arch-independent header Date: Mon, 11 May 2020 10:35:10 -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 -- and it will be useful for any future commands that might not be part of the check / orc tooling. So we move it from the check.h header into the objtool.h header. 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