| Message ID | 20250918150606.1630916-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 7BF943858413 for <patchwork@sourceware.org>; Thu, 18 Sep 2025 15:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BF943858413 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=kGwPI0Jg; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=kGwPI0Jg X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013013.outbound.protection.outlook.com [40.107.162.13]) by sourceware.org (Postfix) with ESMTPS id 12CAB3858D35 for <binutils@sourceware.org>; Thu, 18 Sep 2025 15:07:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12CAB3858D35 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 12CAB3858D35 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.162.13 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1758208020; cv=pass; b=fIWeR+uB7HM6PExnEBOmMIToDe81qCLtwqAec/rVFwEnCs4Y1ojBHm4yf+aULyMKEGvM8VtOU65HBENE52JWVc/6cEQPcssoQOlkT/guOX5dfyOKtdDsUMNJB2Hh3Ib992yKv3RqujlrM9pe9Qy0DxHnC3aBk4KiECBZpzbtwdE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1758208020; c=relaxed/simple; bh=mATs0FX5/SdxGFlbt8vJaUOOBGps2jgkXy+Nq+Jfpjc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=pzNd3kZlmd/wR7o10fvYfjCR21SngRF1TKEWnYyxGr7M0xZfZpAQuy+XZB2vnYOFAPXs3D8kRLYS8SW0jKBETPM9UbYK3A+e8C9AKEk1MxY0frH0q5n2g8v6/7hUM3Dr+EmeQf91tqY+U/EtgX7o+Wepjq3AaSq6ugmdPHFH7GA= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12CAB3858D35 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=e+UOHJa630XFVmP5qRMZjzBrozHQZFDSJWl9Mp5gvP5ZbvOeFcCnNc8GWlZhPfS1ljc581jVgEPoJlhmrpeZfB5gYGfoG44Q4sLD1BLkgSD2kX2aSJty4Z9eho8IMTSWicZjV7CJptQrB0xiuarAQuXAE/P2e4JRcTybYnLNiWbHi/rnXfMPI2Py9YRM91SnmqjwSUDPb7TsUVrZc80HJqItBd0RFz7SV7SBZ9z2gCSZb2cyszsnvD/LOGmfqj6O6Gdp74YoNM25lZXu4rcICIl1wlGKeHMWMWMA1LDGHcu9vZs9yY/oiDTj7PTip3EBx6Ogh5vJ4FqoTBBIVVgbBQ== 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=7uM2/jhStYYx07kdi/hwLhVJMgqeC98F7P6Zj04tzd4=; b=NdCcLZHtsrA/J5okqkmwAVx8AR+mUaZERAdHzWHAzL+kc/3Kt02WsPhcS4EmZyly2KRr/P1W0/zWHiJy35Tzl2BXRL0v3nv1tZCodpBGG0F6WYfIlpKeBOJH2nDj4c7KQq78D7TIDvcHwBu3mSx8dE7wMKQIBFt21DFLlRiLxaZcsDtzAx+JqrnrNqugLqVxiAFn5zMhsT8y6tbsCsEUgYRBYxyAzL7bsSs2HOkrLHBcyv2am2mxr/fo8pTBv2AjBLyAqCegp4OzmSxLedauVUSR2WdYmS9HT5h+/hecizxauSdi62PfUk7mUwbG/LxRB1R68Py76RcrYxP3uCogzw== 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=7uM2/jhStYYx07kdi/hwLhVJMgqeC98F7P6Zj04tzd4=; b=kGwPI0JgvVETshaN5y7Sskuc0lwWC+1XX7vGd7Ma+5+UL4a3GhmIH4hBDUmknNNd0LhSL2TruUnXum4VjyZtsEgUeUFNX6g7GX0mkHs7HUR+nvIFfDDyPGETIPPgWim3F6pP/G2c1eJMxE7dBAQ1VYpSlin3W5g/EBMyRfOkJl8= Received: from DUZP191CA0033.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::29) by PAXPR08MB6653.eurprd08.prod.outlook.com (2603:10a6:102:15f::9) 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:06:55 +0000 Received: from DU6PEPF00009528.eurprd02.prod.outlook.com (2603:10a6:10:4f8:cafe::f7) by DUZP191CA0033.outlook.office365.com (2603:10a6:10:4f8::29) 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:06:55 +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 DU6PEPF00009528.mail.protection.outlook.com (10.167.8.9) 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:06:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d0wVheXbIGL69NnBghbaFoIrZ/rOW9LuF2ydIyYz4ueF975Q6MWeqyXtLBIFQ3aBRU2lBCeHcA9ewkq/+1Un+5FThLBmN8YG3hGPo/5Rm5txXMkYddaoD07wR4H2eSt+y1LvlFylkfkg3FMR+BiCVsSbLS1HsSDsRjGepoVEURmSKZMF6afQ4CdvtEhvU1LXxF6SvnCBS1wgNHhFD5vf9yFnXVPKmF8M+mRUZ3KC3/ZP5QMGbXke37mUB0/qfc/8iYEx5p+sbxeLuVKnCh0kGgrJYURZebIjzegrg8eGF85LrQ0whGyP90v8KXZir3p4x+FlZOc97TzDlXsGvaS6Jw== 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=7uM2/jhStYYx07kdi/hwLhVJMgqeC98F7P6Zj04tzd4=; b=jlBQqhRxlhm9wFYN2B/+gP2UslwU+rZpsBOM6W7CtCBgl1slD/TQDhXsIuf8+KphuZ1m6mPJmwfiubj3Nl+sXkXRZhuuXRXxHJ+o0wGPP829/cRdBmhwXqWzW6X8JkyVItHeEXn1Lb4WdIi3SRetsg9QRGVd6m9VZdLyzmcpG4tr7PIivs/HRG7+pB3LcacRhjg3vcE2God4+Qziz2Pkbl2Wt8DnaLwrBOVCXz6N16qKG1opk1ZEKuyWRuTyAWgtTWIohK22skiNg6bCn+dGxwBKNBr/eTnAA3vbTMbwDcFj2MoDvtWyYpXywtdpk3X/7nN5m8Juu7cd95QUtquMmg== 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=7uM2/jhStYYx07kdi/hwLhVJMgqeC98F7P6Zj04tzd4=; b=kGwPI0JgvVETshaN5y7Sskuc0lwWC+1XX7vGd7Ma+5+UL4a3GhmIH4hBDUmknNNd0LhSL2TruUnXum4VjyZtsEgUeUFNX6g7GX0mkHs7HUR+nvIFfDDyPGETIPPgWim3F6pP/G2c1eJMxE7dBAQ1VYpSlin3W5g/EBMyRfOkJl8= Received: from AM0PR03CA0079.eurprd03.prod.outlook.com (2603:10a6:208:69::20) by AS4PR08MB7432.eurprd08.prod.outlook.com (2603:10a6:20b:4e4::13) 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:06:22 +0000 Received: from AMS1EPF00000042.eurprd04.prod.outlook.com (2603:10a6:208:69:cafe::5f) by AM0PR03CA0079.outlook.office365.com (2603:10a6:208:69::20) 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:06:21 +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 AMS1EPF00000042.mail.protection.outlook.com (10.167.16.39) 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:06:20 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) 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:06:13 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.27; Thu, 18 Sep 2025 15:06:12 +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:06:12 +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 0/5] ld: fix segfaults when non-contiguous memory support is enabled Date: Thu, 18 Sep 2025 16:06:01 +0100 Message-ID: <20250918150606.1630916-1-matthieu.longo@arm.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF00000042:EE_|AS4PR08MB7432:EE_|DU6PEPF00009528:EE_|PAXPR08MB6653:EE_ X-MS-Office365-Filtering-Correlation-Id: 7515da2e-62cc-4a7e-9170-08ddf6c5018b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: hUrAqs0q+D7Ky4bdSQ70zPu0eTr0HDkrzlKNZrZ9mCMfelWQpHi3pw3batBxeksetk4LAWajfhjOsE3sOExZNPRLojZ7ntF+DzFnImfDRRYp2sjcFjYuTMckFNbZ9JnxH0XCRLBYqOnr07P3W21yzwoXTysPRDvXaFdbK+XmBiU0F/YiMW4k1/Tt9USv5AejQ8UYpUOrhmF8rl8+mM87H/Mu1b29cZSK48sWOU5zBHa/hBOgcDBnA7aRctTaZobrYlP2GIZwT7NUt1zys1Pbb8bjQEqKtrHDAUlZQTdZ6za4oobN5ywlfYiN9brL8YpYo9VoYWqsIOvGkS1IxNgEuN0Rv9If9B/2w8MSvDwFf9qTI1bV661zqizDmOlI+Gx2dmZ13AIRB3h+/QR0JVx+8IvY8E/QAxDhss9uer+e7l1O5BUv9ACjq2gzW5s7oobUBs6jImLUYfhmE5efI2ZEkblTtZtuzgctbYRkMQ3UpmfZVZy0JhdG0rSfu/YNButakMROHJYwOh1x+WR1sejSKGLF53J/w+algO0HgLBtVD3on7OfS/t1S5qdwixu6CigsXEwcuQTaKznWI4m2nCeRYYnXcQs0oAeqDbFQoHVOerQrjmr9HvMLmqKz9y9y/VYU2zJidpDIkmOglg541QKsYcHiljp64VRHRs8aFuRpHB0S4qysnro34wTo7Y5MmEWTy22uOxbay5+W/pZM07f13eyMkqlY0KVX5+4RxaISAdAYvihXvW90fdVQv+zxGdp9HQtfkjdp2JaY+bD16x7Sa3Wzc+9BoAJkT1Q48mreHBXSqbJZn1KawGeI8p/CNq0OKZkT7bsZBwRhgLz0SozFs5aJIaR4/9MIfQhjM+/CkhSaCn52tAmBlfb1I1aXWcI9/GDnfmcj0MV6eRvfaPp9kXD1IJ61bGpKTR90NHvOj3ubV5jEDC4NeoEidxh+6UrUd+95pCCAuuiobXbgT9M1OeN02d5XrZzUKMa/DcvEZSnFo75RncJ5M1QTRKa1R6HT9jnRpcORlJhf2MVkTSYHQmNgVMQCG57frXXffAA9DY/d4RM1REQZVSEwxjBCSn2v+d1ERcNcpVGRTIrl5UxIB5ItndOEFP8l2SH9IRze99IvJZ5dpvtwy9QAbiQm5Fkl6BmUpMc0WXsLKptdQCikVsJtwiSHGBZEVU3nkCointHK+X59xepxVNeQXGRu71LcnyJqaLeYHtliN5qAwQ3PabXN8jUe9gAg48VWbRq9ufS4J9VGhsWhvxlMwu7R4TgjeJxyDV1H2nnMifc55NN8+GDG/lLEX9MKHysyZvwplwJMxJEPkChlVjjJ6VcsVBLJqdciwLJEDMdprRJzWNj4cbqG8mnVwHGd1ZXt43vKS84cI67T936t0qWguqYf/lWH67uwM4tfY+R9Bqpd6WfzZMCRJS//8GnLgdvFB7jOery3aXA46jDnzzZFKMwdrd3WQMWZgQfn3RcepmwW1gO8RbbM65sBcruMUn7ysz/wXcWxaxJK/qsD+7OuSomOWxy 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)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7432 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009528.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 63ca7590-116a-4642-ce62-08ddf6c4ed05 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013|14060799003|35042699022; X-Microsoft-Antispam-Message-Info: +RKtvO1b01F7g1GoFsLmcK81bR3sK1c396AeXaLBybrXYdlpZt+Ti8Ft+Dh9LL1de5yqbAXx6WYPtwGbSbWX1wGm5Va1hAVc5izhedDsP54wgr2SP5XJuQQAMPRY7OecbwY7/mdrUDlMQ10/9vgCKUzNqmbv8OJEXxp47vpcK8OC3Pp5/xy/5r76R3PR0Eh22UkmzYX3AnRnqcfG498yvlG523NdYNOyo1tam6sc3H4f/qRr+g4m1sbJlmTu5dtjnnxWKY0TlZ6z5KK4x2X4pn17GpdEoT8R82sHsvbje30brFqtywQasDH+7I5QhRtWwiu1AxXuZ0d3D7eaK2GTGKOdF45O3hIcitokRBh8swF88IUEp1gSVnIs+V7y6mEzhbB4LcK/cqCSWobIruy86twYfF5dZQxtKH6spnOB348hIApVVb0uNgLZUX/JRgFHn/0cJm6jFNzf7BDRuKuukyl0y8rkcbM+wM3t6kE9BVuSlfuPbYNbxyXwQ3KhTddjQaBAqXEBjWMYH/tMs0i8jHbeEezYquO41yCBE25s0ohZxdxUsfoPMoODfYz9E7LYmaIe/NyF4VXAge/40HloRY8dfucGaWaXdcY65YoW5E9N0eFhzcV7YcYEL/9DZtL1f5rHoWlbqhayrBF/pn/6XWYO/Sw6m+KcrHk2VvskjIi8BRCJ2nLfmAIpHePq6cO2OO1SD+i2yYOqdakGWmHiwHhxiTLnKpcpHNIpe1yeRqaUkuP2pIfUPAQiqHCZ46M6DG9UDy0ceTyqRd0WUxADa9G4TCQs+c+43GjI22Ur+xkDSWiPWbSuL/rB9vOC/WInRPo2Gw3NBcmM4trcxFb03uqmOeFd6l4dQkPrkB4eoL1xl/DNyxCgUcc7h76R6jv0Fn9jdFRh2dhaLAp7OleoR9/KTASeimOQRPI+HnjfSOjYNwtiItK7BLC637WA6BbgVrod0qMPB3AKzP+J+/8CbLXfy66RPC9rQwADY+/6e20uO2NV+y8O5QpJ/TgSHvNC67ARn1ts3e5LSpLoWlXd3fuOX+yiUgJ/svsk6I56FrPKuoMKRsPka0hH8vva9G6jal0ZgnxbR8GqHHa36UYeudingH5wsiqXO7VolAn2c2IN1qxh+4HL6z2DI8U6vXsGNXcixq+TVLunVodh56xukDWEXkWm+fWuJMRf7K5X2+TvRvBdfebEuvKyR+WGw26IayOZsOoDFBBu9pJWiMVNK6oJKTVKEDK5DZQFlkYOsldTombXDICaTaNs1okapooehG1J0I3VigpfcoSSZkfTn7ZD0qAuZ17OIVaJrQUWr7nRE8geaNa9VOz9WWicoHQhe55I/JI7ebxb66HNGpMXAarj2wdOhbRa/YZKQNBXMPH1cNJ3T4M0ixYudQAi148M5wArT5a57+EOhSgm7r9gVgqnAkabfKYh04SEdIMipkMKJ5UJyZcYZojd9/rQCYt93WAsk3rcnsnoqQSyS5aNzeTF5q5Vq3j1Yr8LpSiKOau56fUtFQE5rI6YrnKq0SKQ 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)(376014)(82310400026)(1800799024)(36860700013)(14060799003)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2025 15:06:55.0229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7515da2e-62cc-4a7e-9170-08ddf6c5018b 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: DU6PEPF00009528.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6653 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, POISEN_SPAM_PILL, POISEN_SPAM_PILL_1, POISEN_SPAM_PILL_3, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 |
ld: fix segfaults when non-contiguous memory support is enabled
|
|
Message
Matthieu Longo
Sept. 18, 2025, 3:06 p.m. UTC
When support for non-contiguous memory was added, some corner cases were missed, leading to potential segfaults: - Stub sections were not consistently tagged. Only AArch32 did this. This caused other backends to skip necessary checks in ld/ldlang.c:size_input_section(). As a result, the linker proceeded into code that assumed that output sections were set, instead of emitting fatal errors. - The linker did not exit with a fatal error at the end of ld/ldlang.c:lang_process(), before reaching code paths that correctly assumed every input section had a valid output section. Previously, warn_non_contiguous_discards() would only issue warning on unallocated sections, relying on later unresolved symbol errors to terminate before a crash. This approach was insufficient, and crashes occurred. This patch fixes these issues by: - Tagging the stub sections in <arch>_add_stub_section(). - Adding BFD_ASSERTs in code paths that previously segfaulted, but correctly assumed that the output section was non-NULL. - Promoting discard warnings to errors and ensuring the link process terminates cleanly if any "unallocated section" errors occur. - Adding AArch64 test cases for all non-contiguous memory scenarios. - Updating PowerPC and AArch32 test expectations to match the corrected behavior. Regards, Matthieu Matthieu Longo (5): ld: fix segfault caused by untagged stub sections explicitly state code assumptions on output section in AArch64 ld handlers ld: fix segfault on discarded input sections not fitting in memory regions aarch64: add tests for non-contiguous memory regions ld: clarify comments on /DISCARD/ output section behavior bfd/bfd-in2.h | 6 ++ bfd/elfnn-aarch64.c | 2 + bfd/libbfd.h | 4 +- bfd/section.c | 10 ++- ld/emultempl/aarch64elf.em | 2 + ld/emultempl/armelf.em | 5 +- ld/emultempl/ppc64elf.em | 2 + ld/ldlang.c | 59 ++++++++----- .../aarch64-non-contiguous-mem.exp | 34 +++++++ .../non-contiguous-mem/non-contiguous-mem-1.s | 37 ++++++++ .../non-contiguous-mem/non-contiguous-mem-2.s | 17 ++++ .../non-contiguous-mem-3-ivt.s | 15 ++++ .../non-contiguous-mem/non-contiguous-mem-3.s | 74 ++++++++++++++++ .../non-contiguous-mem/non-contiguous-nok-1.d | 9 ++ .../non-contiguous-nok-1.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-nok-2.d | 8 ++ .../non-contiguous-nok-2.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-nok-3.d | 6 ++ .../non-contiguous-nok-3.err | 4 + .../non-contiguous-nok-3.ld | 26 ++++++ .../non-contiguous-mem/non-contiguous-nok-4.d | 15 ++++ .../non-contiguous-nok-4.ld | 24 +++++ .../non-contiguous-mem/non-contiguous-nok-5.d | 10 +++ .../non-contiguous-nok-5.err | 7 ++ .../non-contiguous-nok-5.ld | 30 +++++++ .../non-contiguous-mem/non-contiguous-ok-1.d | 80 +++++++++++++++++ .../non-contiguous-mem/non-contiguous-ok-1.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-ok-2.d | 88 +++++++++++++++++++ .../non-contiguous-mem/non-contiguous-ok-2.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-ok-3.d | 80 +++++++++++++++++ .../non-contiguous-mem/non-contiguous-ok-3.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-ok-4.d | 83 +++++++++++++++++ .../non-contiguous-mem/non-contiguous-ok-4.ld | 28 ++++++ .../non-contiguous-mem/non-contiguous-ok-5.d | 87 ++++++++++++++++++ .../non-contiguous-mem/non-contiguous-ok-5.ld | 31 +++++++ .../non-contiguous-ok-5.warn | 10 +++ ld/testsuite/ld-arm/non-contiguous-arm4.d | 2 +- ld/testsuite/ld-arm/non-contiguous-arm7.err | 9 +- .../ld-powerpc/non-contiguous-powerpc64.d | 2 +- 39 files changed, 1012 insertions(+), 34 deletions(-) create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/aarch64-non-contiguous-mem.exp create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-mem-1.s create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-mem-2.s create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-mem-3-ivt.s create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-mem-3.s create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-1.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-1.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-2.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-2.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-3.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-3.err create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-3.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-4.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-4.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-5.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-5.err create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-nok-5.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-1.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-1.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-2.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-2.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-3.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-3.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-4.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-4.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.d create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.ld create mode 100644 ld/testsuite/ld-aarch64/non-contiguous-mem/non-contiguous-ok-5.warn