summaryrefslogtreecommitdiff
path: root/tools/objtool/arch.h
diff options
context:
space:
mode:
authorRaphael Gault <raphael.gault@arm.com>2020-03-27 18:28:45 +0300
committerIngo Molnar <mingo@kernel.org>2020-04-22 11:53:49 +0300
commitbfb08f220312a4634532114eb3e7062f17dfb707 (patch)
tree4453926dd61754ee451d2139cecd07b3e52d9abb /tools/objtool/arch.h
parentaff5e16918c3706622b138ea82391d6c597c5660 (diff)
downloadlinux-bfb08f220312a4634532114eb3e7062f17dfb707.tar.xz
objtool: Add abstraction for destination offsets
The jump and call destination relocation offsets are x86-specific. Abstract them by calling arch-specific implementations. [ jthierry: Remove superfluous comment; replace other addend offsets with arch_dest_rela_offset() ] Signed-off-by: Raphael Gault <raphael.gault@arm.com> Signed-off-by: Julien Thierry <jthierry@redhat.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool/arch.h')
-rw-r--r--tools/objtool/arch.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/objtool/arch.h b/tools/objtool/arch.h
index ced3765c4f44..a9a50a25ca66 100644
--- a/tools/objtool/arch.h
+++ b/tools/objtool/arch.h
@@ -66,6 +66,8 @@ struct stack_op {
struct op_src src;
};
+struct instruction;
+
void arch_initial_func_cfi_state(struct cfi_state *state);
int arch_decode_instruction(struct elf *elf, struct section *sec,
@@ -75,4 +77,8 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
bool arch_callee_saved_reg(unsigned char reg);
+unsigned long arch_jump_destination(struct instruction *insn);
+
+unsigned long arch_dest_rela_offset(int addend);
+
#endif /* _ARCH_H */