History

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.

Alexandre Chartre committed 11 months ago

Commit d490aa21 parent 26a453f2 files · +20 −5Browse files

Showing the changes to tools/objtool/include/objtool (1 of 2 files). Show all

Unified · Split

tools/objtool/include/objtool/check.h+12−0
@@ -38,6 +38,18 @@ struct alt_group { · 37 unmodified lines
38 bool ignore;38 bool ignore;
39};39};
40 40
41enum alternative_type {
42 ALT_TYPE_INSTRUCTIONS,
43 ALT_TYPE_JUMP_TABLE,
44 ALT_TYPE_EX_TABLE,
45};
46
47struct alternative {
48 struct alternative *next;
49 struct instruction *insn;
50 enum alternative_type type;
51};
52
41#define INSN_CHUNK_BITS 853#define INSN_CHUNK_BITS 8
42#define INSN_CHUNK_SIZE (1 << INSN_CHUNK_BITS)54#define INSN_CHUNK_SIZE (1 << INSN_CHUNK_BITS)
43#define INSN_CHUNK_MAX (INSN_CHUNK_SIZE - 1)55#define INSN_CHUNK_MAX (INSN_CHUNK_SIZE - 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t