From patchwork Fri Apr 12 14:47:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 88431 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EBC6384AB67 for ; Fri, 12 Apr 2024 14:50:56 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 7E9BA3858408 for ; Fri, 12 Apr 2024 14:47:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E9BA3858408 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 7E9BA3858408 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=pgfbR0Pb9pWW5+kW0OFY+uhOWHPAmHUUfgcdADiozeNiN0RFcM2dCLsQjHvX6eiFZ1Tj2BiUdcjkKpa3URPu1XiBEniQssKXd6l679RwxcqhiXZvLOEe1DDeDqt1nxPxsSTBunfotJ7QuccMj1jzo7YdaWzMEfEdTcFg2bmiHng= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712933257; c=relaxed/simple; bh=M2BcrQfBEr87Vr7GiSIC2d309jVygBKIdoq9Xfuweik=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=WukiWj1GO/M+/S48ZnhxeAY4sy+Qqa6tkr0GOhd2rsI1gvtPqZbd+KgMzdqIIneUlg8gTZrZU/qTPq9LBybn+8pTaIY8jNz+y0uAhAR4PQIxw0ZVOa8GL/1Ejnoa1WqQLxq4o7+8gXOR1PpXj2HVzgSUnd/j4k9e3FoV8Pg6DxU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43CEh6mG002958; Fri, 12 Apr 2024 14:47:31 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=gfJjW+jukkqNK/Qqtm2ywGvgUZc/U2YxNanBJ2mzaqY=; b=IpwdhICTci5xxidf/gtaHWEl6wmPS0y2QJutG86uxLZvraDDxaCXvJOTo9gE2J32Y+ot 7BAWRvY0bDoCbvS72XolHlR57bHrsfZIJCGPe+dSZg72FWmByq+LBk6ROqm8iuaELhYQ J24DwXQTn9olxjrXBknKMs5IBebOpt6l4woC58tGbXuiWllNNMM9k5B95NYdSWM9oOIO 9JVr39Oouam3PTofCXyJ65Hq/GMcXBVtqliaD9fd/7M7VtukX28md4SmbZEWpizg1O7j mWPfCpmpCk5J7VHj8e1t+cVfmamoGy6iDDRfUBDgga6hNggcSraFdvWIcVHNPdVdOsrV iA== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xf5b4g7t6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:31 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 43CBVUYU029889; Fri, 12 Apr 2024 14:47:30 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3xbj7mt9jn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:30 +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 43CElO9i37028296 (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 8C8B22004B; 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 7189420073; Fri, 12 Apr 2024 14:47:24 +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:24 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel Subject: [PATCH v3 15/15] gas: Validate SFrame RA tracking and fixed RA offset Date: Fri, 12 Apr 2024 16:47:18 +0200 Message-Id: <20240412144718.4191286-16-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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _JOkmZMdu_4MidrR5X8kswbxVdWdG9_t X-Proofpoint-GUID: _JOkmZMdu_4MidrR5X8kswbxVdWdG9_t 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 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org If an architecture uses SFrame return-address (RA) tracking it must specify the fixed RA offset as invalid. Otherwise, if an architecture does not use RA tracking, it must specify a valid fixed RA offset. gas/ * gen-sframe.c: Validate SFrame RA tracking and fixed RA offset. Signed-off-by: Jens Remus --- Notes (jremus): Changes v2 -> v3: - New patch. This could be made dependent on ENABLE_CHECKING (configure option --enable-checking). gas/gen-sframe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index ca6565b0e45e..7e815f9603ef 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1532,6 +1532,18 @@ output_sframe (segT sframe_seg) /* Setup the version specific access functions. */ sframe_set_version (SFRAME_VERSION_2); +#ifdef SFRAME_FRE_RA_TRACKING + if (sframe_ra_tracking_p ()) + /* With RA tracking the fixed RA offset must be invalid. */ + gas_assert (sframe_cfa_ra_offset () == SFRAME_CFA_FIXED_RA_INVALID); + else + /* Without RA tracking the fixed RA offset may not be invalid. */ + gas_assert (sframe_cfa_ra_offset () != SFRAME_CFA_FIXED_RA_INVALID); +#else + /* Without RA tracking the fixed RA offset may not be invalid. */ + gas_assert (sframe_cfa_ra_offset () != SFRAME_CFA_FIXED_RA_INVALID); +#endif + /* Process all fdes and create SFrame stack trace information. */ create_sframe_all ();