aboutsummaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2021-01-21 15:29:17 -0600
committerJosh Poimboeuf <jpoimboe@redhat.com>2021-01-26 11:11:59 -0600
commit6f567c9300a5ebd7b18c26dda1c8d6ffbdd0debd (patch)
treeacf4b8ddd78d016bae14aa2ee22b3f1d19a95323 /tools/objtool
parentobjtool: Support stack layout changes in alternatives (diff)
downloadlinux-dev-6f567c9300a5ebd7b18c26dda1c8d6ffbdd0debd.tar.xz
linux-dev-6f567c9300a5ebd7b18c26dda1c8d6ffbdd0debd.zip
objtool: Fix error handling for STD/CLD warnings
Actually return an error (and display a backtrace, if requested) for directional bit warnings. Fixes: 2f0f9e9ad7b3 ("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
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 270b507e7098..3bdd946c2027 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -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;