From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 2318E385DC1D for ; Mon, 30 Oct 2023 16:52:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2318E385DC1D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2318E385DC1D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698684738; cv=pass; b=Wb+bPm9amOZZIOK9OXttTsQ1N6+QI+j9WZNYFzvBRtvkESxwm8+eVGCtYkt/1FrD1Knc+4vg1T0eQvnzTXIzs3aikBDuq2/aibP99cXrs7FJhIJ4dX7OmuaMWXzUS7+k5dxOqLlcZrgR/VMnOME9DLIFbzwfDB0WLlcRcVq4zW0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698684738; c=relaxed/simple; bh=qkG/h+Cauulym9ZGk8pfaZsacBWvXJcpo0/umZ7B/Yg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=n81U8kKmQA5i2OSetT836arXAXyniiIHQiUvdgR0jRqqiE4zoJtXNKJfzN9YUhKhb/yD8L5xGbYgJwm8KfNorAKwNrOLQhU5jQSuXhE8UsqAvm+6LkaaJzAKctnz8vh62RDgdZ+C0SJ42wO+Gb6lxmwu5j2dHOfq5pRz3h+MRo4= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39UDD2fa010854 for ; Mon, 30 Oct 2023 16:52:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=7mZ9ErbQKjSwwmMtWNlbO4VVvKQPgSBoZyispW+ZSNc=; b=13C26EwMkLfHHbpm259OMaeyTtWgoi2i4cIkY7ZQ/TubNz46yyQZxuk0eEP5kF1vjeIC 95FOX62V6IS/is3B+rNZQnkie8GCJ/BSejXZ5uqRvkSBbZSSwb82vK8Qspmc2rwIlhAa wA6x+pLDq3NScyfJfzv3oY53B6romTKh6LJPCF/JpYCp/puWf1B0U9XXdGzd+X09EU+s RllBlihaDbQm12bAfCIChZ55D6lhTC3uroLUUFUOkOcThUM11BGQPnEMk7lAaHJtXKMY gy2xn4iLx2+EdZ73WyLjLG+eqo+yT6IgwPXAliyYLFsm1/KsBTgFrzSQ9LPCCfsK0xoH 5Q== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s7bu8w6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Oct 2023 16:52:14 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39UFhWJa009234 for ; Mon, 30 Oct 2023 16:52:14 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u14x4da4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Oct 2023 16:52:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fjvh7ayT+N6cLkYl2nMbd5qcVNIeVg52Ngo53K5zTUtNUmSpIoqhOZONSLEUaFQwA/ViLWQmWvSvDWcbZ63/GZnrSUppr9/Foi3fpcThNDADs7nsAwwlEQYtCE+JS3Xlx6l0OSQsSdvtcTLeVdHQXzYtPcOnab+ODnp9AJr3A9kyF8uJ5Wo0am3XcaZjvyj5i31zUxlcqgwK2Qhxg7mWiJknCvnChY30xZpOmHsmrOEUi0bZqL1j9i9ErjvJ0und/2TqjjwhdzqqctZ0/LERIcudUb5M/jb7QSQkF3RWZVABEvxk2lJpujzzZs7mAvrN2Pk2P+isz0ZUrfbYSTl28A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7mZ9ErbQKjSwwmMtWNlbO4VVvKQPgSBoZyispW+ZSNc=; b=db+BtB4a3jRdmR5kOPDCDG4H3gIc1w9rVYLfkl04N094oXZc1aFeYpO80bx7GmTcybeIqOeqY2y+lmu6fZjUbCwrUvpMXgUH8t6lbsGSLSmSHCEqlM5iOpkCHtvMD0bPg0hAi2ymuRsEoEn35TisxrI3AOQg5HdDwLhRhMvxi/sWCtVWR2zmhx5kAGbCa3QBUpSKXGUtYwPe49bTnniUKdHQ8BVS4d8kVDcSe7V4cFj4zRqKVff/KNst/jbWjvkOTPSzMfmAS/oEuFQ0xLxP1Bk2wrKrfi+ehNx5+oBlInlT+KUpb/UMWSDIb1B7pSlrh/79DBCELr8GsWMA4eVYoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7mZ9ErbQKjSwwmMtWNlbO4VVvKQPgSBoZyispW+ZSNc=; b=Ihexx7VDO8Q7nQTN+ufTf/WKxrzLTs47aH+Xa2ajE/HAU7X6QaEF6QdW/Z7y9+wKIUXEl6sY5kW49xVa4psTJuxwjDFMiTpzoY/18mfcEdSqTxLZU+vya65lmSOPYTKC3kxJ93YoLn8L5StgEhq5DPI8bx+EREVQHwecmnZeDWk= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by IA0PR10MB6818.namprd10.prod.outlook.com (2603:10b6:208:439::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Mon, 30 Oct 2023 16:52:11 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::7f02:c28d:9802:20fd]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::7f02:c28d:9802:20fd%3]) with mapi id 15.20.6933.019; Mon, 30 Oct 2023 16:52:10 +0000 From: Indu Bhagat To: binutils@sourceware.org Cc: Indu Bhagat Subject: [PATCH, V2 05/10] gas: add new command line option --scfi[=all,none] Date: Mon, 30 Oct 2023 09:51:32 -0700 Message-ID: <20231030165137.2570939-6-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231030165137.2570939-1-indu.bhagat@oracle.com> References: <20231030165137.2570939-1-indu.bhagat@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0160.namprd03.prod.outlook.com (2603:10b6:303:8d::15) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|IA0PR10MB6818:EE_ X-MS-Office365-Filtering-Correlation-Id: 8612f4b2-ce98-4427-7d0f-08dbd9688ed6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wq1VIPgLGmEmwFXpjE7u0NaXrSuU/XIt6GDCQRoHvy0FdARb4EcdfvdjawUC2yP44w4QqpvUVlp0J/rcIkG37a7b2mImtTHtzKIbip11W61fT6Dswy052KdoBArKwHwsiYNrJK+kiwrRjW2BrDCssGoL2h9VRd2Qq42EHRPy8N9IZSgeGadtl3KmRynoZZKYl1XR9W/BOR6KZXWq/nANxzw/zpsE6mnffL0YgUuYP3AvSOIzR47woY2mIGdb+W6qgZb5VGxBYjdXAPv1NZrAU/OOHw+EWu2NMbphkY4beA1+jMhgNDDYtY3E56fdz1j/H528EIvzlytRrQIdGMIOifKwigYHxOFL8RhpBdzQOe0xGUB1D/MMhp3RjZxH0QnfGfLohuidkGF1e7tkhJfMcFmXOUf/u2V3y2PWUBlFFc0j8VVuRGwzmJOttQh2bboPxLyNI+/QMa8X5Sp/snTdMEXu7w9/X2Mb0HGR6ewuCni4BV6Kca9xaKNeMQqfwxav6t8JEC/2CbMP2+gPQnJ/KVrzgeOwrbvR8gVABfpjTJzZjidYDkcQmXhMna4EzMW/DbtFPaCFur8cjBEgW/n8jLcJ1kgcGpk/iX64E/W/0iJFVuKRavW+MT0gdE1e3PyS X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2158.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230273577357003)(230922051799003)(230173577357003)(451199024)(186009)(1800799009)(64100799003)(83380400001)(8676002)(4326008)(8936002)(66899024)(38100700002)(86362001)(2906002)(36756003)(44832011)(41300700001)(6512007)(6666004)(5660300002)(478600001)(6486002)(2616005)(316002)(6916009)(1076003)(66476007)(107886003)(66556008)(66946007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?D2RV/APUlas4Khg9DGy4BtLy2r59/JJI2vOFvMRVbmzqAf3B7zCUdLlz3cpf?= =?us-ascii?Q?fYQtTm+WqBgPZqV6HC0PzqQxptJrVnjpQjhXPhyo/Qnp7MovjVtztuWPLryy?= =?us-ascii?Q?wqt0ch4BURUw0Tbm1nwssBHo3sUjxjQh3K0u1sfE4gkE1xCvOIFiVs5b5+tB?= =?us-ascii?Q?bO2DC1aj/pHL3NxjIKwg1wqe7Kmrk7yH4pTLFoHiBHJ5FyJ5KI7d/pyKeqYJ?= =?us-ascii?Q?3SoiiCdWp6VSNILj/rWWCIWmqYA1nuUACzv2cmr2gWDWKxLpsuQCtKJQhxh9?= =?us-ascii?Q?VngO2ibTfByMyFsnLQwfZkVPSrNU7XefGSiRzpuxSRMEBTfFLL9/7D3UXxYh?= =?us-ascii?Q?X11D7bvrwxbwriFL3SXTaC6E7qADy3dnBQ6een3MLaB+z5tR+6GlABYsBwO/?= =?us-ascii?Q?mdZFLxiZy6ghB5QekyNM6yRdwa7dT5auJCe3HAFMImh9qmuG4a2KSCLsmmFi?= =?us-ascii?Q?4XbsJrjNzXhUzNNLKLKrOgDEbv7qdAXRchX7+OqSqRXZR+MTOlbfiUIbgIiX?= =?us-ascii?Q?OVGwvkcZ8SuTbu1KyrJbHX5jiNLKvEO78Jvt1A2Ib3TPHT+7hSdLZB6EJRFg?= =?us-ascii?Q?Uwx1T5BQ9CFX3ZbxRCH9mgISE07Rx1/JxT5rPPQWEr7aX0qLYOezYvkSu3G2?= =?us-ascii?Q?7Be/tPdnbMmcEwYRdULc8t7o34F/R/U7O9thlFZqgPhL4ueBD+tPqeJcLfwS?= =?us-ascii?Q?cexK+0U6fBgGjsSAX7q4I95FZvzTi8zZs8WEUITNUU83ftASupGYCKMP+Bt0?= =?us-ascii?Q?A8WMx0tqSrEbX1cWK8l6aG9Q9LYhQvp3ZUxzD/vNP4waZeQuKiRvidn/iMtB?= =?us-ascii?Q?tbGaieeRdCGvQ3umfwV/7b+2rUYqDYpFJtH83WeXzV2Cd0Y75zCoFV+09FX3?= =?us-ascii?Q?tTBSp4jwW2qtnK4ikUAs3lhuy5aAZyn29NlAOLIAOIr7GGTtFqzjPLbxS3OI?= =?us-ascii?Q?k/XpMz5B1zV6ynTNz7vHNRDEMqSfll/46sH9FEaquk6tyiDm1ZA5eYsMzhTi?= =?us-ascii?Q?095IZgsrOEh3m6jWw/6+uoEMf41TT2UbuPUqRYpZ8jAEZ0Ov5IjR1P8Skyz8?= =?us-ascii?Q?fP/ae1ykDdffRsxmX3QL+rqeL5ipXTIh95ZET2psGjHjSQlh+F7GHqgxibj7?= =?us-ascii?Q?K9uRTYnjp0Jv85Hvs76NAmNAIkX9uLr9aR2dXY08Vhk2hgUQNFy2WW9URYc1?= =?us-ascii?Q?UieZ//3hg/dihE+qdPyX4KXaHvXw4YIix4vhgWUgGjQ7BVa1QGOFMTDojCMh?= =?us-ascii?Q?Zwfin7yM1ztCkzAb0FdrQgvrMCvjkFawjehkLq7ofyp9R+Zk8u71sdH4tnBZ?= =?us-ascii?Q?O6wXiSbg0iXryJlOubRQDI9uFFzpEAkOqdQxm/SJswGrwIkVN4K2mUy5NyOJ?= =?us-ascii?Q?KCvNfpwellfPdEs7qzTytp5zlMFNqMI045z3IeBioS9tuOdzUTGJksYA3S9x?= =?us-ascii?Q?frnA7ihW3WncdZDFos6XceeiG5x9J83kDm8ctjhdBttIbigh7cjGlIry96Sc?= =?us-ascii?Q?SWULDo3XIgAb+TA9kFqMVxxTL6fK7YxHSEbGXb8g0dIo1xxTgC3xdYZRLWrD?= =?us-ascii?Q?sZdrk5s3WhVkVmhJqGjjcG9uxmC2ox/VFyw7a3wfqWqrySJdKo79MZTNAAuY?= =?us-ascii?Q?AgEJ0xO1pkd2PPQqA7uTwLw=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qmn3iUh05tmH9xnwMKH9j7fw/jMujEuyVPPKpcmh6Jp8WmtKQiGLyc7BMNWGz7PTYP/Qo7SIKH1szpf4W8jKTz6KReNZMfpHrW+PT0aW1gGOgkxXymE4emR9UIetyICJRmiKzqyzTQB1rSQS5C5QHdlx/Gz2lYbu8gC8QwFjJpbDf5dhy079StN8bZTpEeEdhCeSqHdIU9PTerI4gPuGSx3fUac5DU92EwZMKZOHo1IPEWz4eLdVedAGwhCf1ns5t9aoqcPGulJN5eSQkEzOOiygi8IVgUGS9hu9xvYIvD4EEItfmmDL5bLNJpRCosNpY97cEf/v6OaOp7p2T5V4OAK+bOslMFuZG8N0QLLr3QwNLBSyhJh7kPxYBsLk95khU7hiBYcxwfWxgXRusM9lCMZVMmCB/Ycxgu0mmAOCetHt4tEt3CSnk64nmJZfAFW+MkRjRgV6oARE5m5iwt+zDgDwVcSQErEsfDnumnd7AoGfHLfbfks1z9yV+2Rmcri/lu99BOMQr0nQG6uZ6O0r1I1/ALI7c1VIl2eFx+OQYM1X9HwDzGL0P6MDBd9y+pf3g15yOGSSIfVY9clUP8WNv3B1/daDWs80KUSxsBAIsG0cMPuHKCBvJq6EX4raFckRKgJDoAzOK1XQ4hM+fQF1UJCrCdw6o3EK7gK4mTdNGbgDgNbbLBjWr066hJ8imnl4dv7/uWE+yg5xKp8T9qRUaXgSL1+o4gmOjznCJumZzF28H3x6gx/DfDnKveYtGFbO2DBwH7N0+AvJRFTh7niOJA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8612f4b2-ce98-4427-7d0f-08dbd9688ed6 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2023 16:52:10.2033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3TA2uu3kDaFdjaStPAfeumoZaH+fAt/FUqjOll3cPqkEePgi3aPxFqYXueMmsToGKGOWIBpVtkLnziLmWsTD3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6818 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-30_10,2023-10-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=775 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2310300131 X-Proofpoint-GUID: iqLhO6S_ABI4nfV9LeTCsuSAsfkK7uVP X-Proofpoint-ORIG-GUID: iqLhO6S_ABI4nfV9LeTCsuSAsfkK7uVP X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: [Changes from the RFC patch set] - Update documentation to make it clearer. - Guard the --scfi option processing behind both TARGET_USE_GINSN and TARGET_USE_GINSN. [End of changes] When the command line option --scfi (default is --scfi=all) is passed to the GNU assembler, it will synthesize DWARF call frame information (CFI) for the input assembly. The option --scfi=all will also ignore many of the existing .cfi_* directives, if already contained in the provided input file. Only the following CFI directives will not be ignored: - .cfi_sections, - .cfi_label, - .cfi_signal_frame To use SCFI, a target will need to: - define TARGET_USE_SCFI and TARGET_USE_GINSN, and other necessary definitions, - provide means to help GAS understand the target specific instruction semantics by creating ginsns. The --scfi=[all,none] may see more options added in future. For example, --scfi=inline, for dealing with inline asm may be added in the future. In this option, the GNU assembler will consume (and not ignore) the compiler generated CFI for the code surrounding the inline asm. Also document the option. gas/ * as.c (show_usage): Add support for --scfi. (parse_args): Likewise. * as.h (enum synth_cfi_type): Define new type. * doc/as.texi: Document the new option. --- gas/as.c | 22 +++++++++++++++++++++- gas/as.h | 8 ++++++++ gas/doc/as.texi | 12 ++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/gas/as.c b/gas/as.c index 6839c841588..97b0ed38fb6 100644 --- a/gas/as.c +++ b/gas/as.c @@ -372,6 +372,11 @@ Options:\n\ -R fold data section into text section\n")); fprintf (stream, _("\ --reduce-memory-overheads ignored\n")); +#if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN) + fprintf (stream, _("\ + --scfi=[all,none] (default: all)\n\ + Synthesize DWARF CFI for hand-written asm\n")); +# endif fprintf (stream, _("\ --statistics print various measured statistics from execution\n")); fprintf (stream, _("\ @@ -511,7 +516,8 @@ parse_args (int * pargc, char *** pargv) OPTION_NOCOMPRESS_DEBUG, OPTION_NO_PAD_SECTIONS, OPTION_MULTIBYTE_HANDLING, /* = STD_BASE + 40 */ - OPTION_SFRAME + OPTION_SFRAME, + OPTION_SCFI /* When you add options here, check that they do not collide with OPTION_MD_BASE. See as.h. */ }; @@ -586,6 +592,9 @@ parse_args (int * pargc, char *** pargv) ,{"no-pad-sections", no_argument, NULL, OPTION_NO_PAD_SECTIONS} ,{"no-warn", no_argument, NULL, 'W'} ,{"reduce-memory-overheads", no_argument, NULL, OPTION_REDUCE_MEMORY_OVERHEADS} +#if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN) + ,{"scfi", no_argument, NULL, OPTION_SCFI} +#endif ,{"statistics", no_argument, NULL, OPTION_STATISTICS} ,{"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE} ,{"version", no_argument, NULL, OPTION_VERSION} @@ -982,6 +991,17 @@ This program has absolutely no warranty.\n")); flag_execstack = 0; break; +#if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN) + case OPTION_SCFI: + if (!optarg || strcasecmp (optarg, "all") == 0) + flag_synth_cfi = SYNTH_CFI_ALL; + else if (strcasecmp (optarg, "none") == 0) + flag_synth_cfi = SYNTH_CFI_NONE; + else + as_fatal (_("Invalid --scfi= option: `%s'"), optarg); + break; +#endif + case OPTION_SIZE_CHECK: if (strcasecmp (optarg, "error") == 0) flag_allow_nonconst_size = false; diff --git a/gas/as.h b/gas/as.h index 46dd0d0776d..378653e2200 100644 --- a/gas/as.h +++ b/gas/as.h @@ -324,6 +324,14 @@ COMMON int flag_fatal_warnings; /* --fatal-warnings */ are detected. */ COMMON unsigned char flag_always_generate_output; /* -Z */ +enum synth_cfi_type +{ + SYNTH_CFI_NONE = 0, + SYNTH_CFI_ALL, +}; + +COMMON enum synth_cfi_type flag_synth_cfi; + /* This is true if the assembler should output time and space usage. */ COMMON unsigned char flag_print_statistics; diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 52571d95dd2..cfc1078c36b 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -255,6 +255,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{--multibyte-handling=[allow|warn|warn-sym-only]}] [@b{--no-pad-sections}] [@b{-o} @var{objfile}] [@b{-R}] + [@b{--scfi=[all,none]}] [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] [@b{--statistics}] @@ -932,6 +933,17 @@ Ignored. Supported for compatibility with tools that apss the same option to both the assembler and the linker. @ifset ELF +@item --scfi=none +@itemx --scfi=all +These options control whether the assembler should synthesize CFI for +hand-written input. If the input already contains some synthesizable CFI +directives, the assembler ignores them and emits a warning. Note that +@code{--scfi=all} is not intended to be used for compiler-generated code, +including inline assembly. + +The input asm must begin with the @code{.type} directive, and should ideally be +closed off using a @code{.size} directive. + @item --sectname-subst Honor substitution sequences in section names. @ifclear man -- 2.41.0