summaryrefslogtreecommitdiffstats
path: root/tools/objtool/special.h
diff options
context:
space:
mode:
authorRaphael Gault <raphael.gault@arm.com>2020-09-04 16:30:24 +0100
committerJosh Poimboeuf <jpoimboe@redhat.com>2020-09-10 10:43:13 -0500
commitd871f7b5a6a2a30f4eba577fd56941fa3657e394 (patch)
treee5eb59adf65e56f36dbd79dbfbdefa8f32751659 /tools/objtool/special.h
parent45245f51f9a4b9a883a8c94468473c1de9b88153 (diff)
downloadlinux-d871f7b5a6a2a30f4eba577fd56941fa3657e394.tar.bz2
objtool: Refactor jump table code to support other architectures
The way to identify jump tables and retrieve all the data necessary to handle the different execution branches is not the same on all architectures. In order to be able to add other architecture support, define an arch-dependent function to process jump-tables. Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Raphael Gault <raphael.gault@arm.com> [J.T.: Move arm64 bits out of this patch, Have only one function to find the start of the jump table, for now assume that the jump table format will be the same as x86] Signed-off-by: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'tools/objtool/special.h')
-rw-r--r--tools/objtool/special.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/objtool/special.h b/tools/objtool/special.h
index 1dc1bb3e74c6..abddf38ef334 100644
--- a/tools/objtool/special.h
+++ b/tools/objtool/special.h
@@ -10,6 +10,8 @@
#include "check.h"
#include "elf.h"
+#define C_JUMP_TABLE_SECTION ".rodata..c_jump_table"
+
struct special_alt {
struct list_head list;
@@ -34,4 +36,6 @@ void arch_handle_alternative(unsigned short feature, struct special_alt *alt);
bool arch_support_alt_relocation(struct special_alt *special_alt,
struct instruction *insn,
struct reloc *reloc);
+struct reloc *arch_find_switch_table(struct objtool_file *file,
+ struct instruction *insn);
#endif /* _SPECIAL_H */