summaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorAlexandre Chartre <alexandre.chartre@oracle.com>2020-04-07 09:31:35 +0200
committerPeter Zijlstra <peterz@infradead.org>2020-04-30 20:14:32 +0200
commitc721b3f80faebc7891211fa82de303eebadfed15 (patch)
tree0f1258e019372fb4577b689010ed19592e1b3892 /tools/objtool
parent87cf61fe848ca8ddf091548671e168f52e8a718e (diff)
downloadlinux-c721b3f80faebc7891211fa82de303eebadfed15.tar.gz
linux-c721b3f80faebc7891211fa82de303eebadfed15.tar.bz2
linux-c721b3f80faebc7891211fa82de303eebadfed15.zip
objtool: UNWIND_HINT_RET_OFFSET should not check registers
UNWIND_HINT_RET_OFFSET will adjust a modified stack. However if a callee-saved register was pushed on the stack then the stack frame will still appear modified. So stop checking registers when UNWIND_HINT_RET_OFFSET is used. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20200407073142.20659-3-alexandre.chartre@oracle.com
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c8
1 files changed, 8 insertions, 0 deletions
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)