The SAVE/RESTORE hints are now unused; remove them.
Showing the changes to tools/objtool (2 of 5 files). Show all
Unified · Split
| @@ -1254,15 +1254,7 @@ static int read_unwind_hints(struct objtool_file *file) · 1253 unmodified lines | ||
| 1254 | 1254 | |
| 1255 | 1255 | cfa = &insn->state.cfa; |
| 1256 | 1256 | |
| 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) { | |
| 1266 | 1258 | insn->ret_offset = hint->sp_offset; |
| 1267 | 1259 | continue; |
| 1268 | 1260 | } |
| @@ -2113,37 +2105,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 844 unmodified lines | ||
| 2113 | 2105 | return 0; |
| 2114 | 2106 | } |
| 2115 | 2107 | |
| 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) | |
| 2144 | 2109 | state = insn->state; |
| 2145 | − | |
| 2146 | − } else | |
| 2110 | + else | |
| 2147 | 2111 | insn->state = state; |
| 2148 | 2112 | |
| 2149 | 2113 | insn->visited |= visited; |
| @@ -34,7 +34,7 @@ struct instruction { · 33 unmodified lines | ||
| 34 | 34 | enum insn_type type; |
| 35 | 35 | unsigned long immediate; |
| 36 | 36 | bool alt_group, dead_end, ignore, ignore_alts; |
| 37 | − bool hint, save, restore; | |
| 37 | + bool hint; | |
| 38 | 38 | bool retpoline_safe; |
| 39 | 39 | u8 visited; |
| 40 | 40 | u8 ret_offset; |