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
1254 1254
1255 cfa = &insn->state.cfa;1255 cfa = &insn->state.cfa;
1256 1256
1257 if (hint->type == UNWIND_HINT_TYPE_SAVE) {1257 if (hint->type == UNWIND_HINT_TYPE_RET_OFFSET) {
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) {
1266 insn->ret_offset = hint->sp_offset;1258 insn->ret_offset = hint->sp_offset;
1267 continue;1259 continue;
1268 }1260 }
@@ -2113,37 +2105,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 844 unmodified lines
2113 return 0;2105 return 0;
2114 }2106 }
2115 2107
2116 if (insn->hint) {2108 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
2144 state = insn->state;2109 state = insn->state;
2145 2110 else
2146 } else
2147 insn->state = state;2111 insn->state = state;
2148 2112
2149 insn->visited |= visited;2113 insn->visited |= visited;
tools/objtool/check.h+1−1
@@ -34,7 +34,7 @@ struct instruction { · 33 unmodified lines
34 enum insn_type type;34 enum insn_type type;
35 unsigned long immediate;35 unsigned long immediate;
36 bool alt_group, dead_end, ignore, ignore_alts;36 bool alt_group, dead_end, ignore, ignore_alts;
37 bool hint, save, restore;37 bool hint;
38 bool retpoline_safe;38 bool retpoline_safe;
39 u8 visited;39 u8 visited;
40 u8 ret_offset;40 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