From nobody Mon Feb 9 10:34:34 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FE57C001B0 for ; Fri, 23 Jun 2023 17:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbjFWRG5 (ORCPT ); Fri, 23 Jun 2023 13:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232106AbjFWRGo (ORCPT ); Fri, 23 Jun 2023 13:06:44 -0400 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726E3296F for ; Fri, 23 Jun 2023 10:06:31 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4QnkCV2b7Tz9sgZ; Fri, 23 Jun 2023 19:05:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ijUDFS2sDcLV; Fri, 23 Jun 2023 19:05:58 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4QnkCR4VThz9sgc; Fri, 23 Jun 2023 19:05:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 926EB8B780; Fri, 23 Jun 2023 19:05:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 4cLp94DbmV0O; Fri, 23 Jun 2023 19:05:55 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.232.71]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6C3D28B763; Fri, 23 Jun 2023 19:05:54 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 35NH5mCG2645789 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 23 Jun 2023 19:05:48 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 35NH5miB2645785; Fri, 23 Jun 2023 19:05:48 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin , Josh Poimboeuf , Peter Zijlstra , Sathvika Vasireddy , Naveen N Rao Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 11/15] objtool: Remove too strict constraint in jump table search Date: Fri, 23 Jun 2023 19:05:22 +0200 Message-Id: <14f2cad7af163cbd8d41521714c3cf975aed0ca4.1687539638.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687539922; l=1230; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=sRx8dCgeNVZpKuyVq5Uc0RBPaU0ysjWzONNOIlDLbc0=; b=GYxaVE5kKuRlH4J9V5SHhNRCEkIIoJ+ZJRGS7BruDVPONXAUd/ti/DtPIWZPFses0naIrX3lf eCERb6Pq+YuDdIinaxzb5PP2qMxv7w+DMB+iraTgjc+v7MPX1ZOWpLN X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In code there is often a pattern like: load jump table address do some test conditional jump to label1: do something unconditional jump to label2: label1: do something else read jump table dynamic jump label2: do other job here .... find_jump_table() contains a constraint that stops the backsearch of the table address loading when a jump is found in-between. Remove that constraint. Signed-off-by: Christophe Leroy --- tools/objtool/check.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 05d789e6d3b6..c9f0fd31d146 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2067,13 +2067,6 @@ static struct reloc *find_jump_table(struct objtool_= file *file, if (insn !=3D orig_insn && insn->type =3D=3D INSN_JUMP_DYNAMIC) break; =20 - /* allow small jumps within the range */ - if (insn->type =3D=3D INSN_JUMP_UNCONDITIONAL && - insn->jump_dest && - (insn->jump_dest->offset <=3D insn->offset || - insn->jump_dest->offset > orig_insn->offset)) - break; - table_reloc =3D arch_find_switch_table(file, insn); if (!table_reloc) continue; --=20 2.40.1