提交 9e73ae6b 编写于 作者: J Josh Poimboeuf 提交者: Zheng Zengkai

objtool: Fix error handling for STD/CLD warnings

stable inclusion
from stable-5.10.20
commit 9e06f36658dfc50b8500aa3b2a680f4a8f11bbc7
bugzilla: 50608

--------------------------------

[ Upstream commit 6f567c93 ]

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

Fixes: 2f0f9e9a ("objtool: Add Direction Flag validation")
Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/dc70f2adbc72f09526f7cab5b6feb8bf7f6c5ad4.1611263461.git.jpoimboe@redhat.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 61955b35
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册