From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 4BC7A3858C31 for ; Fri, 12 Apr 2024 14:47:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BC7A3858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4BC7A3858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712933257; cv=none; b=GvYgRh7MmPUvKYpc7fnHDJlXMr7/JGNvK7pOOgNrefkCTkCZN9yrJV2zlGpzRTSElkY09vtWicaTXdwAv4fUm61u+oP2vLDk15Vc52Wky0KtqjqgweFsQvTz0rzBRgXKCIygPz8ZJgOsKIf3xVEe1Ak6WONpr6FJJT88s9snhs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712933257; c=relaxed/simple; bh=d6d5Oq7w9Sx0K4ULdZcAYnLIG9IdyYjeBR3BVu8lzRI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ZtfIgpvWHgU8JNl0ee4Yv4kwyGzvLz9pSTbhmi1YW6q3dAFT0qKsZwhi4DGUtynweqnzliNTfXrfRd5dxHN8BrwXWPgwX8eVF3nhQyUmveaa0z2rBmnq5fkrqDo+ot+JnEi1KgMkGB/RDcnEEqxGl5PGEAMnin0TzDtaMeOoO3c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43CEfYPO016344; Fri, 12 Apr 2024 14:47:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=lVUa3QXFPQXZ37KB0HbkKUOfYXZbiCfik84bsUay01A=; b=s0ZAOKue2AWhpJG1m7mJbbbms13z8MceQHm/V99KUrXAl9oL33g5Na/Jxb2dAtzV2EwX IXLE9AHhpP/2jg4sV8F+bTiNR8B7WbgOePAueGLjkWC2bm6p7GWArRH9YWF4n7zkLgQj 0pv+o9DnErtBKWhBW9hTpC2YVAt/YHBhyYK+UltiZkrSPpTs72VcoqpWFyrOI42VUFVC VWfOb4lGQ7ei0CmoASKo2McJrRXYrvvpws61KIOSXxCTRC7BRuJSs0mE/OrCzF2VhpuX TnxfYh8nB8QWfyhoi/5sAm0fDxeAN7yZmyTqCTkaSyshnwy+chOTe+TgnVk+zmL5hIDP Pg== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xf6qv8177-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:30 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 43CDoF8E013590; Fri, 12 Apr 2024 14:47:29 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xbgqu2nft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:29 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43CElOr647317358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Apr 2024 14:47:26 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 002F02006F; Fri, 12 Apr 2024 14:47:24 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D944320070; Fri, 12 Apr 2024 14:47:23 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 12 Apr 2024 14:47:23 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel Subject: [PATCH v3 11/15] gas: Skip SFrame FDE if .cfi_window_save Date: Fri, 12 Apr 2024 16:47:14 +0200 Message-Id: <20240412144718.4191286-12-jremus@linux.ibm.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240412144718.4191286-1-jremus@linux.ibm.com> References: <20240412144718.4191286-1-jremus@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6xfr6Wi-NGhbdnZWEbTQw_Db-SGkb_bT X-Proofpoint-GUID: 6xfr6Wi-NGhbdnZWEbTQw_Db-SGkb_bT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-12_11,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404120107 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: CFI opcode DW_CFA_AARCH64_negate_ra_state is multiplexed with DW_CFA_GNU_window_save. Process DW_CFA_AARCH64_negate_ra_state on AArch64. Skip generation of SFrame FDE otherwise. gas/ * gen-sframe.c: Skip SFrame FDE if .cfi_window_save. Signed-off-by: Jens Remus --- Notes (jremus): Changes v2 -> v3: - New patch. The intention is to skip all "unknown" CFI opcodes, which SFrame does not explicitly handle. DW_CFA_GNU_window_save seems to be handled only for the AArch64-specific multiplexed DW_CFA_AARCH64_negate_ra_state. The logic could be changed to be dependent on TC_AARCH64 at build-time instead of sframe_get_abi_arch() at run-time. gas/gen-sframe.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 87be3eb05ad2..98166de8cc01 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1257,12 +1257,12 @@ sframe_xlate_do_restore (struct sframe_xlate_ctx *xlate_ctx, return SFRAME_XLATE_OK; } -/* Translate DW_CFA_GNU_window_save into SFrame context. +/* Translate DW_CFA_AARCH64_negate_ra_state into SFrame context. Return SFRAME_XLATE_OK if success. */ static int -sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx, - struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED) +sframe_xlate_do_aarch64_negate_ra_state (struct sframe_xlate_ctx *xlate_ctx, + struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED) { struct sframe_row_entry *cur_fre = xlate_ctx->cur_fre; @@ -1274,6 +1274,25 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx, return SFRAME_XLATE_OK; } +/* Translate DW_CFA_GNU_window_save into SFrame context. + DW_CFA_AARCH64_negate_ra_state is multiplexed with DW_CFA_GNU_window_save. + Return SFRAME_XLATE_OK if success. */ + +static int +sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx, + struct cfi_insn_data *cfi_insn) +{ + unsigned char abi_arch = sframe_get_abi_arch (); + + /* Translate DW_CFA_AARCH64_negate_ra_state into SFrame context. */ + if (abi_arch == SFRAME_ABI_AARCH64_ENDIAN_BIG + || abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE) + return sframe_xlate_do_aarch64_negate_ra_state (xlate_ctx, cfi_insn); + + as_warn (_("skipping SFrame FDE due to .cfi_window_save")); + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ +} + /* Returns the DWARF call frame instruction name or fake CFI name for the specified CFI opcode, or NULL if the value is not recognized. */ -- 2.40.1