summaryrefslogtreecommitdiff
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorAlexandre Chartre <alexandre.chartre@oracle.com>2025-11-21 10:53:23 +0100
committerPeter Zijlstra <peterz@infradead.org>2025-11-21 15:30:11 +0100
commitd490aa21973fe66ec35ad825c19f88ac7f7abb27 (patch)
tree9d4b97f57ea2b3c5834f2ce41531657d93f7d03a /tools/objtool/include
parent26a453fb5637907a538d6ea5ef23651142811e15 (diff)
objtool: Identify the different types of alternatives
Alternative code, including jump table and exception table, is represented with the same struct alternative structure. But there is no obvious way to identify whether the struct represents alternative instructions, a jump table or an exception table. So add a type to struct alternative to clearly identify the type of alternative. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://patch.msgid.link/20251121095340.464045-14-alexandre.chartre@oracle.com
Diffstat (limited to 'tools/objtool/include')
-rw-r--r--tools/objtool/include/objtool/check.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/objtool/include/objtool/check.h b/tools/objtool/include/objtool/check.h
index fde958683485..cbf4af58e29b 100644
--- a/tools/objtool/include/objtool/check.h
+++ b/tools/objtool/include/objtool/check.h
@@ -38,6 +38,18 @@ struct alt_group {
bool ignore;
};
+enum alternative_type {
+ ALT_TYPE_INSTRUCTIONS,
+ ALT_TYPE_JUMP_TABLE,
+ ALT_TYPE_EX_TABLE,
+};
+
+struct alternative {
+ struct alternative *next;
+ struct instruction *insn;
+ enum alternative_type type;
+};
+
#define INSN_CHUNK_BITS 8
#define INSN_CHUNK_SIZE (1 << INSN_CHUNK_BITS)
#define INSN_CHUNK_MAX (INSN_CHUNK_SIZE - 1)