summaryrefslogtreecommitdiffstats
path: root/tools/objtool/check.h
diff options
context:
space:
mode:
authorJulien Thierry <jthierry@redhat.com>2020-09-04 16:30:23 +0100
committerJosh Poimboeuf <jpoimboe@redhat.com>2020-09-10 10:43:13 -0500
commit45245f51f9a4b9a883a8c94468473c1de9b88153 (patch)
treeea2106dc24c4668b79fb58f5167865f8eb83bd06 /tools/objtool/check.h
parenteda3dc905834dc9c99132f987f77b68cf53a8682 (diff)
downloadlinux-stable-45245f51f9a4b9a883a8c94468473c1de9b88153.tar.gz
linux-stable-45245f51f9a4b9a883a8c94468473c1de9b88153.tar.bz2
linux-stable-45245f51f9a4b9a883a8c94468473c1de9b88153.zip
objtool: Make relocation in alternative handling arch dependent
As pointed out by the comment in handle_group_alt(), support of relocation for instructions in an alternative group depends on whether arch specific kernel code handles it. So, let objtool arch specific code decide whether a relocation for the alternative section should be accepted. Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'tools/objtool/check.h')
-rw-r--r--tools/objtool/check.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/objtool/check.h b/tools/objtool/check.h
index 6cac34542122..1de1188b23cd 100644
--- a/tools/objtool/check.h
+++ b/tools/objtool/check.h
@@ -48,6 +48,12 @@ struct instruction {
#endif
};
+static inline bool is_static_jump(struct instruction *insn)
+{
+ return insn->type == INSN_JUMP_CONDITIONAL ||
+ insn->type == INSN_JUMP_UNCONDITIONAL;
+}
+
struct instruction *find_insn(struct objtool_file *file,
struct section *sec, unsigned long offset);