| Message ID | 20250910113412.3059236-1-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 86BC53858CDB for <patchwork@sourceware.org>; Wed, 10 Sep 2025 11:36:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86BC53858CDB 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=mMLFBeeF; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=mMLFBeeF X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11012013.outbound.protection.outlook.com [52.101.66.13]) by sourceware.org (Postfix) with ESMTPS id A38BC3858CB6 for <binutils@sourceware.org>; Wed, 10 Sep 2025 11:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A38BC3858CB6 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 A38BC3858CB6 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.66.13 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757504107; cv=pass; b=sWZPGGMVyShN8VkMXj/2gy4sFf6xi7b4/1V3BN5cP4XgR0pmuVxrDMIoowALanHf/jYBdCDo7EFwL5MWnKmg1r3/Xye3r30a/IsFxTpzb4/wF0c1F7hlnEDYGsZ8BTAuBAJB6i0UzdEJzJvQp6NzTKTpOwP/u5MozHyucU/bDXs= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757504107; c=relaxed/simple; bh=LCIOL4GmxCwEUpJ4ZWKvFFwGPnVl7RjJBgYycdU+qXM=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=CnxWs9lw85lRNA1vlALnrvFlqgxR0jBHCLmPUtPfYUhAVcZ2bo6nSrkAITEpH2jm6JYSHfYBPE2C+LNgsYjvvdvTMQqStCs8vvcBtTZZPFU9kkP/RHMlkAPGKcVqbovo65JzsoLZ8AlqD2BvLmCp4RxGyssJCmXKI32TThQvPqQ= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A38BC3858CB6 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=pMja9OrruRIkmfHu7LfjuTuHuv5dTkmZjfC/SZn8XoUUmGNaYd0ljLM5VLdsUWsyt3XLUT7k9hNoi+fa2umgFhtuYP4eUeyVXk0PazELETIqnq3Kg+fXW4Xvfa4Jr8v10KbXC5vsCnSbLAy2o7pjRb7pt9z0OxHaWuPnbResVoug0qPiBftNGum7lB6BcFIDXxjLJgXGy1JeHAFW0mpxe6n2RQVcH4IdqaPDidxslnDcN+zjZiFK0nnZ2H33FkDlDX2GMdsMcT2F1kstmOY7R7FmrrpZFaK8n0ctGEvtVa249l9C6zolr+w4m572cqvJc6PCN7AjU2MCfYvTNmrkQw== 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=84rnQ3LGmrqIsHH/GCm7vrBQ+H9S8Ea/gBKETh4QOXg=; b=CGpIbC9gsW6vyGpXuj9TE727PAblLUgCZUEBQnEC3m9EsiehZP0OOR2vtKBt6WNESm4yCbJJEY92q3TN8D0sz4zJ6JRaHKvzcQWX9mjmCUn1YR8h8dP3Z5SQkVDqxFxitdaDnzqpIzC0Ado/jznYZPWeinaiM/LR9Ssxy0orPA6T8QdAuz71d5+ofj+nYKDGLXiDld95I1xEGl/nZxjSjyzjd9mdrhVq6hbAVcdqqRuPHGqu7sdhUz1BgohDPIM/CGVYa7dd20hZeJNWnFtDP/HdlLlJobduRcypIEQGAK/hHb9O+xk4yKTx92lKEq9mqDqDX749uiSdkJt4y+DH2w== 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=84rnQ3LGmrqIsHH/GCm7vrBQ+H9S8Ea/gBKETh4QOXg=; b=mMLFBeeFoKdKoJrFHLMPJOFW+H+YYsf/j81ab/gejNj1nLNFcwOHsty3ml6Xa7MK0jQ59Rkb2GLmh35xQqZMA1eKBvotVVvPc7dtgHF5sRiFj8IZ+b90pHlQEfCuXBhRzMHvoRFNgiEr9WPisTsSUUU2XwPhlJyToPbIl2A4pxo= Received: from DU2PR04CA0004.eurprd04.prod.outlook.com (2603:10a6:10:3b::9) by DB9PR08MB9683.eurprd08.prod.outlook.com (2603:10a6:10:45d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 11:35:00 +0000 Received: from DU6PEPF00009528.eurprd02.prod.outlook.com (2603:10a6:10:3b:cafe::6b) by DU2PR04CA0004.outlook.office365.com (2603:10a6:10:3b::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.16 via Frontend Transport; Wed, 10 Sep 2025 11:35:00 +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.9115.13 via Frontend Transport; Wed, 10 Sep 2025 11:35:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M5+9go0lSgiJ+n2MwtFM7Wl957Z6TFdkcxIMmRGmmUmTFGqPqi57LqXcdJIdesx6zpVdMeHRmPvvu6revy5GwkmSIRcx5IQZw4DqEAYS4bLY7cV06bK/dk8/Id0n44qe98lJB5sVRurnAwiokhnQG5LHCe/dD5d9rL/nDHt0AlPImDupDZvZYvLKHtwe4HL4JkS5EF4KV/u52t6yLURuNcqMX/5hI5Rq8tjnZbDKBNfMiRBQi1QjeU69ut628FNkxPSts2Y74+oxFkwv9V8iNRwjTDOc253dblGh5xjz9Mqi4ucLjpQndKxj/2hjAgJNgJXy5MHkRq+2FgZQGynn3w== 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=84rnQ3LGmrqIsHH/GCm7vrBQ+H9S8Ea/gBKETh4QOXg=; b=tJTV2nSFr5iKMRfDaSgPvrK/4/ovQ1F2HNAEar/E0pcVVYb8uEO5rySL+xa6QYviZu0UBAmEobsSQyTWlZ0m1XH8wZiS+sNvIvP/CwfVhYfZZe1gJX5otMhDvP9rCzxA9Wj/mGSL+VgomrSCVBjzh6MKUsZkoAmTxHm+85Dk925TD6oFDdA0Mh+38SsZT1VmroCI+5UZ06H83/ySZyNQqqfOt6V9NRxOCcInrXIvdiz5sv7bD0VPfwOyE0wepS7knacCOWOETQ/Q/dJp2POOU7MjyCbCnBxabbl51veU3aDs0ctKp505zGSGjL3xNiGG61HcYLwVT8b8SEHOnA8Qsg== 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=84rnQ3LGmrqIsHH/GCm7vrBQ+H9S8Ea/gBKETh4QOXg=; b=mMLFBeeFoKdKoJrFHLMPJOFW+H+YYsf/j81ab/gejNj1nLNFcwOHsty3ml6Xa7MK0jQ59Rkb2GLmh35xQqZMA1eKBvotVVvPc7dtgHF5sRiFj8IZ+b90pHlQEfCuXBhRzMHvoRFNgiEr9WPisTsSUUU2XwPhlJyToPbIl2A4pxo= Received: from AS9PR06CA0055.eurprd06.prod.outlook.com (2603:10a6:20b:463::6) by AS8PR08MB10248.eurprd08.prod.outlook.com (2603:10a6:20b:62b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 11:34:24 +0000 Received: from AM4PEPF00027A5E.eurprd04.prod.outlook.com (2603:10a6:20b:463:cafe::7e) by AS9PR06CA0055.outlook.office365.com (2603:10a6:20b:463::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 11:34:24 +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 AM4PEPF00027A5E.mail.protection.outlook.com (10.167.16.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 11:34:24 +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; Wed, 10 Sep 2025 11:34:19 +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.17; Wed, 10 Sep 2025 11:34:18 +0000 Received: from PW070M4K.arm.com (10.57.60.238) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 10 Sep 2025 11:34:18 +0000 From: Matthieu Longo <matthieu.longo@arm.com> To: <binutils@sourceware.org> CC: Nick Clifton <nickc@redhat.com>, Jan Beulich <jbeulich@suse.com>, "Matthieu Longo" <matthieu.longo@arm.com> Subject: [PATCH v2] ld: fix segfault when linker script is not found Date: Wed, 10 Sep 2025 12:34:12 +0100 Message-ID: <20250910113412.3059236-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: AM4PEPF00027A5E:EE_|AS8PR08MB10248:EE_|DU6PEPF00009528:EE_|DB9PR08MB9683:EE_ X-MS-Office365-Filtering-Correlation-Id: ff9270be-57be-4221-11e3-08ddf05e1385 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr,ExtAddr 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|1800799024|36860700013|13003099007; X-Microsoft-Antispam-Message-Info-Original: /QbUIWtT+sgsdih6A+qxT1hClK8oIBaFzS25z5KI4/KWusc55GA20mDws2GOWa9OfMQS4L4dTrs4yoq7QVlXKobN4/lubucngj22hr8AeW0R2YdFz5ydbOBywc/9LQRDlqIfAacXGP5C5BdHe/YVFKB4PaevuER3rel0sdGUQUUHut0YfDa4+ojm4JYbRKwK5CSS5ehJKgbLpViJ11HPQnCNZa3DAhKT9H2zG0yLO/stasKzQjblgfmOYVkLBoLl73ykNDd/F6dWlE19UsveIVC/bQ78tBqMKN7dwEG19IBe+ARPhVcJz84M++8wHmu2heIE2GgKcX9V5KkBzg4O1GBgII8Q1jf3AROFmmllv9C+4eXTG7DTv1RsedK5/kF+ynZC0FynT02HriZPOFEMlsfvWtpkzUxsY+ZPCOV49c4R+dfqmr3E3c4ww8sWLfMslshs3VrMIyKZfMBi8JJqI1k7YcH0dtoVR5ZX9RvIApMntUnkPdrm5thmLMur0pi2KN41jF6VsPAM0kC3qVcVYglYDeQN//av4EAEZbrdL1PHQYYFFMmAVznmbmt+xmmovZAHJQec7utcas7EQMDAFvo8+zaWkOaTVoOPukueQ6nlLDE1FFDWgKnizHEl6vtzjxFdJboPv5znfMdMoyg2bkSEQ4WpbB7x4+Roc6zG0Bzzu/A+9OW4+xM/CYwMs43/HZl6f+frL+mdioMMrKrCN7RzKJXmHBACs8VcWV1vGg0xg9ThdsfdXWJUfYo83/dGnWMzklljXpn/apnY6cKHMynQ4K4NplF7kp1Ods6EreR1hBJSye2i1A83mEWcemUiWLg1mfWS9Q2iO7+q8hKH+9FAgMTUzXtwrqZtpRHfolu2egNegCRItxaCX4fdvss2ugq4mTk8WJumz/h2kXDwNDAXNZ2Qx8HzRtaiF/+p7dNeg67pr7TBYM/H8qO7cRkkeHk+pa5kEwVoR9yhg9YJYXnKfqVdeCWm7SdMkRUigjrg17jwCRYTNMLZHeL0lGT0EDe2wAQF58WaWglb1Z4Bb01vzzXuDXlTzdbst0SIkTHbfPjWXE8CnYiq726aVrzXI9BTocvdGGukazJfKgEh2M82jbsQ7svQ0pNR+o1AWM01DiOT0nkpYWiGciEAVbcm6naEERxJRLMhhT9ONhZnc85QEMcw3BufM0bhUjg0YOAnMGIOxsVvjOuuLATOz86Y//tOfQ1/TKU7JzOB0p3kMZZ3bFSaomz/puqdOJKALlBV91RsSnxN1nnqP6CzZbpEN8HZV8O5iw5yh5uiC6I3o0n1IVykxAQi8UdnvvxpXZsOgUTj1mx5VX23sFMEsmbS+oCRWyKFUJuniCXPF2Hfkltd0njGvFP5fOjn+10TNnmhV7pqOZFEjw+XiDPzvYtVYQPSJe0W3DtLmuhkXuOtZdnkjX4XHLLJjO/suotCdmbBsOT9jyPAMZanXYF5drAY2Tgzuup6a5JGsTvaawYegQ== 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)(1800799024)(36860700013)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10248 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009528.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 35a65ec3-8bf5-47fd-859e-08ddf05dfe45 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|35042699022|14060799003|376014|82310400026|13003099007; X-Microsoft-Antispam-Message-Info: oIV1jlAiV7Y+OowtlghVkxlX0DcSMeyG4K1nQQoGFshD4aQivnKXBrZsS8/3kpkCLXq0QCCB6XVAeNBjrQiAxel1hR7Zu5Jga3d6q5NiiiAYUILL4QoabXgeYUIiQFU0olCyLfKAcYEh4sl1i3j6bBDt75ukfXhCBFkLgqT6VzVq+b6YU8ihosZST9LfyIXMUPnCyxkkUdTFNr8vw4OOSPgUv6Q9nGg3Qzdld5DI2pTGyOj9FPJyEoucTO8TXPCF3GfwwF0+GVwadQV8ohXn1/jFM7Jlarz6LlsVgeUu9XbTWYdRenAe68ApmHstYUXkqhIv4kEuZdhwTQapJyEkLQDdQwUlt/9R9h7S0Kbx3SejNwPvtaE7x8Wp0D9VxrIojsC3ROhWggThxrJrCAcFpJplyJExhaICXJFINfRaWrNsKh7ahP+YA/9gBdTSAIYLqqZa2hUL3NTzcilLRfZvVM909gLZAm+ChNq4KA8dXFbuFvRrSDEAe/JGo2pxVcEFaMICs7wQ6KY3njEqCG+YGtqEYbUUal/NqbnArn4r+z9usXxhD1IHx5xp3VKkKqnfjn4gPFpxeP1RCnrlUUQ96canCgIVbpKnWh4rUM6wCqaM78biC1GnimYICQXkWXU+k01Q2nyj5zBJPLTQbEjotxdbULXRXQa2Fhw9ke5wJR8OTnjrIeJuCwiTbZJxgW2jQtXPY+RUm3ihibJdbH3r6gZyqclsgRQ3bNJNMk7vIwO7Byfysojc5ne5/NleFkLkwuWFpuJL2/1/Tn7/25SKz0F9atxah+/D5RmVFDpSIPmVJrwshF2SHCPL/GETF7vtDPtLymYAc92ewQB5XjMaw8KzWvJLofTIxdl0U7hn4qqQnlF0/x08FT6utpr5t064HWughg2JBhw1mV6TVZheUWbyCWDD9lrsT3dRLeqqfbxKhyFabioIlrOnv77CB1ix9/Qzt36oLR0HOD+ub/7YVHoYKO2B0U5nRLDcWjqPa9KnWJ0FKL2tRruHLu+CcOxrTzzYIVx48vsgqayuGAI1oJ4dTuRiSvPqqglhuRH5IB5zRZGQvFJQfn+c0pcYisHiPFZXaBgXnrlFClYRakytY1L1etjjXWLEl96MuPsfnkyKnxrwtcwJ59WfK5Tl5gD6YDxwuEHEyEglxxxLcuu+pZRyKrLAOuHkGX3Bxgn2NcRZkombyFi20PaHkYXlt6Z607Z/OhTVU3A2NaPD/mq4ZlesFPm2juRdTaQgCl9abuj9bl0NVEnGt/b7eo9K3inN1dnvhbx6xSQvkF7AQ63y9VJUFs3E5O/fdo7fmMIzhSUte4VeBNCC38UmSNQSOUwjn64Lz6UFAJ3byQc+pH0+bP/EopTWSzT+GqcIpcAU8eoUtfoQfkgJ1aGY7wiaALjFWgiDzL2es6a43rOJS5amLtpdkA8KZ3LkdbEa48y39mhTFFqix2zfE+/e3SRLwOGZrUBEiJbkmUZSRDesR98wEg== 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)(36860700013)(1800799024)(35042699022)(14060799003)(376014)(82310400026)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 11:35:00.0591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff9270be-57be-4221-11e3-08ddf05e1385 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: DB9PR08MB9683 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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 |
[v2] ld: fix segfault when linker script is not found
|
|
Commit Message
Matthieu Longo
Sept. 10, 2025, 11:34 a.m. UTC
ld previously crashed with a segmentation fault if the specified linker
script could not be found. The issue seems to have been introduced
recently by d048eee2910 [1].
This patch adds a check to ensure that a filename was found after
searching the possible prefixes. If no filename was found, the function
returns NULL, and ldfile_open_command_file_1() emits a proper fatal
error message.
This change prevents the crash and provides a clear diagnostic.
A new generic test was also added to cover this error case.
[1]: https://inbox.sourceware.org/binutils/20250812143757.3565482-1-hjl
.tools@gmail.com/
---
ld/ldfile.c | 3 +++
ld/testsuite/ld-scripts/linker-script-not-found.d | 3 +++
ld/testsuite/ld-scripts/script.exp | 1 +
3 files changed, 7 insertions(+)
create mode 100644 ld/testsuite/ld-scripts/linker-script-not-found.d
Comments
On 10.09.2025 13:34, Matthieu Longo wrote: > ld previously crashed with a segmentation fault if the specified linker > script could not be found. The issue seems to have been introduced > recently by d048eee2910 [1]. > > This patch adds a check to ensure that a filename was found after > searching the possible prefixes. If no filename was found, the function > returns NULL, and ldfile_open_command_file_1() emits a proper fatal > error message. > This change prevents the crash and provides a clear diagnostic. > > A new generic test was also added to cover this error case. > > [1]: https://inbox.sourceware.org/binutils/20250812143757.3565482-1-hjl > .tools@gmail.com/ Okay, and thanks for fixing this. Jan
On 2025-09-10 14:01, Jan Beulich wrote: > On 10.09.2025 13:34, Matthieu Longo wrote: >> ld previously crashed with a segmentation fault if the specified linker >> script could not be found. The issue seems to have been introduced >> recently by d048eee2910 [1]. >> >> This patch adds a check to ensure that a filename was found after >> searching the possible prefixes. If no filename was found, the function >> returns NULL, and ldfile_open_command_file_1() emits a proper fatal >> error message. >> This change prevents the crash and provides a clear diagnostic. >> >> A new generic test was also added to cover this error case. >> >> [1]: https://inbox.sourceware.org/binutils/20250812143757.3565482-1-hjl >> .tools@gmail.com/ > > Okay, and thanks for fixing this. > > Jan Merged: f04c774b7d49912cc9dcb0cd613e819edb21c3a2 Matthieu
diff --git a/ld/ldfile.c b/ld/ldfile.c index bed04fbf9eb..83591fe21db 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -877,6 +877,9 @@ ldfile_find_command_file (const char *name, /* Restore the original path list. */ *search_tail_ptr = NULL; + if (!filename) + return NULL; + success: /* PR 24576: Catch the case where the user has accidentally included the same linker script twice. */ diff --git a/ld/testsuite/ld-scripts/linker-script-not-found.d b/ld/testsuite/ld-scripts/linker-script-not-found.d new file mode 100644 index 00000000000..61d4d8aa57d --- /dev/null +++ b/ld/testsuite/ld-scripts/linker-script-not-found.d @@ -0,0 +1,3 @@ +#source: default-script.s +#ld: -T misspelled.ld +#error: cannot open linker script file misspelled\.ld: .*\Z diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp index 40bfe1a56e5..7a23f435121 100644 --- a/ld/testsuite/ld-scripts/script.exp +++ b/ld/testsuite/ld-scripts/script.exp @@ -235,6 +235,7 @@ run_dump_test "ld-version" run_dump_test "ld-version-2" run_dump_test "pr24576-1" run_dump_test "pr24576-2" +run_dump_test "linker-script-not-found" run_dump_test "segment-start" {{name (default)}} run_dump_test "segment-start" {{name (overridden)} \