diff options
-rw-r--r-- | tools/objtool/check.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 92b6a2c..5409f6f 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1386,6 +1386,17 @@ static int update_insn_state(struct instruction *insn, struct insn_state *state) state->vals[op->dest.reg].offset = -state->stack_size; } + else if (op->src.reg == CFI_BP && op->dest.reg == CFI_SP && + cfa->base == CFI_BP) { + + /* + * mov %rbp, %rsp + * + * Restore the original stack pointer (Clang). + */ + state->stack_size = -state->regs[CFI_BP].offset; + } + else if (op->dest.reg == cfa->base) { /* mov %reg, %rsp */ |