From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id C4D3E3857718 for ; Thu, 11 Jan 2024 07:49:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4D3E3857718 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 C4D3E3857718 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704959373; cv=pass; b=DCcPZLs8uaFHoo5NvYR1gcowhhk5YMAt/Rf7v7gcu+aSAsZFYCK3Gs43LA0ULYjUDaG72QEwPx4zXUhhpcmRpxjmwvDoP3Nf9TwTttEbUWo1LxfRLritvTy4LY3rxxKxdLyERM6sH/kdOd0/WGKwxIlvoK6Wv4/wH+QZ+DL3fhs= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704959373; c=relaxed/simple; bh=UD3yL2FLRnFfzZi26P5agGQ/FmSc1QgATWSNgRhfy80=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=qKPy1FudZeqTb1Eqc9ruSEiI9w7zPtpCuMmUh/hNcHan2ufSeChrLpsX3Prr5LFUQ7kgPpRUvcfxyPfjdAURYMwSOXn03tDaOBcSkxCHNfr3LzKeyN044ppRuq5nqSUNTCl9UFgF1SJeCR6llTeegljhsYG5VZzs2ojlFdC8cVo= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40B7i2sZ009438 for ; Thu, 11 Jan 2024 07:49:31 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-11-20; bh=2tG8w/x8wvd3LHsusb0AgPhvpKpudYZDQKeCIae2wNA=; b=hBz4PSLbjCLkqS4kHNnucwDolW6KPU+YVDD+ACi54Dvt+J0UBoX9iWB9X17UmMO9FXcG tfZYBPwK08t9jFljPAU4lmIYbhKUPl1X/1aJCS28fcFenbnpalP1kRz1/yG4x331MGhz gZx7q/oPcandG74H0nl7lMTTp+K1FdTl/2LX0VWecYly2qnMb3xi119OejA75//cPYZo wDRXFIeK6oONMeVAnlxNfUI0E9XfM41tYGtICkj0I+I5Aai2qbYyv4+xRfJ2MhgWPTcH tUWs85kbZxyAsf7mq85yQejTCbvCviePms7zGROc7NP4ZEoFJNKM52Bvy4STfQK9r+Ld nQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3vj4wwghs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 11 Jan 2024 07:49:31 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 40B6VJHd006866 for ; Thu, 11 Jan 2024 07:49:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3vfur6j76s-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 11 Jan 2024 07:49:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MXW0I3fb9S9mBDV+IJ13qgQ+4Uz9+QV3M/+L2n6gFsVs0Go9L/09N2ooAgBUw2FQ5/9LBGsUpZOtkd3KyWtLQcuIZHTyfgNip6oiYmpbQiM+D0Lgm+Is26cwx9N9Rs91u5kG3BmJDtqrTddkkRM1CFu8sLK7LR2RsxGkBndp2YXr/JX15rR3l1J3Cb90hxRn/EH5qwzeMM1X6bcYe8j2WT0d0jgPov0YYuhSxGobQTc/RDO8swhimbLOE/FzfNoDXMoblPF+xTAYQWvcV5+rzhUGaTjN+leHMV5SPXrbd9UIrpxdbdRsLooMe72jENXGJzaZDYVRjE/TmP17KMfaRA== 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=2tG8w/x8wvd3LHsusb0AgPhvpKpudYZDQKeCIae2wNA=; b=Xd8fA2SAGW7kvsduk+16BgSjg9lbemdgpXFflh8wrlMfg1Tmdi258e+UdrfljN5+qpUdjbHBrXDegkE4ohGyYVyUVpp1kEfh4hFxefTiGjjfm+j6oJx/natYhI9043OikrETcGDxrBw8oYEyz2RVLL0kQewHKXMkSivb73+Z40k+Hsp3BQmcW+yeadNmCeDj601fO4QDu/Z5LNJbjP41LNsZnlpKqGfHwEYYdKW6CVmdtiZFk5BfNssd1N3jLbM51TRVVMWOyr/LMrKGtPfKZYwGhyOyNe7IDCCwYt8WY7Czx0OpDLzLLZ6K2hM/KtH1zvHTnLDgcl+IlYdQs+kHWQ== 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=2tG8w/x8wvd3LHsusb0AgPhvpKpudYZDQKeCIae2wNA=; b=J+RHw4/yH6MgYNFpnZVjxpdeShUSG9nW/eP868WicfdCK+eOgY/HU4qBMK0V5PBVVJTX4DjoTjekQQYWTlR9ZVBqY1fgZahW9noED4o/SmrzVqqTutucF4Z1U6JZ1WzDb18VBdavlyM+ZbU6+3RELSoLWq1Hdw0dbfpmhyGaTPU= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by CY5PR10MB6045.namprd10.prod.outlook.com (2603:10b6:930:3e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Thu, 11 Jan 2024 07:49:04 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fde7:fb92:8ea1:a5ac]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fde7:fb92:8ea1:a5ac%4]) with mapi id 15.20.7159.020; Thu, 11 Jan 2024 07:49:04 +0000 From: Indu Bhagat To: binutils@sourceware.org Cc: Indu Bhagat Subject: [PATCH, V5 07/16] gas: add new command line option --scfi=experimental Date: Wed, 10 Jan 2024 23:48:11 -0800 Message-ID: <20240111074820.2677826-8-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240111074820.2677826-1-indu.bhagat@oracle.com> References: <20240111074820.2677826-1-indu.bhagat@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MWH0EPF00056D0B.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:b) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|CY5PR10MB6045:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d4b583b-e8d3-4e9e-6391-08dc1279c84b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KWRiYuz/qid4XPlXzsYAiDeKvqeEZ8HbeUMgHgiS51E2sHLq41iS/WnAIRslHI+lhKHb8yLM+MZA2S8yHnoy1sAe1KIx5OTvF7TRDLWvgv8FKh0SsEGppd5FseMjZnpPTnIaoLsO1kYSyJxCDUjRrnw+g0dYThkkyl8+0ynhNmtjXMan/SY4Hs0IyE2qJdMoB8JQxYRHuWtOkcWnkD3QGLLFqnuoI1YAglChITNjZM80WQu5FycsqGlvgs+qiEqhUuUPiph/oYOVmmhZ06VtHFDZkD6XjhF1l8tHBJPmw0MOgu4MClajNNrICCHs2o9JK9SxaIp4moGxz0E56xc1yavC7wYTCn5qiU7zULoKGQRNgXsIjckI60WIuIHBBBb5ycRlOiGT0QGz+6BLzlCurW943MJpyc9b5zwpfS5gH0RhC3jMDzm1uZnV8F8ZOQk3aSBHsxdWuCf+hM0ONz9IEIWWQFtYwAyPupP66LtHTFnbw5n2rTRd7w+MJsWnM6KMyPXV+tQ1KDpEnfX8nHBevAuAbEbyoJYeLUtcp6u1kT8Foi4u8SDoTK9SJN4Cv6/FQ8KzvDTarrXv6cQSvOAYFqAs3gda4mybHSMJcXTqHZ5V6Vdt6if5p4yyfcoM+KSm 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)(366004)(396003)(346002)(39860400002)(376002)(136003)(230922051799003)(230173577357003)(230273577357003)(186009)(64100799003)(451199024)(1800799012)(66899024)(478600001)(6506007)(6512007)(107886003)(1076003)(2616005)(38100700002)(86362001)(6666004)(36756003)(41300700001)(2906002)(44832011)(4326008)(83380400001)(5660300002)(66946007)(8936002)(6486002)(66556008)(8676002)(6916009)(66476007)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CkVRDt5d9lQQvqfOqZyi//HCL2ZD3qvqLPhzHPza0OvcdmXUfZr2SGfdw7Zt?= =?us-ascii?Q?+35edoG3YqqTbzfRiFf5CAvONKBDHYTcPMk6heJ6nk4FuSn59Fo4aqYxScgt?= =?us-ascii?Q?6nBVZ81dqJh+zPPC2nNQpZKPDXE9B6Js00/uvNWNka/ou+3nPEz3MFjt8j/0?= =?us-ascii?Q?DnggtxrwnG0/E1VG2rZ2yKr1wCA9RJ3hlj5IMB26iA9WD23+aMY6LqLRsxC/?= =?us-ascii?Q?AkUtma9OCwMKYiNIg8qC24JiTcBncwDnppxgsNMSLqN+2a+jyN5VPkpcDgVD?= =?us-ascii?Q?Qz/bHW2kQryLXgefNFQ9f2seC10BHXdseugxHG+5PArJ+H3fRmsybVLgCaEY?= =?us-ascii?Q?Ma9vKPZLLrwkeoG338z5k3qYxlgpTqvtjp+fDQ7nwwedFWPZ5V+3/qsxm5Ko?= =?us-ascii?Q?eFq7yrlC741qY//JBw0T1PQkz6ZfOv3d0loVXGu1LIT7Qi4BO+I2uURfbYgt?= =?us-ascii?Q?gnJZtXp5C54JgszAPXoMLZZepvUHhqZyLDTKRkaG73AW0E5xHf1FP/aku94S?= =?us-ascii?Q?4SNLb7PfrR9EBZvWDKsl9+jIBepNojCcDlEA154LPYnfDWiDLBIIGeyjAY0C?= =?us-ascii?Q?Ka+uzyC2aPSWZSsykvuJrwcTVpXXZshDAnaIEkD/b+VQAQSZZ6H+V1lxMkIp?= =?us-ascii?Q?mmlo22YvX7jMkLzqrpksIaf7lgKYnxtA8nBZYVq4KT5Eua4NBKfEWni1fT/n?= =?us-ascii?Q?oVBGoPR11Hnabjpzw8pJjCSkpD3xScmFSkIZqcLqCuORjECPFrU7Rtwy2q3y?= =?us-ascii?Q?KPTlHS+mrK/Mhk+BOlUMiYN6pw/ptMGzoux3rvGhXMuwimDUHFml8Prv06gU?= =?us-ascii?Q?i3il4j5R1RgUZUn/Sw0Y+qM/IyR/kZXOc7fdkwI/WP9TARjn++l6Sj+wnx0c?= =?us-ascii?Q?szAEc48gyp5IYUZE0v8XhFKuPgMKFw3EgtIgO7aOotyOMsTJ175pWa5vKxw4?= =?us-ascii?Q?LccntHvmx1sG82Zt2aKNBjSyoWmlJ146HCmKTPBSj74kjq9TnmkR/uNsDjlG?= =?us-ascii?Q?qbEM2jq9QfV7lbfqXWUpewEVxunb+xhXelPxgjcVHlahwF8oAY/HeqGoA7WC?= =?us-ascii?Q?eFB7/28AwPECguUArY7EBgl18mE7Ep1rCMKCydMfYjNAGyMzIfnq/vNcdRH9?= =?us-ascii?Q?BNVHrHDcOkIUpwig40GKHvb3TNcFhfVItEojKD56sWkNyZLtsG4SERsDwezM?= =?us-ascii?Q?ctJQcmzsab5co2GpoO02htTEX50NxI1jbEaxaeD+vTO0rQw7NgDt6I/kUpGm?= =?us-ascii?Q?W5U8h9y9Nk1CY6aOzkq4EyWOFMNSWX9wEytdSDHnsOJ01mXSDgHOyU8Fpu+T?= =?us-ascii?Q?pCRPs3pJk1t5ySzLxbjRHJN0zh/muneazXuUNihgQjUQ9tJRZExPV4DUoumc?= =?us-ascii?Q?iKUxUsgLe18d/Su4DDVTQBS2W5WfVCjd5kewZKHw0j5ZVbXLoi6R9gohPN0/?= =?us-ascii?Q?G5Ld/bIX9lZbTCgHZXrN5rd0QzkiJENThQvvyKvyn20LCQHNH9qkTcw72HMy?= =?us-ascii?Q?6GnXHQzd+owd0VcegfKK/fRUREw7/UylNppQH3kKn2zTsH5RodnfK2LjUoBv?= =?us-ascii?Q?qVOEIT3SJTBYgtnoxtaHf57a7aXpVdndUODJ2aZCWxImQbNuHxqlQPkd+RtH?= =?us-ascii?Q?7K+pmf4WEMyunPJsQE8e/Rg=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ud/ZPUm/nreWSVtZGKs38zMp9j1opaZ/JU1DGFGhVaVetPzQmb8Wxt7iSt/HGjZBjXx0axvYGodJBDHyGiueA6ipWoUhLu5b6B7mRvh6thPKTY1I4+HSD6mgcFknwI5WXtZv2eE+BOv69sCuuJAyvuAzMVbrkQ0i6Zn6VKAANJX2goes6RO7Sf27CclbaaKCJkk68bJURLlGC2AnD8v/sUbRyw/hFXBj2DyY8m76UitsOWlodu5yeDy5DkBvZR9mLKvt2yVRhYdGr2wu0eftBe9SBMrEdx1T28m8LQWXmas4MDdV8SxFwdvEYaF08oiPTZfmvHzSnjsP7XblK5VbepGKZ2yxd5ae//bw2j7eExzillcz5JGU4eG5uLWfGDt2k2XamwPv6J0//O4KvVhZp8AgG9AwtuA1BkK1isxAz8zqy/3/fE7SGcIhhUUK1k04eKI0N1ImK1Ip7XBwdRJ4eCFHaAHlVXR/XAvernAK0Vq/fbDhaopL1l4eG0rMduT1HrhqMxh5YOMKc68bIddHmDDBsmIpaI9TwicmjPoKqXWytsBRregDTcXK9WtNCqH2xuGfC76UBQdTLR7izwbM8y4ZW9DLDkQPE9P++Arkk40= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d4b583b-e8d3-4e9e-6391-08dc1279c84b X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2024 07:49:04.2360 (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: r3VSKvJ3WIVs7pv0KgAAD8PrXyQLeX39VF5PxTmyOzJyQm3Y0J02eUIW8GxKqAvGdhbP4f49cZs00y1UkgLBBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6045 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-11_03,2024-01-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401110062 X-Proofpoint-GUID: Y1u5af1YzxSJpBxUJgEWvJxz3T_KjW5F X-Proofpoint-ORIG-GUID: Y1u5af1YzxSJpBxUJgEWvJxz3T_KjW5F X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 in V5] - Change the command line option to --scfi=experimental. Option name "experimental" is mandatory. If the user specifies just --scfi, they get an error: "Fatal error: Invalid --scfi= option: ; suggested option: experimental" - Fix documentation accordingly. - Fix documentation around the use of .type and .size directives in SCFI. Mention System V AMD64 ABI. [End of changes in V5] [Changes in V4] - Code restructuring so that --scfi=[all,none] is available for ELF targets only [End of changes in V4] [No changes in V3] When the command line option --scfi=experimenta is passed to the GNU assembler, it will synthesize DWARF call frame information (CFI) for the input assembly. The option --scfi=experimental will also ignore most 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 upcoming support for SCFI is inteded to be experimental, hence the option --scfi=experimental. The --scfi= may see more options like --scfi=[all,none] added in future, once the SCFI support in GAS is mature and robust. The offering may also see for example, an --scfi=inline option for dealing with inline asm may be added in the future. In --scfi=inline option, the GNU assembler may 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=experimental. (parse_args): Likewise. * as.h (enum synth_cfi_type): Define new type. * doc/as.texi: Document the new option. --- gas/as.c | 23 +++++++++++++++++++++-- gas/as.h | 8 ++++++++ gas/doc/as.texi | 15 +++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/gas/as.c b/gas/as.c index b83f0c618be..659da188da5 100644 --- a/gas/as.c +++ b/gas/as.c @@ -321,6 +321,11 @@ Options:\n\ generate GNU Build notes if none are present in the input\n")); fprintf (stream, _("\ --gsframe generate SFrame stack trace information\n")); +# if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN) + fprintf (stream, _("\ + --scfi=experimental Synthesize DWARF CFI for hand-written asm\n\ + (experimental support)\n")); +# endif #endif /* OBJ_ELF */ 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. */ }; @@ -543,7 +549,10 @@ parse_args (int * pargc, char *** pargv) ,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST} ,{"generate-missing-build-notes", required_argument, NULL, OPTION_ELF_BUILD_NOTES} ,{"gsframe", no_argument, NULL, OPTION_SFRAME} -#endif +# if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN) + ,{"scfi", required_argument, NULL, OPTION_SCFI} +# endif +#endif /* OBJ_ELF || OBJ_MAYBE_ELF. */ ,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL} ,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF_2} ,{"gdwarf-3", no_argument, NULL, OPTION_GDWARF_3} @@ -982,6 +991,16 @@ 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, "experimental") == 0) + flag_synth_cfi = SYNTH_CFI_EXPERIMENTAL; + else + as_fatal (_("Invalid --scfi= option: `%s'; suggested option: experimental"), + 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 1297e3dae41..69d7ae2cd17 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_EXPERIMENTAL, +}; + +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 7526b221a36..370f40fcbae 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=experimental}] [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] [@b{--statistics}] @@ -932,6 +933,20 @@ Ignored. Supported for compatibility with tools that apss the same option to both the assembler and the linker. @ifset ELF +@item --scfi=experimental +This option controls 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=experimental} is not intended to be used for compiler-generated +code, including inline assembly. This experimental support is work in +progress. Only System V AMD64 ABI is supported. + +Each input function in assembly must begin with the @code{.type} directive, and +should ideally be closed off using a @code{.size} directive. When using SCFI, +each @code{.type} directive prompts GAS to start a new FDE (a.k.a., Function +Descriptor Entry). This implies that with each @code{.type} directive, a +previous block of instructions, if any, is finalised as a distinct FDE. + @item --sectname-subst Honor substitution sequences in section names. @ifclear man -- 2.41.0