linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] objtool: fix rare switch jump table pattern detection
Date: Wed, 26 Oct 2016 10:34:08 -0500	[thread overview]
Message-ID: <20161026153408.2rifnw7bvoc5sex7@treble> (raw)
In-Reply-To: <3971280.DNU2zoGODW@wuerfel>

The following commit:

  3732710ff6f2 ("objtool: Improve rare switch jump table pattern detection")

... improved objtool's ability to detect gcc switch statement jump
tables for gcc 6.  However the check to allow short jumps with the
scanned range of instructions wasn't quite right.  The pattern detection
should allow jumps to the indirect jump instruction itself.

This fixes the following warning:

  drivers/infiniband/sw/rxe/rxe_comp.o: warning: objtool: rxe_completer()+0x315: sibling call from callable instruction with changed frame pointer

Reported-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 3732710ff6f2 ("objtool: Improve rare switch jump table pattern detection")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 tools/objtool/builtin-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 4490601..e8a1f69 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -754,7 +754,7 @@ static struct rela *find_switch_table(struct objtool_file *file,
 		if (insn->type == INSN_JUMP_UNCONDITIONAL &&
 		    insn->jump_dest &&
 		    (insn->jump_dest->offset <= insn->offset ||
-		     insn->jump_dest->offset >= orig_insn->offset))
+		     insn->jump_dest->offset > orig_insn->offset))
 		    break;
 
 		text_rela = find_rela_by_dest_range(insn->sec, insn->offset,
-- 
2.7.4

  parent reply	other threads:[~2016-10-26 15:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 21:22 [PATCH 0/2] objtool: a couple of minor fixes Josh Poimboeuf
2016-10-13 21:22 ` [PATCH 1/2] objtool: improve rare switch jump table pattern detection Josh Poimboeuf
2016-10-16 11:18   ` [tip:core/urgent] objtool: Improve " tip-bot for Josh Poimboeuf
2016-10-13 21:22 ` [PATCH 2/2] objtool: skip all "unreachable instruction" warnings for gcov kernels Josh Poimboeuf
2016-10-16 11:18   ` [tip:core/urgent] objtool: Skip " tip-bot for Josh Poimboeuf
2016-10-26  7:58 ` [PATCH 0/2] objtool: a couple of minor fixes Arnd Bergmann
2016-10-26  9:16   ` Arnd Bergmann
2016-10-26 12:37   ` Josh Poimboeuf
2016-10-26 12:43     ` Josh Poimboeuf
2016-10-26 13:18       ` Josh Poimboeuf
2016-10-26 15:34   ` Josh Poimboeuf [this message]
2016-10-26 16:03     ` [PATCH] objtool: fix rare switch jump table pattern detection Arnd Bergmann
2016-10-26 16:45       ` Josh Poimboeuf
2016-10-27  7:37     ` [tip:core/urgent] objtool: Fix " tip-bot for Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161026153408.2rifnw7bvoc5sex7@treble \
    --to=jpoimboe@redhat.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).