Skip to content

Commit fb13621

Browse files
Julien Thierryjpoimboe
authored andcommitted
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: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
1 parent f4f8039 commit fb13621

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tools/objtool/check.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,9 @@ static bool ignore_unreachable_insn(struct instruction *insn)
26482648
!strcmp(insn->sec->name, ".altinstr_aux"))
26492649
return true;
26502650

2651+
if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->offset == FAKE_JUMP_OFFSET)
2652+
return true;
2653+
26512654
if (!insn->func)
26522655
return false;
26532656

0 commit comments

Comments
 (0)