Commit 6f567c93 authored by Josh Poimboeuf's avatar Josh Poimboeuf

objtool: Fix error handling for STD/CLD warnings

Actually return an error (and display a backtrace, if requested) for
directional bit warnings.

Fixes: 2f0f9e9a ("objtool: Add Direction Flag validation")
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/dc70f2adbc72f09526f7cab5b6feb8bf7f6c5ad4.1611263461.git.jpoimboe@redhat.com
parent c9c324dc
......@@ -2651,15 +2651,19 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
break;
case INSN_STD:
if (state.df)
if (state.df) {
WARN_FUNC("recursive STD", sec, insn->offset);
return 1;
}
state.df = true;
break;
case INSN_CLD:
if (!state.df && func)
if (!state.df && func) {
WARN_FUNC("redundant CLD", sec, insn->offset);
return 1;
}
state.df = false;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment