提交 fb136219 编写于 作者: J Julien Thierry 提交者: Josh Poimboeuf

objtool: Ignore unreachable fake jumps

It is possible for alternative code to unconditionally jump out of the
alternative region. In such a case, if a fake jump is added at the end
of the alternative instructions, the fake jump will never be reached.
Since the fake jump is just a mean to make sure code validation does not
go beyond the set of alternatives, reaching it is not a requirement.
Signed-off-by: NJulien Thierry <jthierry@redhat.com>
Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
上级 f4f80398
...@@ -2648,6 +2648,9 @@ static bool ignore_unreachable_insn(struct instruction *insn) ...@@ -2648,6 +2648,9 @@ static bool ignore_unreachable_insn(struct instruction *insn)
!strcmp(insn->sec->name, ".altinstr_aux")) !strcmp(insn->sec->name, ".altinstr_aux"))
return true; return true;
if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->offset == FAKE_JUMP_OFFSET)
return true;
if (!insn->func) if (!insn->func)
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册