From patchwork Wed Apr 8 09:12:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Muhammad Kamran X-Patchwork-Id: 132796 X-Patchwork-Delegate: tamar.christina@arm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 440334BA2E1B for ; Wed, 8 Apr 2026 09:14:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 440334BA2E1B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=jGoOe6Tr; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=jGoOe6Tr X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010008.outbound.protection.outlook.com [52.101.69.8]) by sourceware.org (Postfix) with ESMTPS id D979B4BA2E31 for ; Wed, 8 Apr 2026 09:13:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D979B4BA2E31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D979B4BA2E31 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.69.8 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775639623; cv=pass; b=hDqk7rPb/cSUc3H5CIZoHBAe1ehbMVTFKJx69dlYUZh5RH6Uz5dIPqTpUJkF3Ewb1N0W2hPsNqXXDL829nmSwUDB0pHMfeEK/+rhmlVJzUTBQpsWSuZQbgC99Ajvy3Mg8YjWurmwLPi2wrVqdUqpdAOOCZBH70fXD3SHr9rADhw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775639623; c=relaxed/simple; bh=O8MEBB+hPQWa+OHUTzYK1l/MWXCZvNlwOMbcESFYDRw=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=liyVA/lHSSviueLpUjhLTrcXQvG4jLqGeAjo/b5c26zKutADqgvEDCOrbiWqfkizMsohqgIK80RMRTL+mx+pl+GTvdo9hAsLyGQktz2cycsOYNEI6D/BB9u2w6DaZ+kx21vHz+uJDCMl5gj9MSbtktISAsJvt7WhEuu1OKAtgxg= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D979B4BA2E31 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=isPn3jAiSpo6iwocqVctDfi6ZhuQy2JuCbd6JHahLrqcJximsxMgsv5hgHLHjpMojSOeTMWutZk8VA3FIYKZy2O6LvXuXENbDxEtI7cyAF0yEROu/4toVWVqh5PNZ7FLgk4f4R+5bIhDAhNX0kgGTlbVWXCKrkQ+dtr8qYkGc5wl5VCEHOnhQJm5B6bm/NkN6CHmSv9JPLFw0KqeBcgyjxnXPTEmKAztnLOPLuPiM09iY2H2tR6zai6X9y0pMYmyd1O3v3ZDKf2IIK0HbhW+m7ckoR0rZko+AnhU/VA9IpRXM9Gavl6y9oKelP5OTiyxe+vF6xoxDF3iEpj5M7yWBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=br8qW9KOVPGOI8orn6T1chzfoqxiiW2EK4G5MC45sM4=; b=fZ0haGB+ljfe7LtHttf+Frur/j5EyVv1UaovnynGjlAVSemgSiuIzqZf3DzAC8tTSR5kGSMYofQyApgiGGLmUTaDCIAQhSmnxLZwLVIdLJAOIFjdIPLDUb14669wf70GgAG4w9iw9Mi3BP9vCoFpqonxSOlB54RJKbENml+axn6RYHjtFtoN70+enFXyURk8NWmd/s2xLOHVvgwCPHiPpGBlK0TMiMa46vfE+AWIQipUuQo+MNOLBpU84kOrrhGRIDXgL5Lz6ub/sp8dbaDKgvAQ94z9Y91lvU27OdjkXFkNykLhwMYPpGaa4uqhQe1p9Ax/f0Ai0G9ZbGZ8U21xcg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=br8qW9KOVPGOI8orn6T1chzfoqxiiW2EK4G5MC45sM4=; b=jGoOe6TrnSthivo543CWLK12hMNtE4ogjCKJALCXmJCni8x7k6P88+By7GeBpDUhuaiYekVf7rJcaZxclHUlI3PqfbCmpJb0e6o3fHicZ90ADBoY/fr+Go6I0ESDwFxA/mmgiY40m8cxpPvnZ2sLwmxYcY1Q2/og69fdXsioYfM= Received: from DUZPR01CA0146.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bd::9) by DU0PR08MB8729.eurprd08.prod.outlook.com (2603:10a6:10:403::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Wed, 8 Apr 2026 09:13:33 +0000 Received: from DU2PEPF00028D10.eurprd03.prod.outlook.com (2603:10a6:10:4bd:cafe::10) by DUZPR01CA0146.outlook.office365.com (2603:10a6:10:4bd::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.35 via Frontend Transport; Wed, 8 Apr 2026 09:13:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DU2PEPF00028D10.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Wed, 8 Apr 2026 09:13:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NCxPN5PuPbee4qMCMFMr8tNw/NQqEb6X5nybroT9CS2XG6Ze+hxnWQsNhKnvHWtJw2VXBzyZEWXZ7slfrJ8UViRqc/sysawY/lq+TKc6UuL5sQScAExs5WMuLWjEXrPB26DKeXwWfpMN2uzHuplkJzlaUqzbKXJKIw3M4CEJTUPBm5wN6zj4kimubH9RvAVXuo7rmknPgaAdQAc2QKdtGNsQSi5YYxsvGv86SFINUs4hcP6qHPXEkXk0Ey0b5IAMfNkd5AA7JKExmBDGurAnyJOPgJnpwPGcYLwA9dWUFxFOYqIbTtUUcS/5FQmzwsS6kH4Fo8Vd7Sd6XZre6p4x2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=br8qW9KOVPGOI8orn6T1chzfoqxiiW2EK4G5MC45sM4=; b=Atiraj3MOx+7eSv0KGNblFNC9LJWE+2HTHVqMQt14gYLS+66T30lT62v/bWkqKYAreHB4hHMpJ7MzQim4WoDMenfIO+JIeWLFiHgsatwCnBu5RZm6Q09wN9+WgLm+2kiadxECeOkTPD7UxCUlbUih5DTPB1xqAY4EWRDYsDMqx1h+xbVP4DuJSBJ+XJ2ORV1nwCuNfOf18JyWoVoOmF9xjTO+bKtCcr+N9CH6muWdW+tSLRkuYU48np1RSQXiksw0X8MD/3gNGto1wbUaUN49RxqTsDgq+VtbLxmTL/6AjZKXYArpFPJb/j177ATj0QZ2O6CzeYbN6VMDN2o5rdYGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=br8qW9KOVPGOI8orn6T1chzfoqxiiW2EK4G5MC45sM4=; b=jGoOe6TrnSthivo543CWLK12hMNtE4ogjCKJALCXmJCni8x7k6P88+By7GeBpDUhuaiYekVf7rJcaZxclHUlI3PqfbCmpJb0e6o3fHicZ90ADBoY/fr+Go6I0ESDwFxA/mmgiY40m8cxpPvnZ2sLwmxYcY1Q2/og69fdXsioYfM= Received: from DUZPR01CA0139.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bd::14) by DU0PR08MB8932.eurprd08.prod.outlook.com (2603:10a6:10:467::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Wed, 8 Apr 2026 09:12:27 +0000 Received: from DU2PEPF00028D10.eurprd03.prod.outlook.com (2603:10a6:10:4bd:cafe::98) by DUZPR01CA0139.outlook.office365.com (2603:10a6:10:4bd::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.35 via Frontend Transport; Wed, 8 Apr 2026 09:12:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DU2PEPF00028D10.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Wed, 8 Apr 2026 09:12:26 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) by AZ-NEU-EX03.Arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Wed, 8 Apr 2026 09:12:15 +0000 Received: from ip-10-249-57-232.eu-west-1.compute.internal (10.249.57.232) by mail.arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29 via Frontend Transport; Wed, 8 Apr 2026 09:12:15 +0000 From: Muhammad Kamran To: CC: Richard Earnshaw , Tamar Christina , Kyrylo Tkachov , "Alice Carlotti" , Alex Coplan , "Andrew Pinski" , Wilco Dijkstra , Jakub Jelinek , Rainer Orth , Mike Stump , "Muhammad Kamran" Subject: [PATCH 2/2] aarch64/testsuite: add LTO coverage for branch-protection notes and attributes Date: Wed, 8 Apr 2026 09:12:02 +0000 Message-ID: <20260408091202.13538-3-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260408091202.13538-1-muhammad.kamran@arm.com> References: <20260408091202.13538-1-muhammad.kamran@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF00028D10:EE_|DU0PR08MB8932:EE_|DU2PEPF00028D10:EE_|DU0PR08MB8729:EE_ X-MS-Office365-Filtering-Correlation-Id: 09165c06-6cdc-4190-10ed-08de954f1b93 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|82310400026|36860700016|1800799024|376014|13003099007|56012099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info-Original: iIRhJD+/M9kwb4M27e5TTdp0ugTXZ8G5pcdyZuns1Y5WgCpR/xowghhZA3MYoV+tQqm+07HS+UjIrXPYdIwaZkZ3cjEn/TWcDoTbUWsrj0VhZZRP4tlOBYmo671Qa9Gz0BraNtvIIQYR/HGhVz6hk+gZwun8SWRXZlVLiVZ+FNIMYGxI9BRZ+q/1o+BmWAqPgPYDBasNyS6e1tvq958wEAbq4xmxM+5NyR0xcrxVo5TbqvnNtcnt4A7cAPPUyTqitOSZ/NSqknQeaQzY/bO3DEGZN/TwkwGVXPChKWOyR20Zd0R0/ieKgK+OgKETDSD53fektPMsh3aRrZ94jRqOvgmqjtxzZYCN3SkT+Ht/SNQivh8cNmK5AWlQUxDJ+k69ePaESyTA+kWV83Uq1RYKyfiNJhaEv6G59titPywdEaaKdOxtj/p7vzW44p8tjip71xcQ1soELG06MMvKUa70IneleS8EJMV/1uTZZTKDCo/05OlQ6xpRvVW2GN0zzfLjvwivqtADcNvRh0pqnZX3qU+TQ0VHnmrzPh5OsRq/iee5T5U8rOy5e7127u7jc+MCtKoWBvBDvzx1S5iVdavSzTPIIYaIEFxA2rLNnKftwqxqDqJtdJTRYXeWEWB2pjOPTdK21nny8lAI/UFn46ekG0WR/0XnuX9m5Vvfu2TiqQQri7QGS7qupHukGkz2L+l34817oRvXxtJLgKRTnoGIgCse6H3GQGZsvqebgsgvpUI= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700016)(1800799024)(376014)(13003099007)(56012099003)(18002099003)(22082099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: H8AyWl7dc4ZEMqZGFVbpB4J3cIytP3eUWxik3m4V/nYc0XHWIImvSqUJprw8LIN8knBWjnxkHq1C0WpFSbtHtxOjuIZGchW98/wiwrgis0cgM+cLj1Lm6R7GbbZCi51Gm5PZzB81yEt6oFmD3j8+ZBQfr0LrYRpIwfMDyvgE7K+qUO/IKLVtCE0IksidZ+OahEEOSechMkUtt93yqbdFNY3u0mSPQt1owCP3TD/9HhfuTe+w8sltMgnKAYsidvz7uU18KplreE92wXoY4USIWQay7pZ+C2DXqIKTWOqqgpZOy+4CO26J4+Yhm5UNyaZYcyzglXJZRZRtNkwpOrnNAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8932 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D10.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6a2be441-1d3a-4dc0-d9fb-08de954ef3f8 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|14060799003|36860700016|1800799024|376014|35042699022|22082099003|13003099007|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: bMJIXjWby/9omAFnBlHXywVmfHqilouqMxdq8AcjiKAwS0pdkBhZlsjS6NZDXh84xWt5fzoSIiiSyn/MgrxMS1rG+TuYF6tIiQ82McX8htz+dBYnWDVc/LnhF56wiW9aRJeXzPbqTd6xRMtAFIbYfFEGZbESuo2weRHJZpjz0LH6QocnNfU4/w82Nxw65dEhs+/VpA7q2hiCJ3ASSKeujpXNZsTNYuYQf6jlpl7BbRZsCZ7xrrkA5NtbB3kbPXK+tVCmMFXdVRlAWBoBzq6zisZioSy9WAyszwJ7L/XXP8ngNLwEZeY16qJt+NpKWqjhToMvYXAYn8e9UmarIR8clVE+BJaXQmqKx+VsnBlhJxM7RLJSraosD3oCO4ByD3A220KJtA1vqOJWp1pB3yrSr/y/lBU8fU62ZGsuYIskYR6XhN4RWYEOZEjb57gOOwsMp5GSxxCjY6pdL2jjZTFWuKIyv4eI5k2mcI+1u4hTIpVrPLvyLXKnPffFZ1xCqmbcicS8gjMK6Sen8T7cWQpnM3TuY7/efJWPnzDkgC0i3LbUzRIHkx+nDfC2BkFpFb4grprMnszdlbvEL+lYXh7PQvtOAYHRmSpzXBNadI82D896CHvIXB8iIMnB4RYj75oxA4vv2+jyQo5egaU3XpyiTwl96y24v3FlArwqV4AHHn6s9L5R5QJN0D1cczxkKfbSq7j1hlq9mEDeSp6wTp+bH6gXN1iO8QIDi5eOJ6Jkk2Y= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(14060799003)(36860700016)(1800799024)(376014)(35042699022)(22082099003)(13003099007)(18002099003)(56012099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mFTbTPjLVdVz5vhj0za4LH1DXwKPTXTvDlOQuUceEvFWaWzn//6eRAxoDXZKd6W55szkj1zbI+kJK3fr6C6WKk+mtEvtwIqVBNOvbUEa95Y93RyRT1XoKExnrBMLodUF4XKdXr5T8HZ3WT2PBssonPhmmEwgNT91NihqRodvT6GZ8uuZc9q/7fw0Vo/B+XQwcYSGb7NLmO6Qr9lKCPBxH0cal4AMP69xasCRCCwv7zgrhb0OjXOWGsZtINs26U88pk+WmL+Nku2ag/X5WkjvkTUjSZ4F6Si3cbPecDpmGKIxZSRTKCh6MVtvf0gKcfkbIsUwWpB1HDWsw9oP7UXOHhoyapQbG7G6ApfUyDiu45XXRri05Nx/GjqeQ6c7RxdOGTQh9nLpB2a8XTeFWdv0dXZQRkhWgfrp5Bf91UKuRZ4Ww0TAULV7reqOUjBLj8M1 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2026 09:13:32.9688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09165c06-6cdc-4190-10ed-08de954f1b93 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D10.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8729 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Recent binutils (e.g. 2.46) switched AArch64 branch-protection emission from .note.gnu.property to build attributes (Tag_Feature_BTI, Tag_Feature_PAC, Tag_Feature_GCS) when GCC is configured with such toolchains. PR target/124365 exposed an issue where -flto with -mbranch-protection=standard caused loss of branch-protection metadata in build attributes. This was due to an LTO bug, now fixed upstream (8b39ec70741b7fb9d059b6944f30a6743dea996a). Add tests to verify both forms in LTO builds, covering: • older binutils behaviour (.note.gnu.property), and • newer binutils behaviour (build attributes). This ensures branch-protection metadata is preserved across LTO for both toolchain configurations. PR target/124365 gcc/testsuite/ChangeLog: * gcc.target/aarch64/lto/lto.exp: New DejaGnu test driver for LTO tests for aarch64. Copied from gcc/testsuite/gcc.target/arm/lto/lto.exp with minor changes. * gcc.target/aarch64/lto/pr124365-build-attributes-1_0.c: New test for build attributes with branch protection. * gcc.target/aarch64/lto/pr124365-build-attributes-1_1.c: Companion source file for the LTO test. * gcc.target/aarch64/lto/pr124365-build-attributes-2_0.c: New test for build attributes without branch protection. * gcc.target/aarch64/lto/pr124365-build-attributes-2_1.c: Companion source file for the LTO test with branch protection enabled. * gcc.target/aarch64/lto/pr124365-gnu-property-1_0.c: New test for `.note.gnu.property` with branch protection. * gcc.target/aarch64/lto/pr124365-gnu-property-1_1.c: Companion source file for the LTO test. * gcc.target/aarch64/lto/pr124365-gnu-property-2_0.c: New test for `.note.gnu.property` without branch protection. * gcc.target/aarch64/lto/pr124365-gnu-property-2_1.c: Companion source file for the LTO test with branch protection enabled. --- gcc/testsuite/gcc.target/aarch64/lto/lto.exp | 61 +++++++++++++++++++ .../lto/pr124365-build-attributes-1_0.c | 18 ++++++ .../lto/pr124365-build-attributes-1_1.c | 5 ++ .../lto/pr124365-build-attributes-2_0.c | 18 ++++++ .../lto/pr124365-build-attributes-2_1.c | 6 ++ .../aarch64/lto/pr124365-gnu-property-1_0.c | 16 +++++ .../aarch64/lto/pr124365-gnu-property-1_1.c | 5 ++ .../aarch64/lto/pr124365-gnu-property-2_0.c | 16 +++++ .../aarch64/lto/pr124365-gnu-property-2_1.c | 6 ++ 9 files changed, 151 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/lto.exp create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_0.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_0.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_0.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_0.c create mode 100644 gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_1.c diff --git a/gcc/testsuite/gcc.target/aarch64/lto/lto.exp b/gcc/testsuite/gcc.target/aarch64/lto/lto.exp new file mode 100644 index 00000000000..0c72d343174 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/lto.exp @@ -0,0 +1,61 @@ +# Copyright (C) 2009-2026 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Exit immediately if this isn't an AArch64 target. +if ![istarget aarch64*-*-*] then { + return +} + +# Test link-time optimization across multiple files. +# +# Programs are broken into multiple files. Each one is compiled +# separately with LTO information. The final executable is generated +# by collecting all the generated object files using regular LTO or WHOPR. + +if $tracelevel then { + strace $tracelevel +} + +# Load procedures from common libraries. +load_lib standard.exp +load_lib gcc.exp + +# Load the language-independent compatibility support procedures. +load_lib lto.exp + +# If LTO has not been enabled, bail. +if { ![check_effective_target_lto] } { + return +} + +gcc_init +lto_init no-mathlib + +# Define an identifier for use with this suite to avoid name conflicts +# with other lto tests running at the same time. +set sid "c_lto" + +# Main loop. +foreach src [lsort [find $srcdir/$subdir *_0.c]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $src] then { + continue + } + + lto-execute $src $sid +} + +lto_finish diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_0.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_0.c new file mode 100644 index 00000000000..c2819532f3f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_0.c @@ -0,0 +1,18 @@ +/* PR target/124365 */ +/* { dg-lto-do link } */ +/* { dg-skip-if "" { ! aarch64*-*-linux* } } */ +/* { dg-require-effective-target aarch64_gas_has_build_attributes } */ +/* { dg-require-effective-target mbranch_protection_ok } */ +/* { dg-lto-options { { -flto -O2 -mbranch-protection=standard } } } */ +/* { dg-extra-ld-options "-nostdlib -nostartfiles -Wl,-e,main" } */ + +int foo (); +int +main (void) +{ + return foo (); +} + +/* { dg-final { object-readelf-attributes {Tag_Feature_BTI:\s+1\s+\(0x1\)} } } */ +/* { dg-final { object-readelf-attributes {Tag_Feature_PAC:\s+1\s+\(0x1\)} } } */ +/* { dg-final { object-readelf-attributes {Tag_Feature_GCS:\s+1\s+\(0x1\)} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_1.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_1.c new file mode 100644 index 00000000000..8f8b1830bac --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-1_1.c @@ -0,0 +1,5 @@ +int +foo () +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_0.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_0.c new file mode 100644 index 00000000000..091ecc83637 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_0.c @@ -0,0 +1,18 @@ +/* PR target/124365 */ +/* { dg-lto-do link } */ +/* { dg-skip-if "" { ! aarch64*-*-linux* } } */ +/* { dg-require-effective-target aarch64_gas_has_build_attributes } */ +/* { dg-require-effective-target mbranch_protection_ok } */ +/* { dg-lto-options { { -flto -O2 -mbranch-protection=none } } } */ +/* { dg-extra-ld-options "-nostdlib -nostartfiles -Wl,-e,main" } */ + +int foo (); +int +main (void) +{ + return foo (); +} + +/* { dg-final { object-readelf-attributes {Tag_Feature_BTI:\s+0\s+\(0x0\)} } } */ +/* { dg-final { object-readelf-attributes {Tag_Feature_PAC:\s+0\s+\(0x0\)} } } */ +/* { dg-final { object-readelf-attributes {Tag_Feature_GCS:\s+0\s+\(0x0\)} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_1.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_1.c new file mode 100644 index 00000000000..15f7c94dccb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-build-attributes-2_1.c @@ -0,0 +1,6 @@ +/* { dg-options "-O2 -flto -mbranch-protection=standard" } */ +int +foo () +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_0.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_0.c new file mode 100644 index 00000000000..fca83daa0c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_0.c @@ -0,0 +1,16 @@ +/* PR target/124365 */ +/* { dg-lto-do link } */ +/* { dg-skip-if "" { ! aarch64*-*-linux* } } */ +/* { dg-skip-if "" { aarch64_gas_has_build_attributes } } */ +/* { dg-require-effective-target mbranch_protection_ok } */ +/* { dg-lto-options { { -flto -O2 -mbranch-protection=standard } } } */ +/* { dg-extra-ld-options "-nostdlib -nostartfiles -Wl,-e,main" } */ + +int foo (); +int +main (void) +{ + return 0; +} + +/* { dg-final { object-readelf-notes {AArch64 feature:\s+BTI,\s+PAC,\s+(GCS|)} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_1.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_1.c new file mode 100644 index 00000000000..8f8b1830bac --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-1_1.c @@ -0,0 +1,5 @@ +int +foo () +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_0.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_0.c new file mode 100644 index 00000000000..728ad8e1ea1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_0.c @@ -0,0 +1,16 @@ +/* PR target/124365 */ +/* { dg-lto-do link } */ +/* { dg-skip-if "" { ! aarch64*-*-linux* } } */ +/* { dg-skip-if "" { aarch64_gas_has_build_attributes } } */ +/* { dg-require-effective-target mbranch_protection_ok } */ +/* { dg-lto-options { { -flto -O2 -mbranch-protection=none } } } */ +/* { dg-extra-ld-options "-nostdlib -nostartfiles -Wl,-e,main" } */ + +int foo (); +int +main (void) +{ + return 0; +} + +/* { dg-final { object-readelf-notes-not {AArch64 feature:\s+BTI\s+PAC\s+(GCS|)} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_1.c b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_1.c new file mode 100644 index 00000000000..15f7c94dccb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lto/pr124365-gnu-property-2_1.c @@ -0,0 +1,6 @@ +/* { dg-options "-O2 -flto -mbranch-protection=standard" } */ +int +foo () +{ + return 0; +}