summaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorJulien Thierry <jthierry@redhat.com>2020-09-15 08:53:17 +0100
committerJosh Poimboeuf <jpoimboe@redhat.com>2020-09-18 12:04:00 -0500
commitfb136219f0e2b417d84e67b2a3adc1f933997d04 (patch)
treedd116fdecbb246823a8e808069882416b0b0a242 /tools/objtool
parentf4f803984c3685f416a74e9e2fa7d39bdafbe02b (diff)
downloadlinux-fb136219f0e2b417d84e67b2a3adc1f933997d04.tar.gz
linux-fb136219f0e2b417d84e67b2a3adc1f933997d04.tar.bz2
linux-fb136219f0e2b417d84e67b2a3adc1f933997d04.zip
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>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index fd2edab8e672..cd7c6698d316 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -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;