From nobody Tue Dec 2 02:04:32 2025 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30B56342C94 for ; Fri, 21 Nov 2025 09:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763718876; cv=none; b=L/LB020cBRqWG35FM4KIqNQ9mMPaj3hoSjBwz+7r1fAmcWWCesfywH0t6fHk7kfcu6zgugM1d1uW0TQ0dSDHZvXTGdHNKotZOlDvhVKgaBC06bQVSVMxoXcLVsEQTDLnJrXtcvH2nEBCI9BXhx9djKiBWlnGZpw2+r+nOs2mkKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763718876; c=relaxed/simple; bh=u00xFU4aVAd8qPYKiROKsfCV2pKcQtnI5UluccGO/98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DVaTngfJum9ZpGR5cZvQXyeURXN105KggdMs4TZ6J6u3tn8TzSWrJ7e3juXQYJJuASbCq2VGwEzXOoh2YPap6MzNOADcF6yeXqPkn09eHF2u2+sJTlKqoEqJktdh5dsGCZ3PpKPR2s18pbHQ8NrTsD3lpPAqZj4W5z1GhZl74Ik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=TN5usDq/; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="TN5usDq/" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AL1uOpl020661; Fri, 21 Nov 2025 09:54:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=dZAJB XykXzZaViQVzFjjS7/95/jwrvIP034HEzSn86Y=; b=TN5usDq/n/d/fHxPOoqLu u32R/vwAuJtToaOzruZ6B3937cSNY4vPvoc14TLf+wVOFPdK0p4D2qrIQN1JXhu5 ybUGkkRlzF3KruO7uPLcVHpVyG8T+T7fpGmTY2BqQxEblKXwklwyRudupr/tWCm3 zwPBGnIHh8GqmiyGlTEDXSy6F+aGUUqcb8l6MV7gLxe9CWnHLlGh5UiEQtr+saK6 j6ssgaEUx+yrSbKnyTzg8N83gUvxendogaJUCQBb6vBElUwxMaDTm38xInwijKTT QFl8THTWXPehDnyWkHEhQcEBgwDmQuRSyEvkcTbBIK0x1Fu9UaqOrdsKA8NEpn4S g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4aj5dtsjhk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Nov 2025 09:54:25 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 5AL83bqW004518; Fri, 21 Nov 2025 09:54:24 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4aefyd4uvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Nov 2025 09:54:24 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5AL9rgUm021648; Fri, 21 Nov 2025 09:54:24 GMT Received: from laptop-dell-latitude7430.nl.oracle.com (dhcp-10-154-175-150.vpn.oracle.com [10.154.175.150]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4aefyd4ub2-23; Fri, 21 Nov 2025 09:54:23 +0000 From: Alexandre Chartre To: linux-kernel@vger.kernel.org, mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, david.laight.linux@gmail.com Cc: alexandre.chartre@oracle.com Subject: [PATCH v6 22/30] objtool: Disassemble exception table alternatives Date: Fri, 21 Nov 2025 10:53:32 +0100 Message-ID: <20251121095340.464045-23-alexandre.chartre@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20251121095340.464045-1-alexandre.chartre@oracle.com> References: <20251121095340.464045-1-alexandre.chartre@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-21_03,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2510240000 definitions=main-2511210075 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIwMDA5OSBTYWx0ZWRfX6AW49ms8+Gbk PA55h12co5CU2/5Xypyey9bYdnoLWHYdwKmOaFEmi8FwAQ5xUyt3yOkour0ihJNOwVoaOK1pnC5 QBHe/kBuOxaKeHtxvRV+ll2wsdKufXa0dpghwFojXJ5fWBxAHE9oZs8Q0Hk9WKHAptXuxpY9HlH niJ0ba8AMoGyKBxYQRmuxieVR2qAWHnum84vuFNza7c8tEqWnQQibkjy+swePgJyCSRoOSDLQgL E0o3SfGaZO/nbzSlgemSpqq0ZGB4W47CDdNkGgrsNo/5G6sYFt2vR4M0kVte2icpU2m04aGdgWa /kOELzOLq/0S32gfvVJ1LGsIfcBrMbiS+L3l+G+NoY9ZYiNH0ymKGFENVaiUMYK+o6oBC7Gfgn5 EKwlOSE4KCn4JUGQ9xKqqDCOlDHurA== X-Authority-Analysis: v=2.4 cv=Dckaa/tW c=1 sm=1 tr=0 ts=692036d1 cx=c_pps a=XiAAW1AwiKB2Y8Wsi+sD2Q==:117 a=XiAAW1AwiKB2Y8Wsi+sD2Q==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=YV0YETl46AI6N2r6LvgA:9 X-Proofpoint-GUID: i0MLvUxH6M6bdRt1q5BxNseW611mu4xL X-Proofpoint-ORIG-GUID: i0MLvUxH6M6bdRt1q5BxNseW611mu4xL Content-Type: text/plain; charset="utf-8" When using the --disas option, also disassemble exception tables (EX_TABLE). Signed-off-by: Alexandre Chartre --- tools/objtool/disas.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/objtool/disas.c b/tools/objtool/disas.c index 6083a64f6ae49..018aba37b996b 100644 --- a/tools/objtool/disas.c +++ b/tools/objtool/disas.c @@ -639,6 +639,26 @@ static int disas_alt_add_insn(struct disas_alt *dalt, = int index, char *insn_str, return 0; } =20 +/* + * Disassemble an exception table alternative. + */ +static int disas_alt_extable(struct disas_alt *dalt) +{ + struct instruction *alt_insn; + char *str; + + alt_insn =3D dalt->alt->insn; + str =3D strfmt("resume at 0x%lx <%s+0x%lx>", + alt_insn->offset, alt_insn->sym->name, + alt_insn->offset - alt_insn->sym->offset); + if (!str) + return -1; + + disas_alt_add_insn(dalt, 0, str, 0); + + return 1; +} + /* * Disassemble an alternative and store instructions in the disas_alt * structure. Return the number of instructions in the alternative. @@ -790,12 +810,16 @@ static void *disas_alt(struct disas_context *dctx, } =20 /* - * Only group alternatives are supported at the moment. + * Only group alternatives and exception tables are + * supported at the moment. */ switch (dalt->alt->type) { case ALT_TYPE_INSTRUCTIONS: count =3D disas_alt_group(dctx, dalt); break; + case ALT_TYPE_EX_TABLE: + count =3D disas_alt_extable(dalt); + break; default: count =3D 0; } --=20 2.43.5