1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
14 #include <linux/hashtable.h>
18 struct cfi_reg regs
[CFI_NUM_REGS
];
22 bool drap
, end
, uaccess
, df
;
23 unsigned int uaccess_stack
;
24 int drap_reg
, drap_offset
;
25 struct cfi_reg vals
[CFI_NUM_REGS
];
29 struct list_head list
;
30 struct hlist_node hash
;
35 unsigned long immediate
;
36 bool alt_group
, dead_end
, ignore
, hint
, save
, restore
, ignore_alts
;
39 struct symbol
*call_dest
;
40 struct instruction
*jump_dest
;
41 struct instruction
*first_jump_src
;
42 struct rela
*jump_table
;
43 struct list_head alts
;
45 struct stack_op stack_op
;
46 struct insn_state state
;
52 struct list_head insn_list
;
53 DECLARE_HASHTABLE(insn_hash
, 16);
54 bool ignore_unreachables
, c_file
, hints
, rodata
;
57 int check(const char *objname
, bool orc
);
59 struct instruction
*find_insn(struct objtool_file
*file
,
60 struct section
*sec
, unsigned long offset
);
62 #define for_each_insn(file, insn) \
63 list_for_each_entry(insn, &file->insn_list, list)
65 #define sec_for_each_insn(file, sec, insn) \
66 for (insn = find_insn(file, sec, 0); \
67 insn && &insn->list != &file->insn_list && \
69 insn = list_next_entry(insn, list))