From patchwork Wed Jun 22 10:13:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Zhongjin X-Patchwork-Id: 12890446 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A15A8C43334 for ; Wed, 22 Jun 2022 10:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pjeW2xvW24Q/O/Af+Oh7wCDIrsWoQq4L9OsNbMmBxIM=; b=znFT5S/AJWqClo VEy7avHqfGP03DYRcFgDZk1GtNK5wltHituWUbkKluagSytNmeGe516ZpPltOHiFZpvdCQXShhPJq L/h+2SmeZusdtNuF4AjoTqL0sMkGWiGRWK4OCr5/oqpmBO8gYW30mwkSoD18xy/OjQPUz7XIcgF9C hzW7oss6ULkh+0Bgr6h0tU0VevcuquZdFapTzFsyv/cepSlOHiDvgD8TzhaK42UY8zib0O5YxitYM DVQCd/XWK9eGJ9ypU0GDAeoLl8DqZIb2xk8eZ68fZbMGkEt0+0LoxMgHXv2kWuiDzhe4kxWEx1zsP KuAiuRbUpD7eT9Hl0WzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3xQN-009p3A-9e; Wed, 22 Jun 2022 10:17:27 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3xP7-009oSi-8v for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 10:16:14 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LSfMV4mZMzShB9; Wed, 22 Jun 2022 18:12:38 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 22 Jun 2022 18:15:57 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 22 Jun 2022 18:15:56 +0800 From: Chen Zhongjin To: , , , , , CC: , , , , , Subject: [PATCH v2 5/5] objtool: use arch_jump_destination in read_intra_function_calls Date: Wed, 22 Jun 2022 18:13:44 +0800 Message-ID: <20220622101344.38002-6-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220622101344.38002-1-chenzhongjin@huawei.com> References: <20220622101344.38002-1-chenzhongjin@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_031609_534485_80DC9104 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we use arch_jump_destination() instead of offset + len + immediate for jump destination. But in read_intra_function_calls it didn't get changed. Fix it. Signed-off-by: Chen Zhongjin --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 11ab13fd99fd..35d0a1bc4279 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2127,7 +2127,7 @@ static int read_intra_function_calls(struct objtool_file *file) */ insn->type = INSN_JUMP_UNCONDITIONAL; - dest_off = insn->offset + insn->len + insn->immediate; + dest_off = arch_jump_destination(insn); insn->jump_dest = find_insn(file, insn->sec, dest_off); if (!insn->jump_dest) { WARN_FUNC("can't find call dest at %s+0x%lx",