Skip to content

Commit

Permalink
objtool: Fix error handling for STD/CLD warnings
Browse files Browse the repository at this point in the history
[ Upstream commit 6f567c9 ]

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

Fixes: 2f0f9e9 ("objtool: Add Direction Flag validation")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/dc70f2adbc72f09526f7cab5b6feb8bf7f6c5ad4.1611263461.git.jpoimboe@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jpoimboe authored and gregkh committed Mar 4, 2021
1 parent 994334f commit 9e06f36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/objtool/check.c
Expand Up @@ -2592,15 +2592,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;
Expand Down

0 comments on commit 9e06f36

Please sign in to comment.