[v1,0/1] Enable arch-specific CFI directives and DWARF instructions only when required by the target (part 1)
| Message ID | 20250409103611.407140-1-matthieu.longo@arm.com |
|---|---|
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> 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 240953865C17 for <patchwork@sourceware.org>; Wed, 9 Apr 2025 10:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 240953865C17 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=eyv8fIF3; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=eyv8fIF3 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::7]) by sourceware.org (Postfix) with ESMTPS id 5050F385841F for <binutils@sourceware.org>; Wed, 9 Apr 2025 10:37:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5050F385841F 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 5050F385841F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::7 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744195031; cv=pass; b=D9xwnwoNj3KEoMP7uP+vLGMEVvAfRMEwX8IXmC9wzMkZbTXi/Chaq59xOA7wxYF+UXgW5o00a59i1WEIC2v2ZptF+20G9Xi2vSBwhjt+mryqpo2UI+ONs11fVyz/8s/LOtknNNu56GzQeYhZoexsVzJu0GXT5OJw//RwA/Fg//4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744195031; c=relaxed/simple; bh=pI0S15teZDAm76kx343gqXKzuv9fko1K7ANWjCuZ4I0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=DQT8Vo+gITTG5YIJAC93M3c/w9obCYj7C6istGFd2k8IOf1YGo+nDvwzHKwggzokkq1tw0JQYrF0iE+y+MSAS7W2s3sFEiLCj+K3LA1AGbiUCPaTbKn6Qy4s29e2cuMy62z1dCa2SFm9aDzs1Fhb2TaGCeFPhIYt6GD0J1Irimg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=xKRJZwpEyDQPIHON/bDTILTgK6TGn1Mk/e6+CL9wstHCZhXusNlVGW/7TJF+TBMe0NwF6znHc2u+VCcNloDrw60ADqx9exY/EMKOKR2ugUF0fmAqRVDZ8JzMCrp7N7kARoTYiivf2tbBM9lvU6bXd42cZKh87OLlCgPzEARyXdlW3juwQ/p/KfyzUkkbqc6T1m8t7ZGYwbPhMI3bgOouEu5BWgjqraObXePiifsMEhOmtBk5f7Pxgy9piAmQO5o30GT/d+45YdBkBpjmEqBUbcF7+ynbs9zdsk3vgQvjWAnucYpdcMxlqRA/NY2Vn1uAmPdKFbA+XCM09F8XBvTLcQ== 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=UB0c/O+037zHOl8qILHbbq1paUtpzKNmr6PLV8iJf8s=; b=W0oQTHQZvQiFPopk/FOtScBk8h3hbJ6M9fDXGdJsRDIUJ6doQ0ipYzoC/C+wpjVZpW1Osy4LMiwSQNQdpD+2gdxNi02TueYKwaJc4Hx9KyycFjMQMfXtPReWfcq7KdfGMPWmfVywEEZlSAi/DPKfrLslFCJlZU/+a+W9Je2le5XyGao/4p9QuXCfaGmHXwX+7GSQ9e8bEm2tsJCfeC9s7lwjcrKXrfEvdXrmQZOsW2ij4RjLCeffZIVllzYWsSBlV9gD3FuxaIgStaCZ+5tmP6d2XD3FNrwr9jEPi2RMmojS8BQd42a86h7FARDCnDrMZhSAV6g/Wu+Z/I1pUGKLrQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.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=0 ltdi=1) 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=UB0c/O+037zHOl8qILHbbq1paUtpzKNmr6PLV8iJf8s=; b=eyv8fIF3Z2x8nGXeI1JQ8cu3rw0PYMhFqazfxSTRGTbML7xebwHBfNX/0CypzCZhVoCtg6kYiOANS5WhsgNuQCn7UfsJFcv5LbjAfTN7AUCw7MGBoeQt4oj8tVaq7cRkrZsFWDmgJGVzNhouck1TyeXzZr4SxqvSGWitUchvT7o= Received: from DUZPR01CA0069.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c2::12) by AS4PR08MB7712.eurprd08.prod.outlook.com (2603:10a6:20b:513::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.35; Wed, 9 Apr 2025 10:37:03 +0000 Received: from DB1PEPF00039231.eurprd03.prod.outlook.com (2603:10a6:10:3c2:cafe::33) by DUZPR01CA0069.outlook.office365.com (2603:10a6:10:3c2::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.36 via Frontend Transport; Wed, 9 Apr 2025 10:37:03 +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 DB1PEPF00039231.mail.protection.outlook.com (10.167.8.104) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.22 via Frontend Transport; Wed, 9 Apr 2025 10:37:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IVvRZ4CIEU2KRgZ19J3p1ECI8SmmGC15f5A2KrRxs8NO+dajF0L4Jsi7ESFrbvW0GbtJNr/2TWZWjgGQEAPH7+VYGeLCEVjyYz/130Uqz2rqDv0R0zkcIP9Xd0AO072F5uHMUbSCFiXd+1ejyQmdRP4iVuE2EfMuhRLWb2xuYQ9S5eFimAEweORBuHF0IwaCGngnVZ32elRGDJz/ed3Bkql4lFZOxyjv8ZdxLq3YE/Bu03ckZ1X5VSSEo/V2DUQR7oCvNmpI8Sj6nBtfm6/6hImQe5x+zNK/sJ5vI9wrg/xPQmhHEWuY6K1L2NJKbe66qa78l4+BK0pccmmo+z3Viw== 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=UB0c/O+037zHOl8qILHbbq1paUtpzKNmr6PLV8iJf8s=; b=v6MkUGlY+noiW2Kec0EI/R8L5ZPTozr/j7q6GrCcJfrp5SQzbSrWnevv5e33szaOk3Ep+8wBtdpJPy997MUSW+QRxBMPX2u3LElhMgY/e7tcnCZeuX9fYEdWfTUmm6aVXPiQh/daGuIUZrWO0ASwiHMVh/fv2dMBLbbAgkq48lNZvu0mnCIyhMQ0WjH5fD1rt0dTz3zL/+sykdg9kqUo5eM+bJlS1qGOklQZDJIoggsrbK2FYn0idzmtbSTQ96Fts1S89Gj2YqZy1HDhJTb7Q5bSNm9n4MIKUtiDHvoa8o4Bh+BZFyH5zcteJGWWBbkOLelqBMPNQPA0YE+1zrw39A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=fail (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=UB0c/O+037zHOl8qILHbbq1paUtpzKNmr6PLV8iJf8s=; b=eyv8fIF3Z2x8nGXeI1JQ8cu3rw0PYMhFqazfxSTRGTbML7xebwHBfNX/0CypzCZhVoCtg6kYiOANS5WhsgNuQCn7UfsJFcv5LbjAfTN7AUCw7MGBoeQt4oj8tVaq7cRkrZsFWDmgJGVzNhouck1TyeXzZr4SxqvSGWitUchvT7o= Received: from AM9P250CA0018.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::23) by PAWPR08MB10898.eurprd08.prod.outlook.com (2603:10a6:102:46f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.22; Wed, 9 Apr 2025 10:36:29 +0000 Received: from AM4PEPF00027A5D.eurprd04.prod.outlook.com (2603:10a6:20b:21c:cafe::d4) by AM9P250CA0018.outlook.office365.com (2603:10a6:20b:21c::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8632.22 via Frontend Transport; Wed, 9 Apr 2025 10:36:29 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; Received: from nebula.arm.com (172.205.89.229) by AM4PEPF00027A5D.mail.protection.outlook.com (10.167.16.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8632.13 via Frontend Transport; Wed, 9 Apr 2025 10:36:28 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EX05.Arm.com (10.240.25.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 9 Apr 2025 10:36:27 +0000 Received: from PW070M4K.arm.com (10.57.82.178) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 9 Apr 2025 10:36:27 +0000 From: Matthieu Longo <matthieu.longo@arm.com> To: <binutils@sourceware.org> CC: Alan Modra <amodra@gmail.com>, Hans-Peter Nilsson <hp@bitrange.com>, "Jan Beulich" <jbeulich@suse.com>, Richard Earnshaw <richard.earnshaw@arm.com>, Jens Remus <jremus@linux.ibm.com>, Matthieu Longo <matthieu.longo@arm.com> Subject: [PATCH v1 0/1] Enable arch-specific CFI directives and DWARF instructions only when required by the target (part 1) Date: Wed, 9 Apr 2025 11:36:10 +0100 Message-ID: <20250409103611.407140-1-matthieu.longo@arm.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM4PEPF00027A5D:EE_|PAWPR08MB10898:EE_|DB1PEPF00039231:EE_|AS4PR08MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: c9ee15f1-929c-41ec-c642-08dd77527750 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026|13003099007; X-Microsoft-Antispam-Message-Info-Original: 4dP7XavJnaORSyRrZOHEeaSinU05qq7dqJtboUhyOLx1YaIEBmHXBb15MUnCrvilLjnmugjuHwaRZ2caAFpAxNOTqQHf5BrWEEipUUcItUxk9DoC4L3lmhFEzLtYBFjbs8ARGEpXYr6dHZOYkwDZDcudSSEPsYIfoVf2QzoNSYbgQLN9eE4cZbVwp0YNr90o1f8zc4sVWFjy0I+Mjd5tz36R3dJQpjipMQcFd4QeqirQFp0nE+X9O2ZAoixULLsYjAUVZFFkF9XabLrW1YwwcbfXDgzU875nFFwAiYugFak34wM8TpyGDVMFokpsvx/yTD6ZJvwd0BN6B4m8EpcQSD01T6vYRT3AF7hybTiwBmqW7Y9eAWGINjAmdy8cZJUi7YxH3W701XxA0Gr8i2z+tZ1/DvdK+Qlsl1hizQPqR0L4eNj64DmC8/WbsgCJkt+7R/ab/oqGQBwZT5NdrktOmGM/FWXmTs1Uj11Ab8VvBaFn6Wv0axDV6juyu7vpG8klZZz5NRB0jyNnuyUl6zC6davFDC8uBd8Uu0+S+cdTXhVFGyAPOkzEnc5O2lVdDj+Mj0Joc865TX5TB2V4j8pEzSdSQzx4Ik7yDcJX7cnuGblfR069poKVUqbkl5C97VKiglxwcvO5Ngeft1PBY+Ad44Nf0XBwItFlP6qxQRCrNZiVnGDv7aQpsVBA+hTl9Em7iC1zaGqHKMa8n9Jo0ysVALqqaeN28j1Ylgoe4aTCztos3od5tRJXi2EEuwa729xNVE6Ng8U0iN1T2xX1gbsIrD9AYf3jpDpt+vGnDFrfU9v4AUy5xFuOtikDvYgt1eJ9GK/FnfpAYd65EhZSWzjK/pNPAaNW1hiQ6OYw1EX+kqxH1YKfhNbseD6yOUPgE/Q/Fj2cpBrcnJDQ7LcENdEw9mYtfW/nJ6hUJOhB9fYlhSmnN1uDKUhhe+C1uvMCL/Z8cr6kM47VBH84vrwUQW5RfFICEm5k66CKdP7pr1f60NQ6u59oWisqkfM6DWA9PShjTvhdjbFNdiS/o0lQZEHNKUxbMyRsqDQUCfxQ1eoBoAjFY44A5ndFUFyJrGnc+dlLiSxxvGylGdAF5yZYPbY0zc/bXJO67HMin2+7z61LofJqL+tr69Tl1BQfLRF5lai9LNf57PzwGo+mJHmWEPpMHcTfRLB7tICEbo6V4FDbT/NMP9l17/BKJ4w1eKI25pRcbAUdoWguMXi45Vn3ES3f05/8Okq2wBQT9VIX7xLqsxusoPW/YOC34QCN+BcB6LiK7Mskys6nD6WJ7wNyHa134B6p+KILUAPCx2YyyGxufs0WCukRHJYzCUZKFczE1VxXMcORZXw8sT1IVPtIIOQ54NAr0lYRR1yBFlKMtw4Z3EiLDPJgEArEYAfs1uvuLGOH0WfSBLHWT9k38jiqv6NfAvxzoLiTx5Y5Z2o+ne501f6/NE8sx4HuHy7pD1hw5AVM 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)(376014)(1800799024)(36860700013)(82310400026)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10898 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00039231.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f5355f25-de58-46f5-8527-08dd77526314 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|36860700013|1800799024|82310400026|14060799003|376014|13003099007; X-Microsoft-Antispam-Message-Info: A8wR82jiTPi68QIxAeyBRYj1tirifu4Y5X923DczQKVY470Ek5bmwsAMQGhnyjzhkVgBFjP9Y8H+IASta3zjXDYAM5hIveFVy/R1X/TLtx5XTje2wPSC1BUPkY/jZZT3nlL+dbwYAfBfx0J+cNEjXhzzSMJV36erybwd/gblUAtFz6ZdXgDrZYDD6LkW09pOBfh8KkPQ/1K6JcWFxp1gO8cXkmY8vwMNs7MAGih1OROJopHbIQ0jsy4O6FyHQhO6ME0CKzxq/cXLUXDHRMtcPbQLsbYnlSYa84rs4ISMDcCIFFlrNzIeHwDg7p1+7JBh+ZXXeU96efPQjxxvptubkXMpLPx1tEbsj/vwAj3nASdv1Zo4O6au0gEMFMfs7E5uqN9cZxyb7ChOvF7Y76hVCwSFc6tMVXZJAAgwF2wg7whlRAr7mP1RGByfpIHOVetV0O2Yw0tKyrVsPPiHjwR0bWTxTP1jU7ogO4CVUrCsFOMZsoAvBuaqiLRctKw8z+PHvHTC1F5k7jCAVG4s9aFvbWr/fBZZkJesp6KaV4Y3IKKs2hvG1m89Fk9zyQdIU+6mtVOqlTlr+cV2Yb5ngOE1TTAQ5JgzEOdrpG/K83Sbwjk+k+YLPcoG8L+3yQLrAQR2oisKCJNUQF5BiM+ijdM8RcwyNB2rOHOdfx+cGvcvdbOVZ92SAby3QdP5qCLM3N5XFh0zu+RoOJWoygDcTk1gJmyd9uMWDreIEHJoZkrm4jmaxbPhp/vQY+lkPkBfueO4fyWYnnvzjy198wUhiLUXsNiH18pdCwsrosqhtsTfcOwPKB1gqWWc5Lp0Cp0fZaNqylUpYJHg5x6nMCvR3JqNtGEAfu/bQ10QA602gPFx4rXZI3qOYXWURaB1KLqXDAveE49TsfM9lkLLyBDiM4lGjWVmwsRz2pqkiX/+JDYjej62Odwd28Nsf3LEAGiex4ml4mpHNP0Vn8q03oVq4Baf46iIm+VQ3VIrqHCgPA/jf7COJwlp5XxYhEO3k4neqHJBL8ZbY0tZNBw6utv0crMYm2meX2VW3mIDJ+W3CGWf5H5am0DA4TJ8Ygb+pzl0mJh8NaU6a7BhvssDuLqMnjObnAn72au/7MPkDXa4fTyop+/CSB4+9Y+b7MC0WT9oFk6x5nA18AhEnoUPv1lhJ8PNUDpGdBfs4N708B9D15gpTVWdgPQRhPkHJoliTt54QEtP2QYbKFCuupRVbXeM/UFW2/eLGlsfW0zNUImUX9zaJjPsWOpz6tSgWSAiKjnrx669JYs6tc/AurtlBA55cnSQy7uLcJgsAJBihUg1/t80ZZJOMNErku14dOamhGv7nUm26eiwNiI2cZW3re/0lMKNrV3kf7awhNGgGyLHjWqd+BUxrzmeO4zfGHi4A4K2bZZ/bCxRCa6646eciCwMFeMnGr31+cgs+m63f8UUvZhln+qPRUy0ktafACXIGqkRqvnC 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)(35042699022)(36860700013)(1800799024)(82310400026)(14060799003)(376014)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2025 10:37:02.8346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9ee15f1-929c-41ec-c642-08dd77527750 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: DB1PEPF00039231.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7712 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=no 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 <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Enable arch-specific CFI directives and DWARF instructions only when required by the target (part 1)
|
|
Message
Matthieu Longo
April 9, 2025, 10:36 a.m. UTC
This patch is related to a comment from another patch series (see [1]), and tries to propose a solution for the raised issue while changing the approach proposed in a previous RFC [2] based on the feedback. ## Context DWARF 5 standard provides a space for vendor-specific DWARF directives. Binutils currently defines GNU-specific DWARF directives and vendor-specific ones for AArch64, SGI/MIPS, and Sparc architectures. The architecture-specific code is not guarded. This has caused confusion in the past, and .cfi_window_save (a Sparc-specific directive) was used on AArch64 in place of .cfi_negate_ra_state, the defined directive by the "DWARF extensions on AArch64" document (see [3]). In [1], Jan Beulich rightly pointed out the issue and proposed to introduce an `#ifdef TC_AARCH64` around the AArch64 directives in **gas (only)**. Gas only supports one target architecture (the one selected with --target), whereas others tools like readelf, objdump, etc. deduce the target architecture from the input object at runtime. Hence, using TC_<arch> definitions to enable/disable DWARF directives at compilation time outside of gas is excluded. ## Solution Since Gas is target-specific, the idea consists in detecting whether dwarf2.def is included from Gas or somewhere else. To do so, a new define MODULE_GAS was added in configure.ac to allow to detect the inclusion provenance, and the two behaviors can be observed in dwarf2.def: - if MODULE_GAS is defined (included from gas folder), the architecture-specific DWARF instructions are enabled/disabled via TC_<arch> defines - if MODULE_GAS is undefined (included from bfd and binutils folders), all the DWARF instructions are defined (as it is today). In bfd, the architecture of the input object is detected at runtime using bfd_get_arch, and only the architecture-specific instructions matching the target of the object are considered during the processing. This patch deliberately excluded from the scope binutils/dwarf.c that also requires a check of the architecture at runtime. This part will be addressed in a follow-up patch. Tested on aarch64-none-linux-gnu, and no regression found. Regards, Matthieu. [1]: https://inbox.sourceware.org/binutils/eaedfc6c-5666-4a05-a676-d25bf52b76c1@suse.com/ [2]: https://inbox.sourceware.org/binutils/20241211120553.1391850-1-matthieu.longo@arm.com/ [3]: https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#id1 Matthieu Longo (1): Enable arch-specific CFI directives and DWARF instructions only when required by the target (part 1) bfd/elf-eh-frame.c | 90 +++++++++++++++++++++++++++++++++++++++------- gas/config.in | 3 ++ gas/configure | 4 +++ gas/configure.ac | 2 ++ gas/dw2gencfi.c | 33 ++++++++++++++--- gas/gen-sframe.c | 35 ++++-------------- include/dwarf2.def | 38 ++++++++++++++++---- 7 files changed, 154 insertions(+), 51 deletions(-)