Commit d37c90d4 authored by Matt Helsley's avatar Matt Helsley Committed by Josh Poimboeuf

objtool: Move struct objtool_file into arch-independent header

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: default avatarMatt Helsley <mhelsley@vmware.com>
Reviewed-by: default avatarJulien Thierry <jthierry@redhat.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent f15c648f
...@@ -7,11 +7,10 @@ ...@@ -7,11 +7,10 @@
#define _CHECK_H #define _CHECK_H
#include <stdbool.h> #include <stdbool.h>
#include "elf.h" #include "objtool.h"
#include "cfi.h" #include "cfi.h"
#include "arch.h" #include "arch.h"
#include "orc.h" #include "orc.h"
#include <linux/hashtable.h>
struct insn_state { struct insn_state {
struct cfi_state cfi; struct cfi_state cfi;
...@@ -48,13 +47,6 @@ struct instruction { ...@@ -48,13 +47,6 @@ struct instruction {
struct orc_entry orc; 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); int check(const char *objname, bool orc);
struct instruction *find_insn(struct objtool_file *file, struct instruction *find_insn(struct objtool_file *file,
......
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
*/
#ifndef _OBJTOOL_H
#define _OBJTOOL_H
#include <stdbool.h>
#include <linux/list.h>
#include <linux/hashtable.h>
#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 /* _OBJTOOL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment