Commit fb136219 authored by Julien Thierry's avatar Julien Thierry Committed by Josh Poimboeuf
Browse files

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: default avatarJulien Thierry <jthierry@redhat.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent f4f80398
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2648,6 +2648,9 @@ static bool ignore_unreachable_insn(struct instruction *insn)
	    !strcmp(insn->sec->name, ".altinstr_aux"))
		return true;

	if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->offset == FAKE_JUMP_OFFSET)
		return true;

	if (!insn->func)
		return false;