diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 8af8de2299e8..068897d5d956 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1507,6 +1507,14 @@ static bool has_modified_stack_frame(struct instruction *insn, struct insn_state if (cfi->stack_size != initial_func_cfi.cfa.offset + ret_offset) return true; + /* + * If there is a ret offset hint then don't check registers + * because a callee-saved register might have been pushed on + * the stack. + */ + if (ret_offset) + return false; + for (i = 0; i < CFI_NUM_REGS; i++) { if (cfi->regs[i].base != initial_func_cfi.regs[i].base || cfi->regs[i].offset != initial_func_cfi.regs[i].offset)