From patchwork Mon Mar 10 17:51:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Longo X-Patchwork-Id: 107591 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 A8C3A385840B for ; Mon, 10 Mar 2025 17:55:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8C3A385840B 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=YyZ1CsqM; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=YyZ1CsqM X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20631.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::631]) by sourceware.org (Postfix) with ESMTPS id 5C0C43858C56 for ; Mon, 10 Mar 2025 17:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C0C43858C56 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 5C0C43858C56 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::631 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1741629155; cv=pass; b=YkqPuyvU4/Hjfz9UMY30jacBBZEPpDldhPDpUfLFtRKkb9rbebTkOQWUCKGgE88+aCEJQ8QvEzY2RxvQJp2CBNDn6OSo199ZpL2rYqDSxi6PsLQMSK6+UVsJvfMj6ZlYET/W9XYQQSM+e+XFixjzo7CTxhkatXHv6oek+lQpKvw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1741629155; c=relaxed/simple; bh=ti3D0djlLoi50Q00kmDefMyyV5svE42nOwgOpXkYQtg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=HEfkHcVQp1kNDyDmBRRbcCN1Ut9vWCyXs/NUG1vDSC8AxKG3/dHkBgAdaSDEOCtlCa4aDn6TEmQ6hnwX1HUmP6ZsoZn4J8c4/WuIw1vDB83tacpKKLd9KkEXSU7ABskYHyRqprQN4Ub3UdLlZB298cNv92eKTh9gzv8SHXq6WGQ= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C0C43858C56 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=lnDLBHC6g5lNajVj9nEB/zHyNTBynpZS7Ovvqh0mDVYrqZ7HePsFia5otTPT+XDlXYAsfBPs/mRad8g5GQpVEmE9zk94rNs3uJmCCWXuUxgw8hjwJm3hzLCeYw+HRYME+IX9vTJOl5W0NET47ku77MpmKP7anL2fjuObwpUFz4iCjRtcMMj+xA9TpAlggx0Qw369B1DPxc4eLrpkGXZsFxdDXsVqEjYJ4V3D/SsyE353eZmjTCffqyNUnkZJ9WMumrMkRCPzho6T1TqrQEouToO4wKnHqOw0qNCZFFEDs9b80lUQFjC+F+jzUpdC9lRlC2Ff9ukQ0KffSikn1rQsaw== 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=yH/PiKb6oZT4KSo127ZaehFlOAS78FyXESmRFxLTj4w=; b=Wl/1H+xbNalYVnwpItvMFecuo+SXTtsEqVQtiV9Jf25aVWldmLlK26FPikjol4pFaA4ybgms3cFNOx+T+WFdyrhWHHXdUmrgxoz7acYSeoGGkDU1U9ODfQER3y8a89sGoP4iysEnZ4YO41mlHIXJ5+1sv+7tjOfDmBQdMv4Z4n9BaHBzZ4gwgjpiHmNexSMoaJs3vns4yW0c5jeAVbusxVuG02JKn98PU+6MwPz6+MTKf1FHzqqdrBnEOvOCb5xaszZBDQZ6A+493QQDKwne4oX4alr7QvehnMZ1vlpAebXdLTssvyuchMfLOtjVfH37IDaUHZiKMNYfDyHnfncWtg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=yH/PiKb6oZT4KSo127ZaehFlOAS78FyXESmRFxLTj4w=; b=YyZ1CsqMvyF5iLf4d+X+1cyFd1lWia316ex0uScQyu2eUEGzk9lhg3bx/PhIyAGdL4wyhYDhxs8YZQHYebcJhxPJi6BCLkVxkUovM+IRJUDoqbXmJJsbRLCMq5lIDISDlZRLT7lfRfRpO7JnpRHmUAWf8NKB4zFnxqxGwm5Wvuw= Received: from DUZPR01CA0345.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::28) by DB9PR08MB7557.eurprd08.prod.outlook.com (2603:10a6:10:304::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.26; Mon, 10 Mar 2025 17:52:28 +0000 Received: from DU2PEPF0001E9C6.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::8e) by DUZPR01CA0345.outlook.office365.com (2603:10a6:10:4b8::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8511.26 via Frontend Transport; Mon, 10 Mar 2025 17:52:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) 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 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU2PEPF0001E9C6.mail.protection.outlook.com (10.167.8.75) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8534.20 via Frontend Transport; Mon, 10 Mar 2025 17:52:28 +0000 Received: ("Tessian outbound bc832f6acacf:v585"); Mon, 10 Mar 2025 17:52:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4ae768df8691df0b X-TessianGatewayMetadata: iOgZ1ZOvHyq86AwDTuZqyPOKdANwIld6ywIxz1zBk9nvWAkxdNIbar3kzmmKTagEe8yGex2nfMSAMuT7bLf5gJfBK9BpSvL7NhHQLwgcSQqvMuxS0XzKEdPXNaISUsVrJ6QFTyfk0X4LNNt2jBKE3WIHLDXyl2Uzo+JBtVbtXX8= X-CR-MTA-TID: 64aa7808 Received: from Ld0414c92e702.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B197C756-6ECF-4B3A-A452-B26A967101EB.1; Mon, 10 Mar 2025 17:52:16 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Ld0414c92e702.2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 10 Mar 2025 17:52:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UTcEu/JYUHfvgZMX/sFxmSQJgT/8y7pf6LcOJ4FjCbFRba+vMiBdv7gEJcrTSJTOSFVcTYNIq/79YXo/mkzRbNp7vW+XhJVfutK4tDbyGqRzTq+D2mceBqeTZNYRfBRp5E8SrMUaLosCarMqZnaS7EXHmci6W8hTEA+3a5sPl1biudRKG6VPD/ThGzUth8KXijQci4RSXdCH9O55WZqzVCA1EZy0BPuScvyN672HhAz0fUPxAUqqHbT4ET4NV0tfyMuniRtNcjJxMBZr0ICFt9W8y4ihnJ29yZnGpvbNNnj7/F47qOKLpfeGMaujQnXn8cAZ0gDPPzQGfxk//cWWyQ== 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=yH/PiKb6oZT4KSo127ZaehFlOAS78FyXESmRFxLTj4w=; b=TMJGiAbWw/dL0aIiU6hllQNdLiFcnMpCPGYnTmUT/2dwLlrqGw4ZQNFE52KIXP2Z9gMFWHH55W3fBRZDieG4i3OEraM/t4e56KZGhYKx7ltoKFBM8rE/uH/dx9IMBCZVEArDz5uxb6lCwkSMo4oHh+0il7bl2JdFMQV9FZDth17h6yvvF9IBlo26nd7BABie4bLOhdXdhhos5Px+H3jGxvgEP1YM4lZVW78z5e4yEugS0MUlydNVJqdYJbuG5r5oa9HZvOy5P5GeyyNzobcYwx8iHygxDAtbMpRHaUVMu+t55iRjToiS4caNGuubl5laNlqcUO7hQgI3MLvhwHmSgA== 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=yH/PiKb6oZT4KSo127ZaehFlOAS78FyXESmRFxLTj4w=; b=YyZ1CsqMvyF5iLf4d+X+1cyFd1lWia316ex0uScQyu2eUEGzk9lhg3bx/PhIyAGdL4wyhYDhxs8YZQHYebcJhxPJi6BCLkVxkUovM+IRJUDoqbXmJJsbRLCMq5lIDISDlZRLT7lfRfRpO7JnpRHmUAWf8NKB4zFnxqxGwm5Wvuw= Received: from AS9PR05CA0155.eurprd05.prod.outlook.com (2603:10a6:20b:496::8) by GVXPR08MB10985.eurprd08.prod.outlook.com (2603:10a6:150:1f6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.27; Mon, 10 Mar 2025 17:52:10 +0000 Received: from AMS0EPF00000190.eurprd05.prod.outlook.com (2603:10a6:20b:496:cafe::60) by AS9PR05CA0155.outlook.office365.com (2603:10a6:20b:496::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8511.26 via Frontend Transport; Mon, 10 Mar 2025 17:52:10 +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 AMS0EPF00000190.mail.protection.outlook.com (10.167.16.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8534.20 via Frontend Transport; Mon, 10 Mar 2025 17:52:09 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EX06.Arm.com (10.240.25.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 10 Mar 2025 17:52:03 +0000 Received: from PW070M4K.arm.com (10.57.84.208) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 10 Mar 2025 17:52:03 +0000 From: Matthieu Longo To: CC: Alan Modra , Richard Earnshaw , Richard Ball , "Matthieu Longo" Subject: [PATCH v0 02/15] Build attributes: add new abstractions for subsections and attributes Date: Mon, 10 Mar 2025 17:51:15 +0000 Message-ID: <20250310175131.1217374-3-matthieu.longo@arm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310175131.1217374-1-matthieu.longo@arm.com> References: <20250310175131.1217374-1-matthieu.longo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF00000190:EE_|GVXPR08MB10985:EE_|DU2PEPF0001E9C6:EE_|DB9PR08MB7557:EE_ X-MS-Office365-Filtering-Correlation-Id: 13fccdcb-83ea-4e14-e105-08dd5ffc52d0 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|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info-Original: 3diGHnke1jZu18vPlA2byhUzPLRXUe6jNMi9S3BH8RPHyRxnHhHonzzF07h3FH1rimliYa7O37YFCvkD10uQlRn5B7dgzOU3mA+PWw6VTYezun2xcjyW1Q4wGw7Ok0L7G2cYpwa+fmmvqFb1gESLkdIzRLWaPNUpH860Der1mf/q+oHGWAq8Bdyk3HY59HCvlWjpWB4ZbhY4ur9x+JNTEJxRy6uf7GPM1HmOGzOLi9530TLcCajcjEZSsn9A1q1HQKQeZGx1D6QdQNCeSx1rTDU2dwYYUlw5v1y/UnswMGzfj/K4Cs25KSiRAWFu/YlBrqRbx2UAMJt/Wtgx2sd1oOBriP+4ptvLSHpknXbZ4VSraS7/8GHhDe/NUfOleYdQwqDtAPncVyp4q8KZ6dayfIBJfehZIol8Mq8m8ll9yhL/KL16pAQZ5bqkiMyIhHuVxC7WpXvUnTnnE7RjVMPo/nL8V/bk0QJa1byq+4ijB1IGy9NsMEKrILLFKoih80NP9WRZkZVKTAonOGhUEfHM5PI+SMD28U/g1xNRlre+owGFuNunQYbxQ+1Y1icLpDVtK1VcvV/TFD+j1rqkWqhrbzfQY5GlievMQXnwOmLa0LT7/XvpRCFXxlphFlnGp9kFEXkKpufKes4vbjrqiC6frRdrKD2pjAQSrXNTu9nRzlm3le7Fk//rCnXaEeQYRSWe5Gk5vG0tmT18iXSV5aB8y+rfZFoeqNgy1aL4NzGsMRja18WliG17WWppXYCHgLzgo38Fcn+Rvq/J6KQ80K85CTZwLab2l+7k7J1bA3vbMvPeTfDUbkNPNM8iGDgEvs95guME7COllFG/OimX5stIMNAXHUgl/4vqtlrHOe2NYB0BterjuVY27hP3QY3dGmKqNC0mDyCICSX22llLFOQgjUB/D75qRVltBMwNefrWMrNFSGU1wRpaTxH4/yDAki2/dk3RHaSJNUnw2Bv9YOn44kaD8UuWQ+YBajcsEWUal5Jvt0OY4U298eQqZ3C9a1Z0rbMAQKcNOjzCO20FHSJmc9iXlWnME2UUSu6/X9CoxoWAE9wYmoMZ8Hgd0JggYU8KRNKPuRNHn4QGKJ9khY7NvkyDEJZpeajf9EJy8Q+SWRp0UXpYEYJzsNjN95QN2iBvIhltGk9g8zTK1hlJGmvqoN49Lh+iOBYJ/2baOgeW43xOmzcWP4CBcIIoFNjCyoDGdx4pFdvUHQkJc6bxpQZAP7MMUK8cuQ0z72d/PFayzm9VksRDESLNvzFQ7D7ER6BoNO+fnn4d+bnhITsSw+q8kOr13vXLYahtEz94v5Cy5l04dmGIwrM4/B4Hk1rQr2KYV0xakhqf4uJ0CYy3h7iztctkOxng3rYqjqx1Gu+jo9Pe34vfXxeqt5hVJidbBYRoE2Xr2gjILf4uFaIg7b62ap6d8+4Atck5eD+jqNbpeUYiLio1FDjgXPQR5LVeKtDa6ri9yJT3HNAD/TTnnTw7bx2aatSqj0RIorpIrQZrVtw= 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)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10985 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:20b:496::8]; domain=AS9PR05CA0155.eurprd05.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: da693fa0-c585-4730-859a-08dd5ffc4773 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|1800799024|36860700013|35042699022|82310400026|376014; X-Microsoft-Antispam-Message-Info: cO/lEbalNfdz65WlRgld8w5Hkxq38xMZS6aSpLfZDxSg4MPKR1kO/+mC5fZWXbL6qgvLD/4SKiuz/jlNkObj+3wEXpsWaYdDDXNU9iwXW7wPjuHON0jEGnPv6kdMSIYL2pKVLwbh5b1RCgk5NQd1T/jBnSC8JMk5TgS1acMH4buqeibA7krsVFLGnBPLTxEBhSpA+E/UcKOTAL7q/sr8BP1JCfvLVlHMo2WVgCm5K4UlfGrpRAh8uJkw0ZCTYoFltimVldvEY7DoWwiu5sjxLqZxRoNQm2bFZcBg2blyJrtykF6WgqGjfjvdBF05VaFbtr5tCkqfXmawTJYqYMsLqcRbaRhfU19fkCZ2733MLC+wgaoMEDcRnhJYYNXHPmHTIo0O6Eu74HDa14TXliE+N96PHb4hmlinKZzvgk2Z4Lv1kKr3daZleuOcyYuuIn79AzaqdU8UsAcsROjhONngq3TgmvSCRrgPGR52aYSbID045M0HKOOK/M8tLaA1LOpLY1vmFYDRjL5cNjmzioU6ASChyt1vTyEWQ+rotGkBRb1M1F+xjajSGOhD8lnMct3gc3wHatw6wp64RJ7tKA8MO7a6tFnY1ycecZ2a6o2HgnguO3qtEF0t6T5nf9buBUDVjMeyCUmuLYPKVERNxvhKk5nBZC8uIlnr+bItEjcFZePmSBd4aafj7/1NFJydSsQlIs3ic/r8YTJgyRqTAihcD2pD5liM0VYq711hHXgF72pxGw0j1OioxhDDlltKZh3zBu0+jnbQ1+Sx01s+3wKyDBzPFDYLSR7Vumx8vN+INi2ucxc74a74nRRznL49NkybN22xw5QktyjJJJRz48GFF0WbARzdOLE6MAVkOLXR9VAfvM9Q6DPKKYlyRQYLMfQy1/ycj0psrHLqx/Xzf9hmEFLJU5eY7B8+0PKwqRXXN9V15IExoWpe1f9bWDYR59PExx/XBiboKVQx5m9M7tHZuRR3385dJUpiLZZTM/N8lrq2a4kHNa1OYInhBg6DbTcgXIqJS0FQ0SasjFizpFyQiAiYXuiwKOUthQnVUgIdqPSoz8V6H8DcVc9j8Epm6lzjyY/t2isGV86kPuo+8hcD/v3ACwzkXrNOef8uKde5AuQ2+Ce9TvWGeazRkQYRm1KNl6eH6yho1wS3X8RlJAy7/8CjrCRyRUiQ+UTjyPyOavHz+dp5fg/CctMrC0c/x2vJj8OB8Wd/uyX3LM9E1O8qdzwVfPmO5Zo7UCrjBgA5kNYQzA8eGJmjd4rHdsfxIqC4RN+G0lWtft4bH+FpyalNOaHhNorr+5JK5yrTgD8XtjOnGnLJpjVFxqKo1/2N82oUu30/z6criB+DFuY+sPYJTTyXu/lLCjdSMbACRqsBI1Ys2bA5Ovf3Vzay9Dldt1GUjGfbIQbpOB9qujK1hefLvsjTDBeFmYIguXoF9bmYKFzUXCzkOBNzxr6QoFz/+CEz9uHZZB5I/4U8/yTh7/SSJc5KiGkSkwdleVzunBBtmSw= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:64aa7808-outbound-1.mta.getcheckrecipient.com; CAT:NONE; SFS:(13230040)(14060799003)(1800799024)(36860700013)(35042699022)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2025 17:52:28.2296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13fccdcb-83ea-4e14-e105-08dd5ffc52d0 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7557 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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 From: Richard Ball Co-Authored-By: Matthieu Longo --- bfd/Makefile.am | 2 +- bfd/Makefile.in | 2 +- bfd/elf-attrs.c | 209 +++++++++++++++++++++++++++++++++++++++++ bfd/elf-attrs.h | 102 ++++++++++++++++++++ bfd/elf-bfd.h | 42 ++++++++- bfd/elfnn-aarch64.c | 13 +++ bfd/elfxx-target.h | 6 +- bfd/po/SRC-POTFILES.in | 1 + 8 files changed, 372 insertions(+), 5 deletions(-) create mode 100644 bfd/elf-attrs.h diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 4987ac9cccc..0339db6b2b6 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -707,7 +707,7 @@ SOURCE_HFILES = \ elf32-metag.h elf32-nds32.h elf32-ppc.h \ elf32-rx.h elf32-score.h elf32-sh-relocs.h elf32-spu.h \ elf32-tic6x.h elf32-tilegx.h elf32-tilepro.h elf32-v850.h \ - elf64-hppa.h elf64-ppc.h elf64-tilegx.h \ + elf64-hppa.h elf64-ppc.h elf64-tilegx.h elf-attrs.h \ elf-bfd.h elfcode.h elfcore.h elf-hppa.h elf-linker-x86.h \ elf-linux-core.h elf-nacl.h elf-s390.h elf-vxworks.h \ elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 1543af7984a..ecc91d733af 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1171,7 +1171,7 @@ SOURCE_HFILES = \ elf32-metag.h elf32-nds32.h elf32-ppc.h \ elf32-rx.h elf32-score.h elf32-sh-relocs.h elf32-spu.h \ elf32-tic6x.h elf32-tilegx.h elf32-tilepro.h elf32-v850.h \ - elf64-hppa.h elf64-ppc.h elf64-tilegx.h \ + elf64-hppa.h elf64-ppc.h elf64-tilegx.h elf-attrs.h \ elf-bfd.h elfcode.h elfcore.h elf-hppa.h elf-linker-x86.h \ elf-linux-core.h elf-nacl.h elf-s390.h elf-vxworks.h \ elfxx-aarch64.h elfxx-ia64.h elfxx-mips.h elfxx-riscv.h \ diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c index a6a72369afd..634843b5162 100644 --- a/bfd/elf-attrs.c +++ b/bfd/elf-attrs.c @@ -20,6 +20,7 @@ #include "sysdep.h" #include "bfd.h" +#include "double-linked-list.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -476,6 +477,19 @@ gnu_obj_attrs_arg_type (unsigned int tag) int _bfd_elf_obj_attrs_arg_type (bfd *abfd, int vendor, unsigned int tag) { + if (get_elf_backend_data (abfd)->obj_attrs_version == 2) + { + BFD_ASSERT (elf_obj_attr_subsections (abfd).last_ != NULL); + switch (elf_obj_attr_subsections (abfd).last_->encoding) + { + case ULEB128: + return ATTR_TYPE_FLAG_INT_VAL; + case NTBS: + return ATTR_TYPE_FLAG_STR_VAL; + } + } + + /* Version 1. */ switch (vendor) { case OBJ_ATTR_PROC: @@ -822,6 +836,201 @@ _bfd_elf_merge_unknown_attribute_list (bfd *ibfd, bfd *obfd) return result; } +obj_attr_v2 * +_bfd_elf_obj_attr_v2_init (unsigned int tag, + union obj_attr_value_v2 vals) +{ + obj_attr_v2 *attr = (obj_attr_v2*) malloc (sizeof (obj_attr_v2)); + memset ((void *) attr, 0, sizeof (obj_attr_v2)); + attr->tag = tag; + attr->vals = vals; + return attr; +} + +void +_bfd_elf_obj_attr_v2_free (obj_attr_v2 * attr, obj_attr_encoding_v2 encoding) +{ + if (encoding == NTBS && attr->vals.string_val != NULL) + free ((void *) attr->vals.string_val); + free (attr); +} + +obj_attr_v2 * +_bfd_elf_obj_attr_v2_copy (obj_attr_v2 *other, + obj_attr_encoding_v2 encoding) +{ + union obj_attr_value_v2 vals; + if (encoding == NTBS) + vals.string_val = + (other->vals.string_val != NULL) + ? strdup (other->vals.string_val) + : NULL; + else + vals.uint_val = other->vals.uint_val; + + obj_attr_v2 *copy =_bfd_elf_obj_attr_v2_init (other->tag, vals); + copy->status = other->status; + return copy; +} + +#define SWAP(a, b) do { typeof(a) temp = a; a = b; b = temp; } while (0) + +void +_bfd_elf_obj_attr_v2_swap (obj_attr_subsection_v2 *s, + obj_attr_v2 *a1, obj_attr_v2 *a2) +{ + SWAP (a1->next, a2->next); + SWAP (a1->prev, a2->prev); + + if (s->first_ == a1) + s->first_ = a2; + else if (s->first_ == a2) + s->first_ = a1; + + if (s->last_ == a1) + s->last_ = a2; + else if (s->last_ == a2) + s->last_ = a1; +} + +int +_bfd_elf_obj_attr_v2_cmp (obj_attr_v2 *a1, obj_attr_v2 *a2) +{ + if (a1->tag < a2->tag) + return -1; + else if (a1->tag > a2->tag) + return 1; + else + return 0; +} + +/* Find the object attribute matching the given tag (object attributes v2 only). + Note: The parameter 'sorted' specifies whether the given list is sorted or + not. If the list of attributes is sorted, the linear search stops as soon as + it finds an attribute with a greater tag. */ +obj_attr_v2 * +obj_attr_v2_find_by_tag (obj_attr_subsection_v2 *subsec, + uint32_t tag, + bool sorted) +{ + for (obj_attr_v2 *attr = subsec->first_; + attr != NULL; + attr = attr->next) + if (attr->tag == tag) + return attr; + else if (sorted && attr->tag > tag) + break; + return NULL; +} + +LINKED_LIST_MUTATIVE_OPS_DECL(obj_attr_subsection_v2, obj_attr_v2, /* public */) +LINKED_LIST_MERGE_SORT_DECL(obj_attr_subsection_v2, obj_attr_v2, /* public */) + +obj_attr_subsection_v2 * +_bfd_elf_obj_attr_subsection_v2_init (const char* name, + obj_attr_subsection_scope_v2 scope, + bool optional, + obj_attr_encoding_v2 encoding) +{ + obj_attr_subsection_v2* subsection = (obj_attr_subsection_v2*) + malloc (sizeof (obj_attr_subsection_v2)); + memset ((void *) subsection, 0, sizeof (obj_attr_subsection_v2)); + subsection->name = name; + subsection->scope = scope; + subsection->optional = optional; + subsection->encoding = encoding; + return subsection; +} + +void +_bfd_elf_obj_attr_subsection_v2_free (obj_attr_subsection_v2 *subsec) +{ + for (obj_attr_v2 *attr = subsec->first_; attr != NULL; attr = attr->next) + _bfd_elf_obj_attr_v2_free (attr, subsec->encoding); + free (subsec); +} + +obj_attr_subsection_v2 * +_bfd_elf_obj_attr_subsection_v2_copy (obj_attr_subsection_v2 const *other) +{ + obj_attr_subsection_v2* new_subsec = + _bfd_elf_obj_attr_subsection_v2_init (other->name, other->scope, + other->optional, other->encoding); + for (obj_attr_v2* attr = other->first_; + attr != NULL; + attr = attr->next) + { + obj_attr_v2* new_attr = _bfd_elf_obj_attr_v2_copy (attr, other->encoding); + LINKED_LIST_APPEND(obj_attr_v2) (new_subsec, new_attr); + } + return new_subsec; +} + +void +_bfd_elf_obj_attr_subsection_v2_swap (obj_attr_subsection_list *plist, + obj_attr_subsection_v2 *s1, + obj_attr_subsection_v2 *s2) +{ + SWAP (s1->next, s2->next); + SWAP (s1->prev, s2->prev); + + if (plist->first_ == s1) + plist->first_ = s2; + else if (plist->first_ == s2) + plist->first_ = s1; + + if (plist->last_ == s1) + plist->last_ = s2; + else if (plist->last_ == s2) + plist->last_ = s1; +} + +int +_bfd_elf_obj_attr_subsection_v2_cmp (obj_attr_subsection_v2 *s1, + obj_attr_subsection_v2 *s2) +{ + int res = strcmp (s1->name, s2->name); + if (res != 0) + return res; + + if (s1->optional < s2->optional) + return -1; + else if (s1->optional > s2->optional) + return 1; + + if (s1->encoding < s2->encoding) + return -1; + if (s1->encoding > s2->encoding) + return 1; + else + return 0; +} + +/* Find the subsection matching the given name. + Note: The parameter sorted specified whether the given list is sorted or not. + If the list of subsections is sorted, the linear search stops as soon as it + finds a subsection name with a greater order. */ +obj_attr_subsection_v2 * +obj_attr_subsection_v2_find_by_name (obj_attr_subsection_v2 *first, + const char *name, + bool sorted) +{ + for (obj_attr_subsection_v2 *s = first; + s != NULL; + s = s->next) + { + int cmp = strcmp (s->name, name); + if (cmp == 0) + return s; + else if (sorted && cmp > 0) + break; + } + return NULL; +} + +LINKED_LIST_MUTATIVE_OPS_DECL(obj_attr_subsection_list, obj_attr_subsection_v2, /* public */) +LINKED_LIST_MERGE_SORT_DECL(obj_attr_subsection_list, obj_attr_subsection_v2, /* public */) + bool _bfd_elf_write_section_build_attributes (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) { diff --git a/bfd/elf-attrs.h b/bfd/elf-attrs.h new file mode 100644 index 00000000000..5d41bb98538 --- /dev/null +++ b/bfd/elf-attrs.h @@ -0,0 +1,102 @@ +/* ELF attributes support (based on ARM EABI attributes). + Copyright (C) 2025 Free Software Foundation, Inc. + Written by Cygnus Support. + + This file is part of BFD, the Binary File Descriptor library. + + 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#pragma once + +#include + +/* -------------------- + Object attributes v2 + -------------------- */ + +typedef enum obj_attr_encoding_v2 +{ + ULEB128 = 0, + NTBS = 1, +} obj_attr_encoding_v2; + +typedef union obj_attr_value_v2 { + uint32_t uint_val; + const char* string_val; +} obj_attr_value_v2; + +typedef struct obj_attr_v2 { + /* The name/tag of an attribute. */ + uint32_t tag; + + /* The value assigned to an attribute, can be ULEB128 or NTBS. */ + union obj_attr_value_v2 vals; + + /* The next attribute in the list or NULL. */ + struct obj_attr_v2 *next; + + /* The previous attribute in the list or NULL. */ + struct obj_attr_v2 *prev; + +} obj_attr_v2; + +typedef enum obj_attr_subsection_scope_v2 +{ + SUBSEC_PUBLIC = 0, + SUBSEC_PRIVATE = 1, +} obj_attr_subsection_scope_v2; + +typedef struct obj_attr_subsection_v2 { + /* The name of the subsection. */ + const char *name; + + /* The scope of the subsection. */ + obj_attr_subsection_scope_v2 scope; + + /* Is this subsection optional ? Can it be skipped ? */ + bool optional; + + /* The value encoding of attributes in this subsection. */ + obj_attr_encoding_v2 encoding; + + /* The next subsection in the list, or NULL. */ + struct obj_attr_subsection_v2 *next; + + /* The previous subsection in the list, or NULL. */ + struct obj_attr_subsection_v2 *prev; + + /* A pointer to the first node of the list. */ + struct obj_attr_v2* first_; + + /* A pointer to the last node of the list. */ + struct obj_attr_v2* last_; + + /* The size of the list. */ + uint32_t size; + +} obj_attr_subsection_v2; + +typedef struct obj_attr_subsection_list +{ + /* A pointer to the first node of the list. */ + obj_attr_subsection_v2 *first_; + + /* A pointer to the last node of the list. */ + obj_attr_subsection_v2 *last_; + + /* The size of the list. */ + uint64_t size; +} obj_attr_subsection_list; diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 5903d857faa..6c326d5db72 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -24,9 +24,11 @@ #include +#include "double-linked-list.h" #include "elf/common.h" #include "elf/external.h" #include "elf/internal.h" +#include "elf-attrs.h" #include "bfdlink.h" #ifndef ENABLE_CHECKING @@ -1630,13 +1632,15 @@ struct elf_backend_data /* The section name to use for a processor-standard attributes section. */ const char *obj_attrs_section; - /* Return 1, 2 or 3 to indicate what type of arguments a - processor-specific tag takes. */ + /* Return 1, 2 or 3 to indicate what type of arguments a tag takes. */ int (*obj_attrs_arg_type) (int); /* The section type to use for an attributes section. */ unsigned int obj_attrs_section_type; + /* The version of object attributes (1 or 2). */ + unsigned int obj_attrs_version; + /* This function determines the order in which any attributes are written. It must be defined for input in the range LEAST_KNOWN_OBJ_ATTRIBUTE..NUM_KNOWN_OBJ_ATTRIBUTES-1 (this range @@ -2160,6 +2164,11 @@ struct elf_obj_tdata obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES]; obj_attribute_list *other_obj_attributes[2]; + /* Object attributes v2: attributes of the same category are stored inside + the same subsection. A subsection can only hold attributes with the same + data type. */ + obj_attr_subsection_list obj_attr_subsections; + /* Linked-list containing information about every Systemtap section found in the object file. Each section corresponds to one entry in the list. */ @@ -2253,6 +2262,7 @@ struct elf_obj_tdata (elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC]) #define elf_other_obj_attributes_proc(bfd) \ (elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC]) +#define elf_obj_attr_subsections(bfd) (elf_tdata (bfd) -> obj_attr_subsections) #define elf_properties(bfd) (elf_tdata (bfd) -> properties) #define elf_has_no_copy_on_protected(bfd) \ (elf_tdata(bfd) -> has_no_copy_on_protected) @@ -3083,6 +3093,34 @@ extern bool _bfd_elf_merge_unknown_attribute_list (bfd *, bfd *); extern Elf_Internal_Shdr *_bfd_elf_single_rel_hdr (asection *sec); extern bool elf_read_notes (bfd *, file_ptr, bfd_size_type, size_t); +extern obj_attr_v2 *_bfd_elf_obj_attr_v2_init (unsigned int, + union obj_attr_value_v2); +extern void _bfd_elf_obj_attr_v2_free (obj_attr_v2 *, obj_attr_encoding_v2); +extern obj_attr_v2 *_bfd_elf_obj_attr_v2_copy (obj_attr_v2 *, + obj_attr_encoding_v2); +extern void _bfd_elf_obj_attr_v2_swap (obj_attr_subsection_v2 *, + obj_attr_v2 *, obj_attr_v2 *); +extern int _bfd_elf_obj_attr_v2_cmp (obj_attr_v2 *, obj_attr_v2 *); +extern obj_attr_v2 * +obj_attr_v2_find_by_tag (obj_attr_subsection_v2 *, uint32_t, bool); +LINKED_LIST_MUTATIVE_OPS_PROTOTYPE(obj_attr_subsection_v2, obj_attr_v2, extern); +_LINKED_LIST_MERGE_SORT_PROTOTYPE(obj_attr_v2, extern); +LINKED_LIST_MERGE_SORT_PROTOTYPE(obj_attr_subsection_v2, obj_attr_v2, extern); +extern obj_attr_subsection_v2 *_bfd_elf_obj_attr_subsection_v2_init (const char*, + obj_attr_subsection_scope_v2, bool, obj_attr_encoding_v2); +extern void _bfd_elf_obj_attr_subsection_v2_free (obj_attr_subsection_v2 *); +extern obj_attr_subsection_v2 *_bfd_elf_obj_attr_subsection_v2_copy + (obj_attr_subsection_v2 const*); +extern void _bfd_elf_obj_attr_subsection_v2_swap (obj_attr_subsection_list *, + obj_attr_subsection_v2 *, obj_attr_subsection_v2 *); +extern int _bfd_elf_obj_attr_subsection_v2_cmp (obj_attr_subsection_v2 *, + obj_attr_subsection_v2 *s2); +extern obj_attr_subsection_v2 * obj_attr_subsection_v2_find_by_name + (obj_attr_subsection_v2 *, const char *, bool); +LINKED_LIST_MUTATIVE_OPS_PROTOTYPE(obj_attr_subsection_list, obj_attr_subsection_v2, extern); +_LINKED_LIST_MERGE_SORT_PROTOTYPE(obj_attr_subsection_v2, extern); +LINKED_LIST_MERGE_SORT_PROTOTYPE(obj_attr_subsection_list, obj_attr_subsection_v2, extern); + extern bool _bfd_elf_parse_gnu_properties (bfd *, Elf_Internal_Note *); extern elf_property_list * _bfd_elf_find_property diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 548da1f8b30..21fc99c4c98 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -10760,8 +10760,21 @@ const struct elf_size_info elfNN_aarch64_size_info = #define elf_backend_extern_protected_data 0 #define elf_backend_hash_symbol elf_aarch64_hash_symbol +/* elf_backend_obj_attrs_vendor is unused for AArch64. It is replaced by the + concept of subsections, each one having its own name defined by the + assembly directive "aeabi_subsection". */ +#undef elf_backend_obj_attrs_vendor +#define elf_backend_obj_attrs_vendor "aeabi" #undef elf_backend_obj_attrs_section #define elf_backend_obj_attrs_section SEC_AARCH64_ATTRIBUTES +/* elf_backend_obj_attrs_arg_type is unused as the type of an attribute is + determined by looking up at the current subsection, not the value of the + tag. */ +#define elf_backend_obj_attrs_arg_type NULL +#undef elf_backend_obj_attrs_section_type +#define elf_backend_obj_attrs_section_type SHT_AARCH64_ATTRIBUTES +#undef elf_backend_obj_attrs_version +#define elf_backend_obj_attrs_version 2 #include "elfNN-target.h" diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 625243cac94..cff508dbbce 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -556,6 +556,9 @@ #ifndef elf_backend_obj_attrs_section_type #define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES #endif +#ifndef elf_backend_obj_attrs_version +#define elf_backend_obj_attrs_version 1 /* Default version. */ +#endif #ifndef elf_backend_obj_attrs_order #define elf_backend_obj_attrs_order NULL #endif @@ -808,7 +811,7 @@ #ifndef elf_backend_symbol_section_index #define elf_backend_symbol_section_index NULL #endif - + #ifndef elf_match_priority #define elf_match_priority \ (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0) @@ -934,6 +937,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type, elf_backend_obj_attrs_section_type, + elf_backend_obj_attrs_version, elf_backend_obj_attrs_order, elf_backend_obj_attrs_handle_unknown, elf_backend_parse_gnu_properties, diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 54b078b8295..4b8ccfbe2c8 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -132,6 +132,7 @@ ecoff.c ecofflink.c ecoffswap.h elf-attrs.c +elf-attrs.h elf-bfd.h elf-eh-frame.c elf-hppa.h