| Message ID | 20250918150606.1630916-6-matthieu.longo@arm.com |
|---|---|
| State | New |
| 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 782043858019 for <patchwork@sourceware.org>; Thu, 18 Sep 2025 15:09:18 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from GVXPR05CU001.outbound.protection.outlook.com (mail-swedencentralazon11013012.outbound.protection.outlook.com [52.101.83.12]) by sourceware.org (Postfix) with ESMTPS id E5CC23858420 for <binutils@sourceware.org>; Thu, 18 Sep 2025 15:07:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5CC23858420 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 E5CC23858420 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.83.12 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1758208075; cv=pass; b=htyKAf4OR0ZAjzF2K4zN7+GquJ5fgnSNsHq4gJVeJiJegQRxYslbkJ2RPTEL0yh785qUTeFtAiQHOvAneRcFGciF/aUDIWeNYDKegKqj22OkQn0KieMCxYCt89K1IK04+2i+ska3qdDo7Y16ohn6SX2STTRblWkHK7UjJWIaJXg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1758208075; c=relaxed/simple; bh=229pdwZ3X1jn3+RzymGHN35B/pdiIvxAqTzzoQkkyLA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=xF8HZh2diKL5a/Ie4hkc5lanbC2Uya0KK+jOUFluv8pcO1iL2Xn79Nk3oUpaqBeqPYjiQvsjI7DvmnNFeFdiyM1W9tRZw+uiAE2p7ccZHKm91xLAObDAPgFEUx08y7Ub5V6KYBUQz+Ldo+vuFxFt1CwpqLjCEwV8JGJGBNyCSGY= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=C7PBn228lou83N0V3sj96g5cyDQeNaWTH8N5fZOk2bt/oFDWFjXAbZ0I6ejcMIORcWjWxiR5R9G0zseyE3mJVnLb8l7R1iy09XQrrv5gKs16O2i0X/xt+gZj0P99bz8/ejcKWlLqirlxb0tx3rqvAypL2TkDS4xWSvr/u1u3GrriFxWQs/VbniUqxuS2baeUOw08JO/+HB7ukvx275qZeKwMwjYyr/SR9PRCWHQ4Ju41nMVAuA6GQvqYc3DB7v1gcd21C1qi04ZJUnUfsHnt/z2eKnjWUNPpm18yiIKJDadTyxINEHHzLUWAgGIkxcMFGQrqJ+uM//u543CUF1DZog== 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=mwIZz66PqoJADgoZgwewRUeu3rmAkrHLDDVU0vhlpxc=; b=OSnqPSSjPvRf9V+8f1bNUsCRp99l/zoIl5QY+rgXCVBRjQ2/zFu3pXn9jotPEQfOaW/u+DKbgsG7LFz1SckYC93gtosePQqH8T4FWK7ul/RmBFGi/grXoTxppSXwRRS1SyQd50Anv93vkRx6eX7co65mZ6TigmYn2u0e++eZvgVN9iz9aHqekLuH8Rib42z7NbqUvaoUv8aCXSzYgFwks8D20dlIMqWreBUNoHMVAznebrC7bSRa4nms1RUyMTyoSsqyF902DxbAUMCy304m9aEj/a11Vyw66gZXAIrxsHBqEp2F+TuUofvnxtBTby4ERuK8JnaXJpcmYHh6ig30ow== 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=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=mwIZz66PqoJADgoZgwewRUeu3rmAkrHLDDVU0vhlpxc=; b=krMf7StO6rCxSZQrAzLxqpp/OeHRc5Dz/VRU/6G7yfk5gLE8Y/cjZevZ+l7U+pz5uZWuuOUtxp4lcW6cjpNjqzDEEC3NmfMDUTOOUFgi2xE+JKYHfve4svNPHlfqbnSJAaUNrR3LCKxqJfPm30Mr+vAD/hM93d99NkaKlVPza1Q= Received: from AS4P251CA0008.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::16) by AS8PR08MB6070.eurprd08.prod.outlook.com (2603:10a6:20b:290::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.14; Thu, 18 Sep 2025 15:07:48 +0000 Received: from AMS0EPF0000019F.eurprd05.prod.outlook.com (2603:10a6:20b:5d2:cafe::b6) by AS4P251CA0008.outlook.office365.com (2603:10a6:20b:5d2::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.14 via Frontend Transport; Thu, 18 Sep 2025 15:07:46 +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 AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.12 via Frontend Transport; Thu, 18 Sep 2025 15:07:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=osFEYKQSTLRe2axQgSS+JYyvnugwcsIqW+wbVkrQi1ASvkOOOCZxMF4v9oXHR/Jw852jRnS2BHL2YZYDYf5xC4ytu1e0042ovIWPr5Mr7x6TBnBBWas+E8BKsTvReVpg9PXgIXwHH8TgncyZiFhdhT8NgX6pEgGp9w0SKWD88mN/MpbggcHYUZY4AZYATTiwDv432eWsndMviWXWcJKxb71K8vUVdr0O1lueTu9LpZywXABMSH86DfduD6+xL1ROI9EZzw0zuLg0c7zLTf2X0VbBbaHqDfwrzp2+ViiWzTn/PIK68+KsmDyoMbONj9uvxFZanJFp+ubXqk+WYMAAvQ== 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=mwIZz66PqoJADgoZgwewRUeu3rmAkrHLDDVU0vhlpxc=; b=W5DP2DYpJaUUi4d+XJCUlbPMV8TIyl5tJpf/xZ88yuSVPR0QjHuLm/KH+2GSi/KWcnBzZe5Vpm5RmocBszDrlcX8o/ZGuP9H7Diri1zs2aODzwQNXRXenXDbbnp9STXc4oJAe2VsaG7gmu5O7Fz5spX2arXjEUY45nDiCTQz13DD/XgcIvElm9SiHZZk58SK/1/XXVXzZ0RGpdtUnw+o9EA7j7UHUzGhU5K5WjYowbeKOlmw3R7IUemImK2Hn/uHJITVNd9/QNcAaH3IGDlxVStaIFWpljoNW2/jKPdWZTrHPsWWDrCF5vUXlC7KmuoNPChxqkkBwzfaxmym2ysItg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.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=mwIZz66PqoJADgoZgwewRUeu3rmAkrHLDDVU0vhlpxc=; b=krMf7StO6rCxSZQrAzLxqpp/OeHRc5Dz/VRU/6G7yfk5gLE8Y/cjZevZ+l7U+pz5uZWuuOUtxp4lcW6cjpNjqzDEEC3NmfMDUTOOUFgi2xE+JKYHfve4svNPHlfqbnSJAaUNrR3LCKxqJfPm30Mr+vAD/hM93d99NkaKlVPza1Q= Received: from CWLP265CA0472.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1d4::13) by AM0PR08MB5377.eurprd08.prod.outlook.com (2603:10a6:208:181::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.14; Thu, 18 Sep 2025 15:07:15 +0000 Received: from AMS1EPF00000045.eurprd04.prod.outlook.com (2603:10a6:400:1d4:cafe::4c) by CWLP265CA0472.outlook.office365.com (2603:10a6:400:1d4::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.14 via Frontend Transport; Thu, 18 Sep 2025 15:07:15 +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 AMS1EPF00000045.mail.protection.outlook.com (10.167.16.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.12 via Frontend Transport; Thu, 18 Sep 2025 15:07:14 +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; Thu, 18 Sep 2025 15:07:05 +0000 Received: from PW070M4K.arm.com (10.57.61.196) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 18 Sep 2025 15:07:05 +0000 From: Matthieu Longo <matthieu.longo@arm.com> To: <binutils@sourceware.org> CC: Christophe Lyon <christophe.lyon@arm.com>, Alan Modra <amodra@gmail.com>, Tamar Christina <tamar.christina@arm.com>, Richard Earnshaw <Richard.Earnshaw@arm.com>, Surya Kumari Jangala <jskumari@linux.ibm.com>, Peter Bergner <bergner@tenstorrent.com>, Matthieu Longo <matthieu.longo@arm.com> Subject: [PATCH v1 5/5] ld: clarify comments on /DISCARD/ output section behavior Date: Thu, 18 Sep 2025 16:06:06 +0100 Message-ID: <20250918150606.1630916-6-matthieu.longo@arm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250918150606.1630916-1-matthieu.longo@arm.com> References: <20250918150606.1630916-1-matthieu.longo@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF00000045:EE_|AM0PR08MB5377:EE_|AMS0EPF0000019F:EE_|AS8PR08MB6070:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bf9c046-649e-4d28-5eb6-08ddf6c520c9 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSp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c/DyHW0BTUl9M0vYPxZgMAF5cxEWnmzMLOzOmKcxYOdLDsUWIHyTRTegA2LWa8yceUCa4S+kbHJei5Z+Ta4+dT51u1Dg8/HTCA9sGS+fMjd4MPVHBeVa2x/3qbqG+bmErNYsouS3v4oJDDviuA79baahCUuSp85k+pKdJFSaJ75ZjbHLU/r0UXRqDJb4J8lpdY2zRTerJB/X3NtJEJiELbZsNS5t24fIieb2KRpvO2A7uOX0WWoKv3L0DrL8GXFZmnkP6arluOXc/CqZh67uyvk5cRhUW5QRpyU7TTOWTop5WMxLCIs/DwY/zFLj3t3YpHc1167rvKT/cR1qk8CtgwfVSfQSsIfU8lajiS1Cn+jb6gmNvOUOojHz4vIbMHvYA7qPnM6GNFXA0uB8gtWHlFghWtyObgL8g8GQBLC95MXXquKR4E8LNb0j+dQ0EJH21Ek2wJB76z5zehKGc3s534n87UX7IJbXqvSgl42fLYeiiKCTHF+T0qUmz5sDYK5e3789J8TuIUmLwGpQEzLyzU1ijWV4wpLSoul81WkxLnJVOC+i6VWjKzf 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)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5377 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF0000019F.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: eb89884b-e065-492d-691b-08ddf6c50d67 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|14060799003|36860700013|35042699022|376014|1800799024; X-Microsoft-Antispam-Message-Info: Uv9WqKmhtPkfyrMh9UVxKPN4yKl6zbJ/kWOA50TGG1wR/tVLP8LDKFrx8MoLQEZb9GO7fv5YnocA8TL972q7J3ecvvB5smXXcjGE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vA2oQ0hn04Kbad7F5l+HOqglEu+Wps4n3Zc44/u3Bx1juz4yhHN97DuCtVhIxXk4QLmoNm05yr0lddMk8CSab84qFkmqInk4/k9SJci8wBAJ/ue1S/qQFzGUCpnKQju/Z0xTkXNbpxtJ3SsqfrY/P86ghy+W2D6csB0ljCWMKLcroGoIHCs6w9istJfuyU2I2OSfcVwTgnXYhlM6AW5lC5SceJ6/awpuumnA+I/92Yjwz9pJKnZnZ+LRBVR9RN18xf86DVU6+GIar6tPpAaBMa4DAaDU4klx2eZCaFj9p6e0wWC0S59oIGBhIQy3A35FodUFIseE3qMYeKJFMvVFNJs3jbWuQ0XA8+bhvaG2 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)(36860700013)(35042699022)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2025 15:07:47.4558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bf9c046-649e-4d28-5eb6-08ddf6c520c9 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: AMS0EPF0000019F.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6070 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, POISEN_SPAM_PILL, POISEN_SPAM_PILL_1, POISEN_SPAM_PILL_3, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 |
ld: fix segfaults when non-contiguous memory support is enabled
|
|
Commit Message
Matthieu Longo
Sept. 18, 2025, 3:06 p.m. UTC
The previous comments made it difficult to understand how the /DISCARD/ output section interacts with non-contiguous regions. In summary, the general rule is that the first (top-most) clause takes precedence over subsequent ones: - If /DISCARD/ appears first, the section is dropped. There is no need to warn about potential behavior changes with non-contiguous regions when the section is already discarded. - If /DISCARD/ follows clauses that assign the input section to an output section, /DISCARD/ is ignored, and the section is kept. In this case, the linker must warn that the section may not be discarded. --- ld/ldlang.c | 17 ++++++++++++----- .../non-contiguous-mem/non-contiguous-ok-5.warn | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-)
Comments
On 18.09.2025 17:06, Matthieu Longo wrote: > The previous comments made it difficult to understand how the /DISCARD/ > output section interacts with non-contiguous regions. > > In summary, the general rule is that the first (top-most) clause takes > precedence over subsequent ones: > - If /DISCARD/ appears first, the section is dropped. There is no need > to warn about potential behavior changes with non-contiguous regions > when the section is already discarded. > - If /DISCARD/ follows clauses that assign the input section to an output > section, /DISCARD/ is ignored, and the section is kept. In this case, > the linker must warn that the section may not be discarded. Looks okay to me, just that again ... > --- a/ld/ldlang.c > +++ b/ld/ldlang.c > @@ -2709,18 +2709,25 @@ wont_add_section_p (asection *section, > > if (discard) > { > + /* /DISCARD/ is seen first and the top-most clause has precedence on the > + next ones, thus the section will be dropped. No need to warn about > + potential change in behavior with non-contiguous regions when the > + section is already dropped. */ > if (section->output_section == NULL) > { > /* This prevents future calls from assigning this section or > warning about it again. */ > section->output_section = bfd_abs_section_ptr; > } > - else if (bfd_is_abs_section (section->output_section)) > - ; > - else if (link_info.non_contiguous_regions_warnings) > + /* The /DISCARD/ clause appears after previous ones which assigned the > + input section to an output section. /DISCARD/ does not have the > + precedence, so the section will be kept. */ > + else if (! bfd_is_abs_section (section->output_section) > + && link_info.non_contiguous_regions_warnings) > einfo (_("%P:%pS: warning: --enable-non-contiguous-regions makes " > - "section `%pA' from `%pB' match /DISCARD/ clause.\n"), > - NULL, section, section->owner); > + "section `%pA' from `%pB' match /DISCARD/ clause. If the " > + "section can be assigned to an output section, it won't be " > + "discarded.\n"), NULL, section, section->owner); ... original line splitting style wants retaining here. Jan
On 2025-09-26 14:19, Jan Beulich wrote: > On 18.09.2025 17:06, Matthieu Longo wrote: >> The previous comments made it difficult to understand how the /DISCARD/ >> output section interacts with non-contiguous regions. >> >> In summary, the general rule is that the first (top-most) clause takes >> precedence over subsequent ones: >> - If /DISCARD/ appears first, the section is dropped. There is no need >> to warn about potential behavior changes with non-contiguous regions >> when the section is already discarded. >> - If /DISCARD/ follows clauses that assign the input section to an output >> section, /DISCARD/ is ignored, and the section is kept. In this case, >> the linker must warn that the section may not be discarded. > > Looks okay to me, just that again ... > >> --- a/ld/ldlang.c >> +++ b/ld/ldlang.c >> @@ -2709,18 +2709,25 @@ wont_add_section_p (asection *section, >> >> if (discard) >> { >> + /* /DISCARD/ is seen first and the top-most clause has precedence on the >> + next ones, thus the section will be dropped. No need to warn about >> + potential change in behavior with non-contiguous regions when the >> + section is already dropped. */ >> if (section->output_section == NULL) >> { >> /* This prevents future calls from assigning this section or >> warning about it again. */ >> section->output_section = bfd_abs_section_ptr; >> } >> - else if (bfd_is_abs_section (section->output_section)) >> - ; >> - else if (link_info.non_contiguous_regions_warnings) >> + /* The /DISCARD/ clause appears after previous ones which assigned the >> + input section to an output section. /DISCARD/ does not have the >> + precedence, so the section will be kept. */ >> + else if (! bfd_is_abs_section (section->output_section) >> + && link_info.non_contiguous_regions_warnings) >> einfo (_("%P:%pS: warning: --enable-non-contiguous-regions makes " >> - "section `%pA' from `%pB' match /DISCARD/ clause.\n"), >> - NULL, section, section->owner); >> + "section `%pA' from `%pB' match /DISCARD/ clause. If the " >> + "section can be assigned to an output section, it won't be " >> + "discarded.\n"), NULL, section, section->owner); > > ... original line splitting style wants retaining here. > > Jan Fixed in the next revision. Matthieu
diff --git a/ld/ldlang.c b/ld/ldlang.c index 454887d71f4..75cee7d605e 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -2709,18 +2709,25 @@ wont_add_section_p (asection *section, if (discard) { + /* /DISCARD/ is seen first and the top-most clause has precedence on the + next ones, thus the section will be dropped. No need to warn about + potential change in behavior with non-contiguous regions when the + section is already dropped. */ if (section->output_section == NULL) { /* This prevents future calls from assigning this section or warning about it again. */ section->output_section = bfd_abs_section_ptr; } - else if (bfd_is_abs_section (section->output_section)) - ; - else if (link_info.non_contiguous_regions_warnings) + /* The /DISCARD/ clause appears after previous ones which assigned the + input section to an output section. /DISCARD/ does not have the + precedence, so the section will be kept. */ + else if (! bfd_is_abs_section (section->output_section) + && link_info.non_contiguous_regions_warnings) einfo (_("%P:%pS: warning: --enable-non-contiguous-regions makes " - "section `%pA' from `%pB' match /DISCARD/ clause.\n"), - NULL, section, section->owner); + "section `%pA' from `%pB' match /DISCARD/ clause. If the " + "section can be assigned to an output section, it won't be " + "discarded.\n"), NULL, section, section->owner); return true; } diff --git a/ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.warn b/ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.warn index 730599ef289..7cf8af73a56 100644 --- a/ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.warn +++ b/ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.warn @@ -2,8 +2,8 @@ .*: warning: .* may change behaviour for section .\.code\.2. from .* \(assigned to \.raml, but additional match: \.ramu\) .*: warning: .* may change behaviour for section .\.code\.3. from .* \(assigned to \.raml, but additional match: \.ramu\) .*: warning: .* may change behaviour for section .\.code\.4. from .* \(assigned to \.raml, but additional match: \.ramu\) -.*: warning: .* makes section .\.code\.2. from .* match /DISCARD/ clause\. -.*: warning: .* makes section .\.code\.4. from .* match /DISCARD/ clause\. +.*: warning: .* makes section .\.code\.2. from .* match /DISCARD/ clause\. If the section can be assigned to an output section, it won't be discarded\. +.*: warning: .* makes section .\.code\.4. from .* match /DISCARD/ clause\. If the section can be assigned to an output section, it won't be discarded\. .*: warning: .* may change behaviour for section .\.code\.1. from .* \(assigned to \.ramu, but additional match: \.ramz\) .*: warning: .* may change behaviour for section .\.code\.2. from .* \(assigned to \.ramu, but additional match: \.ramz\) .*: warning: .* may change behaviour for section .\.code\.3. from .* \(assigned to \.ramu, but additional match: \.ramz\)