diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e308d1ba664e..e3fc263b1b20 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3604,6 +3604,18 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, } if (!save_insn->visited) { + /* + * If the restore hint insn is at the + * beginning of a basic block and was + * branched to from elsewhere, and the + * save insn hasn't been visited yet, + * defer following this branch for now. + * It will be seen later via the + * straight-line path. + */ + if (!prev_insn) + return 0; + WARN_INSN(insn, "objtool isn't smart enough to handle this CFI save/restore combo"); return 1; }