From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 C0394E78D45 for ; Mon, 9 Feb 2026 08:49:46 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4f8dfZ2082z3bkq; Mon, 09 Feb 2026 19:49:26 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770626966; cv=none; b=HbF5DIcn3jkthIMjzpDblaQx5ocY23bsUAOEC/tuXCnBwjbJAebpe1MxK6but9gk4u01bY9W1n/bVhwwqHQ+1f+JS7xFwDuBl97HJZUEGVaZgvoK33mVfyMX+b1NXcov8E6NV3YDjkKq0U06nk5tslR9hl6S9ijWtgSJGjTifaGbq38x6YlXvAbQWd5dzUPTi2vf2TC+r6Te2aXxbIvzDnkrndEIyRFJvHDqTWaca+YUkfoXD4repZAzsAbdO6149tc473gn06oW4t2Z62131dHFoZajdUpHJvgsLjo9XhdMLn/woNoMDlW2WwWVjDkpQR8F8zI3UQXOv8a7G0v5HA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770626966; c=relaxed/relaxed; bh=6pTFAo/qNgU6OYUJNOjZ00Qdyl2NOyAzAlaEd2uhLNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gH9vQqUafnQRvE8FqyB1D6/gLmhN1QHIf7mlA+K3UnZ3rbJVEMi5FcKGb78QamxaDM41iVfdAq/SRTLomzwNyKObA0/btCgiRqEr9YG59ebC62g9MgkEk1XnV+m5vetro4Mpu6xtcV/ddZdTXmdse6Kw+O1GyNAfBVUcSymEc3Ry+QiejSAM9+fnzVvZ9DDuJl8gdJPfDbUrJ9Nhm8g5kGxJxDdbY23q5n0WOCsQ9frhNEbdJhiGUuYZRCz0dehV2eIZ0WkiETDf41sB2IrkpQ/UDvTfJeu04vWugjajxLRBrUBoV4SlxNHZHfvUNgOBgMC1z5799R5j2sTRDDYXBw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=qWztqHfi; dkim-atps=neutral; spf=pass (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=sv@linux.ibm.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=qWztqHfi; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=sv@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4f8dfY1xM6z30T8 for ; Mon, 09 Feb 2026 19:49:25 +1100 (AEDT) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6191c5ap693544; Mon, 9 Feb 2026 08:49:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=6pTFAo/qNgU6OYUJN OjZ00Qdyl2NOyAzAlaEd2uhLNU=; b=qWztqHfiEpwpI4HhhBtIrDr9C4e4Xgl4V fdZ9VoSH4f0dvsgwDRqrWOvwxMgawnbPoMCl1p1jW7hl+GXF/dfTGssF6pb0e+xW QmYk7I3xL7pPR1VUkQotJYBa+uFzfIga3iuYFZv+wbSsS8v3r8G8D9T5i0OrEw++ iSi/vviq1naoLblYvlbOVcxIQB4Y3ODadmp3/bNELFgBLVFOXSAQzjrE2oyQBRfL sfCCN+ymmPzWaM6wOtGGBYJVGD+jUAwAUJA+BiYfaZvbmBeBK82oaSLJHO0iurwY 9bDbHbfVX8Ck7KHA8ur/oY38XgoVOLc4AWdrg8oi1mHLVfhp+1Now== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c696vx67m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Feb 2026 08:49:08 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 6194I9X6019336; Mon, 9 Feb 2026 08:49:07 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c6hxjv84b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Feb 2026 08:49:07 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6198n39Q53543224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Feb 2026 08:49:03 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7634D20040; Mon, 9 Feb 2026 08:49:03 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B48A22004D; Mon, 9 Feb 2026 08:48:59 +0000 (GMT) Received: from li-2fa77bcc-2701-11b2-a85c-cd621c23b6bd.in.ibm.com (unknown [9.79.195.233]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 9 Feb 2026 08:48:59 +0000 (GMT) From: Sathvika Vasireddy To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: nathan@kernel.org, masahiroy@kernel.org, kees@kernel.org, naveen@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, npiggin@gmail.com, maddy@linux.ibm.com, segher@kernel.crashing.org, christophe.leroy@csgroup.eu, mingo@kernel.org, mpe@ellerman.id.au, sv@linux.ibm.com, nsc@kernel.org Subject: [RFC PATCH v3 4/6] objtool/powerpc: Skip jump destination analysis and unnanotated intra-function call warnings for --ftr-fixup Date: Mon, 9 Feb 2026 14:18:18 +0530 Message-ID: <20260209084820.57298-5-sv@linux.ibm.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260209084820.57298-1-sv@linux.ibm.com> References: <20260209084820.57298-1-sv@linux.ibm.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=YeCwJgRf c=1 sm=1 tr=0 ts=69899f84 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=8-sZ6GPjQPUUxCpKAYwA:9 X-Proofpoint-GUID: qDkfc-DJNCXacmFDikyxmhcNuGda5RJQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA5MDA3MiBTYWx0ZWRfX+Ld5l8kAw2q7 7eUbqIrsR7xEkqth1IaLV4St1LEvU4oZQY7P3puTEAJUrxEsm5TbXzxcF7NJWN2rKsBLyeq+B0R 1TW9aiAkkXUfspi9BNa8UQTPSpvwSZ1qMgj+bxfyYWzosqHKnGXhaRllDGsWsmGPy0hTcMWn0kD OMsJsaGSG7E306m/OPY2/wf37N2n2mZVuHX/W4g3WG3o88Nzq2Q0Q578iRSJPfEal5IjeEGP+So WTugZr9Kz3QHYiAeheCOaWn6Zpwt3cIhitEPcIffMgH9wy7/Sl0a4WBZt4nFev8qnlUbLZphDkP /zEQquIVSRwkKkOwshRCRDUu0oBkP/URk7Ww+dKot5wHD1a9y2MWpFqlxcBXQqnI0uHL79/gny0 Cuwl7CY6fX0E8bCHbUO0YwzUxdxEqQO0j6Txvm67YG8F0q4SLs0s05myS8rIi+9VQZ83g+rIz2U 7ysMbEiPKgfKe2i3zQg== X-Proofpoint-ORIG-GUID: hlklK367W2znF8mxiCFFgnhIl6K75Mtr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-08_05,2026-02-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602090072 Objtool is throwing unannotated intra-function call warnings when run on vmlinux with --ftr-fixup option. One such example: vmlinux: warning: objtool: .text+0x3d94: unannotated intra-function call .text + 0x3d94 = c000000000008000 + 3d94 = c0000000000081d4 c0000000000081d4: 45 24 02 48 bl c00000000002a618 c00000000002a610 : c00000000002a610: 0e 01 4c 3c addis r2,r12,270 c00000000002a610: R_PPC64_REL16_HA .TOC. c00000000002a614: f0 6c 42 38 addi r2,r2,27888 c00000000002a614: R_PPC64_REL16_LO .TOC.+0x4 c00000000002a618: a6 02 08 7c mflr r0 This is happening because we should be looking for destination symbols that are at absolute offsets instead of relative offsets. After fixing dest_off to point to absolute offset, there are still a lot of these warnings shown. In the above example, objtool is computing the destination offset to be c00000000002a618, which points to a completely different instruction. find_call_destination() is looking for this offset and failing. Instead, we should be looking for destination offset c00000000002a610 which points to system_reset_exception function. Even after fixing the way destination offset is computed, and after looking for dest_off - 0x8 in cases where the original offset is not found, there are still a lot of unannotated intra-function call warnings generated. This is due to symbols that are not properly annotated. So, for now, as a hack to curb these warnings, do not emit unannotated intra-function call warnings when objtool is run with --ftr-fixup option. Skip add_jump_destinations() and suppress intra-function call errors in --ftr-fixup mode. The feature fixup pass only needs fixup entry tables, relocation entries from .__ftr_alternates.text, and elf_write_insn() to patch branch offsets. Signed-off-by: Sathvika Vasireddy --- tools/objtool/check.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 92fe5dc05cdb..9c6b892792a4 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1598,7 +1598,6 @@ static int add_jump_destinations(struct objtool_file *file) dest_off == func->offset + func->len) continue; - ERROR_INSN(insn, "can't find jump dest instruction at %s", offstr(dest_sec, dest_off)); return -1; @@ -1680,7 +1679,7 @@ static int add_call_destinations(struct objtool_file *file) if (func && func->ignore) continue; - if (!insn_call_dest(insn)) { + if (!insn_call_dest(insn) && !opts.ftr_fixup) { ERROR_INSN(insn, "unannotated intra-function call"); return -1; } @@ -2636,8 +2635,10 @@ static int decode_sections(struct objtool_file *file) return -1; } - if (add_jump_destinations(file)) - return -1; + if (!opts.ftr_fixup) { + if (add_jump_destinations(file)) + return -1; + } /* * Must be before add_call_destination(); it changes INSN_CALL to -- 2.43.0