Skip to content

Commit d37c90d

Browse files
Matt Helsleyjpoimboe
authored andcommitted
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: Matt Helsley <[email protected]> Reviewed-by: Julien Thierry <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]>
1 parent f15c648 commit d37c90d

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

tools/objtool/check.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
#define _CHECK_H
88

99
#include <stdbool.h>
10-
#include "elf.h"
10+
#include "objtool.h"
1111
#include "cfi.h"
1212
#include "arch.h"
1313
#include "orc.h"
14-
#include <linux/hashtable.h>
1514

1615
struct insn_state {
1716
struct cfi_state cfi;
@@ -48,13 +47,6 @@ struct instruction {
4847
struct orc_entry orc;
4948
};
5049

51-
struct objtool_file {
52-
struct elf *elf;
53-
struct list_head insn_list;
54-
DECLARE_HASHTABLE(insn_hash, 20);
55-
bool ignore_unreachables, c_file, hints, rodata;
56-
};
57-
5850
int check(const char *objname, bool orc);
5951

6052
struct instruction *find_insn(struct objtool_file *file,

tools/objtool/objtool.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* Copyright (C) 2020 Matt Helsley <[email protected]>
4+
*/
5+
6+
#ifndef _OBJTOOL_H
7+
#define _OBJTOOL_H
8+
9+
#include <stdbool.h>
10+
#include <linux/list.h>
11+
#include <linux/hashtable.h>
12+
13+
#include "elf.h"
14+
15+
struct objtool_file {
16+
struct elf *elf;
17+
struct list_head insn_list;
18+
DECLARE_HASHTABLE(insn_hash, 20);
19+
bool ignore_unreachables, c_file, hints, rodata;
20+
};
21+
22+
#endif /* _OBJTOOL_H */

0 commit comments

Comments
 (0)