diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a0c518ecf085135711e8b06488381f53127d9fee..83f370fa00c2a7f84c9a1df94e5a85eae591018b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1752,11 +1752,14 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, if (insn->dead_end) return 0; - insn = next_insn; - if (!insn) { + if (!next_insn) { + if (state.cfa.base == CFI_UNDEFINED) + return 0; WARN("%s: unexpected end of section", sec->name); return 1; } + + insn = next_insn; } return 0;