arm64: Delay initialisation of cpuinfo_arm64::reg_{zcr,smcr}
[linux-2.6-microblaze.git] / tools / objtool / include / objtool / objtool.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
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 <objtool/elf.h>
14
15 #define __weak __attribute__((weak))
16
17 struct pv_state {
18         bool clean;
19         struct list_head targets;
20 };
21
22 struct objtool_file {
23         struct elf *elf;
24         struct list_head insn_list;
25         DECLARE_HASHTABLE(insn_hash, 20);
26         struct list_head retpoline_call_list;
27         struct list_head static_call_list;
28         struct list_head mcount_loc_list;
29         struct list_head endbr_list;
30         bool ignore_unreachables, hints, rodata;
31
32         unsigned int nr_endbr;
33         unsigned int nr_endbr_int;
34
35         unsigned long jl_short, jl_long;
36         unsigned long jl_nop_short, jl_nop_long;
37
38         struct pv_state *pv_ops;
39 };
40
41 struct objtool_file *objtool_open_read(const char *_objname);
42
43 void objtool_pv_add(struct objtool_file *file, int idx, struct symbol *func);
44
45 int check(struct objtool_file *file);
46 int orc_dump(const char *objname);
47 int orc_create(struct objtool_file *file);
48
49 #endif /* _OBJTOOL_H */