History

objtool: Remove SAVE/RESTORE hints

The SAVE/RESTORE hints are now unused; remove them.

Peter Zijlstra committed 6 years ago

Commit c536ed21 parent 9f2dfd65 files · +6 −73Browse files

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

Unified · Split

2 files
  1. tools/objtool/check.c +3 −39
  2. tools/objtool/check.h +1 −1
tools/objtool/check.c+3−39
@@ -1254,15 +1254,7 @@ static int read_unwind_hints(struct objtool_file *file) · 1253 unmodified lines
12541254
12551255 cfa = &insn->state.cfa;
12561256
1257− if (hint->type == UNWIND_HINT_TYPE_SAVE) {
1258− insn->save = true;
1259− continue;
1260−
1261− } else if (hint->type == UNWIND_HINT_TYPE_RESTORE) {
1262− insn->restore = true;
1263− insn->hint = true;
1264−
1265− } else if (hint->type == UNWIND_HINT_TYPE_RET_OFFSET) {
1257+ if (hint->type == UNWIND_HINT_TYPE_RET_OFFSET) {
12661258 insn->ret_offset = hint->sp_offset;
12671259 continue;
12681260 }
@@ -2113,37 +2105,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 844 unmodified lines
21132105 return 0;
21142106 }
21152107
2116− if (insn->hint) {
2117− if (insn->restore) {
2118− struct instruction *save_insn, *i;
2119−
2120− i = insn;
2121− save_insn = NULL;
2122− sym_for_each_insn_continue_reverse(file, func, i) {
2123− if (i->save) {
2124− save_insn = i;
2125− break;
2126− }
2127− }
2128−
2129− if (!save_insn) {
2130− WARN_FUNC("no corresponding CFI save for CFI restore",
2131− sec, insn->offset);
2132− return 1;
2133− }
2134−
2135− if (!save_insn->visited) {
2136− WARN_FUNC("objtool isn't smart enough to handle this CFI save/restore combo",
2137− sec, insn->offset);
2138− return 1;
2139− }
2140−
2141− insn->state = save_insn->state;
2142− }
2143−
2108+ if (insn->hint)
21442109 state = insn->state;
2145−
2146− } else
2110+ else
21472111 insn->state = state;
21482112
21492113 insn->visited |= visited;
tools/objtool/check.h+1−1
@@ -34,7 +34,7 @@ struct instruction { · 33 unmodified lines
3434 enum insn_type type;
3535 unsigned long immediate;
3636 bool alt_group, dead_end, ignore, ignore_alts;
37− bool hint, save, restore;
37+ bool hint;
3838 bool retpoline_safe;
3939 u8 visited;
4040 u8 ret_offset;

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