Message ID | 20250402121759.1962001-17-jovan.dmitrovic@htecgroup.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 7D4B2384A88B for <patchwork@sourceware.org>; Wed, 2 Apr 2025 12:34:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D4B2384A88B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=htecgroup.com header.i=@htecgroup.com header.a=rsa-sha256 header.s=selector1 header.b=ElpXcbfB X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20720.outbound.protection.outlook.com [IPv6:2a01:111:f403:2614::720]) by sourceware.org (Postfix) with ESMTPS id 30055384A839 for <binutils@sourceware.org>; Wed, 2 Apr 2025 12:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30055384A839 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=htecgroup.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=htecgroup.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30055384A839 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2614::720 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743596354; cv=pass; b=mCXAwJ7OwTnyyn3EXaQfWVjimYJlUwxChV58YFr7EyxSj5MVJFDIPb6W5ysfy3dj3UtbRldpaqbQQ1ujloeOlhD/h+Qn9CwhzXTjntljXKqWBNGg7RzfNILud1TpNlHuKEGJI/4onXrE9gYfn6ZoPsjtqYo/Ufqp2DsS5Va6O1s= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743596354; c=relaxed/simple; bh=3KUFVwGD5mrCq67K3qVZVrdgzWfZFct1ici8RleowwY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MC2lQbFL9r99mxrXzKJwaNIA0rhxVDK/zVJjqOHvYnMuGuTfdnXiLWL0p2AxaRAmN5SF+xrcibAbSnUD9nrJqbUpVS54689Nqf89P5AwAJb2Nb6BLdALZgt5e22jRzVnlLcHgj+xXCoh1JXbO1DSLa4lLNJeUoq4c45A7zVwXHU= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30055384A839 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i7uyjiwYAvup95/NhYuNPtsVKHdRgypPYf1hEWnZfiyCzgAbNS7R1hzxYw5TUP/dLeu1Iiksgj9keicwBtSd+k7JE/3VodtkItx/v7EHNGv5DciX/DFQGBdqte5zkCUBcDBVI9RppQiax1uXJzQ53nopYb0Rx+q8R4EvWhjDexmoREZy26xWtZft/yb0n5yvSqkTRW1wFp95gGETYQbzQWidURt6adwr1C/9t4peSzaKVmJEEAhzHwFPCq0AhQqFyQIF3K8BM1d2yGU61EkghrmVNmGd49ip9RdnEWuDJ9NxjsQnmTvqzgGkuNnImaH/oV66OsOWkXcNVVUrvHbDbw== 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=1IjSbETBDCfEmKtsil4UfGEWR/3VgQqKrT8SqHp6Lmc=; b=cV8j1r4Y8ou6asDSiQFnr3rz8INVA1FNvv5UdQVuR8qY6pJjMOevJFtLLPsOyBm9u7cPMx5fMW10/Og+UMV35VWm/TnNBId/CWAsTIMmlCT7mvLH1UHJchBzesBHLWKI8LEnZNd9/rPpMmZtX/wFPydJPJNEcUoyQ76hCpjp01GunlPg643tWVQVZK7l6WnelIitaO0kcNo2PtXe/TqRuiwQf6H4EtgtdrTWJ6NzzZzPQf/vFaS5hjxonyZ+5Q2ddCM5cVKWHMv7pTEtKIiKFM5aBMpv7r1X1C0D5iQgVTNnsDgPlbggEivsNe3jxr3yLKmNJ4Ds8Kh4f2LzD+FlqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=htecgroup.com; dmarc=pass action=none header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1IjSbETBDCfEmKtsil4UfGEWR/3VgQqKrT8SqHp6Lmc=; b=ElpXcbfBswqrJ7BkTeJTLv5hIvakuPFihAlO4cpkwSY7ZdxfyZgZwD3VL2nTF5WTBj5qPNKcrZUZDCri1tC3etPFagH5Y2uGjry/cRMEwAue9buyUPEyD8IghAfGgoEbHv1yVzE7FzRp00aELY5F5b4yEhmCwW//7KnJhZOJiFrOVttuDEew/QU0wAoAXjYtHTQwKSXFE8v5LQrc6XwZrD8J7qDu1hHR5z/izfgBR6Kmf5og0D8ft5ue3tNHy4AhAIkxASR3uoGgHVUGU4eycx8Ivy8Wc7mtYZ4+400JYjoTlIxgyI7QYqBYJyy7oaOvWgKWpKP1N5TqwPJvURe/Pw== Received: from PAVPR09MB6451.eurprd09.prod.outlook.com (2603:10a6:102:304::13) by GVXPR09MB7030.eurprd09.prod.outlook.com (2603:10a6:150:1c2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.52; Wed, 2 Apr 2025 12:18:50 +0000 Received: from PAVPR09MB6451.eurprd09.prod.outlook.com ([fe80::4569:9af3:a4cf:48d]) by PAVPR09MB6451.eurprd09.prod.outlook.com ([fe80::4569:9af3:a4cf:48d%3]) with mapi id 15.20.8534.043; Wed, 2 Apr 2025 12:18:50 +0000 From: Jovan Dmitrovic <jovan.dmitrovic@htecgroup.com> To: "binutils@sourceware.org" <binutils@sourceware.org> CC: Djordje Todorovic <Djordje.Todorovic@htecgroup.com>, Kevin Buettner <kevinb@redhat.com>, Faraz Shahbazker <fshahbazker@wavecomp.com>, Milica Matic <milica.matic@htecgroup.com> Subject: [PATCH 16/21] Fix addr2line mapping - garbage collected modules Thread-Topic: [PATCH 16/21] Fix addr2line mapping - garbage collected modules Thread-Index: AQHbo8liFo6+h59F3UunPrjmVlqT+A== Date: Wed, 2 Apr 2025 12:18:46 +0000 Message-ID: <20250402121759.1962001-17-jovan.dmitrovic@htecgroup.com> References: <20250402121759.1962001-1-jovan.dmitrovic@htecgroup.com> In-Reply-To: <20250402121759.1962001-1-jovan.dmitrovic@htecgroup.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=htecgroup.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAVPR09MB6451:EE_|GVXPR09MB7030:EE_ x-ms-office365-filtering-correlation-id: f5c3dd30-4161-47ef-d9d1-08dd71e086f6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?GFjKSlWdLgCUH8vZKnZf0E3ly0?= =?iso-8859-1?q?HWNksMAtvO9kF3muUGrOz1Jx+0/+qVDqO3IDVf8H8PEZLvZHWICjow2/ZU4r?= =?iso-8859-1?q?sm1sEn9+IGksKkPTu84FET+i1wOld2EfrhO5udJOdtad0Bit95Br/0xK5XIS?= =?iso-8859-1?q?grPzVTH8IETLZKWw3M8J9TTEtCpVFd4InO+I+ifrzroLKh7wfZiRJvTEjtWi?= =?iso-8859-1?q?qKTeqyW6e51awvRV/koMhoJZ8yy2cKE5Z0jKydobICtkc/lOb1pbHjn2jYTG?= =?iso-8859-1?q?fJ2SkYKxG0hiOh/tu51Ts/IGpsYkE/7uLfMhK+bA7pm5pC+OnLSL6F6T9vGt?= =?iso-8859-1?q?kqX2UfwVj9TX4dlzONm4TdWzyC3RV5ZgHtXHBpi2ZTvliORT3P72ZgHeBWQU?= =?iso-8859-1?q?/xoy/1HPTJjcMv42wSR8O1sRht77nIs1DL/ef9KaA4xOOepjT42DCiVi2X40?= =?iso-8859-1?q?iCWfdPConlyq0p28UEbLQLcEA1OK94xC7yIzoOo0CxZJa5Kg7h/GmQqXlaF1?= =?iso-8859-1?q?6IDPBI08PBs6uBD8ApEAFqff+zUIGlajNjcwW6zlto8fFBq0MIFG5qV9t8a3?= =?iso-8859-1?q?r/eaEM7w1TdunobJatLD9GN5LRg3Fc4GnAegHsaFyFTvjH0aUxWaraiaYeGw?= =?iso-8859-1?q?LqJqYb4vBpW3tFTz5t4JES4r+/buxua1yQRU+6TndCVY07ahf4UlGI1bpreo?= =?iso-8859-1?q?YK8PnMW799a4XcRdvDddy4p5/WlWqFaYai+NLZKjaW/bGQe/KhCeazONTyiV?= =?iso-8859-1?q?nduwy1NSjohfSuWF0yZ+3OjyO/TJUJhMqP1DpEBX1LAvI9PO33dz/xrqgbgd?= =?iso-8859-1?q?9IccNa1k0kLp322o62DGUFDbKrp/a3DqKxrdKg/RXAuA2fznluagVr2B/RgI?= =?iso-8859-1?q?o0Z87CjBDX5JtA4YyVHR1M+3JDpe7OqrpQhNpwDiErsDvuCVvKoLf9PZByW0?= =?iso-8859-1?q?tCjJIS0I9MrZfMnl+j4vXdO+09404P2CN/UUDmsdiG78dxNO4lvWnQvofS3m?= =?iso-8859-1?q?/EsCNsHncPdY/RDsDAspdBYNH/JTob3Kc+wGtWBvfVhNv1pWnghvI6wrR4Pf?= =?iso-8859-1?q?X8znjxae3NDmK5J5dFrVWjenUkJ2mFtBQQ36R1zK1c/agAvQxm+S7QBS2/f0?= =?iso-8859-1?q?1bFXfPZPFotZj0WDwZCUzl/Jmump8znp0kdGCaKIYudy6THQ8gpOTuvmZhPP?= =?iso-8859-1?q?AQFHKsfz6ILdaeGnbnC6HKOymYeHj8e8kkaHXx60N+Q0ZPjpPz+MFd7wW3xP?= =?iso-8859-1?q?ETqMGiB5Z21QY5v45xbnnoifFi+GFMZ7s6loqNxgUTzjfd/nnb4bIew477UH?= =?iso-8859-1?q?+S8bYsjZAvugtFS26p0s2MVxmptLPOO2/Y+3WD2SqPJP1nwoJBygUsRljjBi?= =?iso-8859-1?q?X9vUhz1lsUzZ97M2grPe7dhmkPg0S9+U38b3MXnlQWcd6ija5oHARgiJoIqq?= =?iso-8859-1?q?hFqIwM20C0N8SkUUMOVvlaLZ6BMkXMo2B5da48lLduwDxU5QiW6JTMnodBe4?= =?iso-8859-1?q?VmLGdjrx/pH/PXAHM6s+X8pA8D/aT4ec503BRAAEvjyiZA+fM=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAVPR09MB6451.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?HtckXRfxLpT34RWjfuBULL2?= =?iso-8859-1?q?mHxdLIYAC8AdWAzbqvPZBangC5YlPKW1YEYUMnJy0cmyi9EXH2YMYCGIRUsV?= =?iso-8859-1?q?9yV+sEREsU4rgjm00AAmEdI6b4Kw89BD6jpkShhP6Nki1V475L1dLr2qOoW1?= =?iso-8859-1?q?8Q00BouVH+xSHVLv8mx8FS+WDHjqQgLSPuwzGw4lQcIl8gVq8vIgj2PYO7fl?= =?iso-8859-1?q?FvWOD39lsatQl+2KLzVAQTNPcrjeHY/eeNBY3DNexAR9OBw2O+ZZ7BpxHplN?= =?iso-8859-1?q?6FOxxwvAkBCTRIQFKDXuJoOi1pU/mGyvuh1nfCDrxUYu8D/JonqxSRJ6/jyD?= =?iso-8859-1?q?rZETx3fhknqDCBagR4ytg27E74nI/IlnO5ggrKmp+ZRCn8J+aaiYe0lFyoKF?= =?iso-8859-1?q?6nAQCRLD+gxiIYAS8nN0gwGbW6aBOzWiDu3nwqF+jRrhB3p1NDx5xKJEgzxd?= =?iso-8859-1?q?SITQLpuAWhTXHLsWLYty4upma68rKHE1+QtM0iuDJuonLXga5G1k1DLrumnW?= =?iso-8859-1?q?/wfP7HCaMJctJeDvqsM7WO6iJI492WxzIhJTJH+UOzo4afxMqIcY1GuW4OAU?= =?iso-8859-1?q?9OHYCI6AwvrwcRMygek/n/y03ww6y/hrm2+R6Sj5ehB8as6dmmIb+/03uaE4?= =?iso-8859-1?q?L3PEJ9ziploTZjn9YpzYIAdzFUD2szheRNZ3Rd5/cZ7PsVEiidXRs7BPOS2B?= =?iso-8859-1?q?yD448xrm4i588uSuqAtGj0KltBnj0Ka0oAf/VwxAH0Had5v3N8p9u6UKjBy4?= =?iso-8859-1?q?peSwd4ppR4yJsR34+4RkCpL0/DhSmbag0FOLJ5wqvW7XeMV+hpecBGY1NvGY?= =?iso-8859-1?q?MwmCFqOb6geRkpsGyE6IIEc2LLJEg6fBV1nyXiITDGB/bqGAMYeqiqbT2ak4?= =?iso-8859-1?q?RrQGjv/xkXq0kl97jgB2qkn4rdH0nSvCu/DVsCiKGZwZCzVBrCyxaSXHDEui?= =?iso-8859-1?q?TGbLgtc1UMVnProMogWz3IYRa7F3T3J14SWRYBW+Mn2ParZ4BO+iqPR+Vn1f?= =?iso-8859-1?q?DUPBAjMhWHgo5dVA8sgIM8gc5HO7DuLhDQvxRE4EbOFw1e+AWmmbuZ/40nMJ?= =?iso-8859-1?q?NJfvHHt8VSwgJdY/Ru0ZGqRYzqCj5FwBxQsE1mNk7XQHXzDjtEy5vIx8rBXy?= =?iso-8859-1?q?KUHzT3rniDzeyPD/jhcFGW/ktSLcj7jkYyxSQQ4sy3yhd+cqsindYdEI5BBv?= =?iso-8859-1?q?B/xY7osm8d367StIndG67BbLIjT4e6ryTGAOQ+sGfupkSHW574PjX1BiKSvE?= =?iso-8859-1?q?wH+DgGwolCS7aAsHMoGH9PNPm3QLTX97aNMt0SyVBzTwub9gEWpxHUvP93N7?= =?iso-8859-1?q?fppotGL9GhAljRCoJdA+6Gj3F+RcB/NN5pNGNLvSyGE8aTEx4Ns3a4wzlkwY?= =?iso-8859-1?q?2f/JGfFTh4CnYaC8WUygoK7KQ4f88KRd/cKbjhSkt+bKYrODsesSXscb82bv?= =?iso-8859-1?q?VjNp9fay6ZWRiWvPSKIuECioCBeCHX3Mwt3aDZq2Z7yl3v0EzMpyF/HJpNnw?= =?iso-8859-1?q?shN9fNiiurLfrZHvzlSutcBsGJ/x9J4dcockcHxPM6BqUvLb3P+4PvdbWigW?= =?iso-8859-1?q?iBX2+PYaexMCLDejKN+VSYXx0pjPJKPX/DxfDh+S7bB+hEj523wQDIVrvZ18?= =?iso-8859-1?q?U1V2lW/IUGt1nXyFSBsE3cViz3FSKJdKYBlWwWFsL4AUvF5xzTfjQBnMFPhc?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: htecgroup.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAVPR09MB6451.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5c3dd30-4161-47ef-d9d1-08dd71e086f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2025 12:18:46.9174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f85665b-7efd-4776-9dfe-b6bfda2565ee X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uHn/hrrEglxcwkkC2VCyNLPzXXdkYkEfAU50HFPtq9CgdnEmPyxREXavMrl/nxn5lfKCMFWOeJXdXjGy4mwGD1oyn91MKCqSDmfGCqFkN2c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR09MB7030 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, 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 |
Integrate MIPS-Specific Support
|
|
Commit Message
Jovan Dmitrovic
April 2, 2025, 12:18 p.m. UTC
From: Faraz Shahbazker <fshahbazker@wavecomp.com> Release branch only commit If all the functions in a C module are garbage-collected by the linker, debug_ranges for that module consists of a list of empty ranges. In this case, lookup falls to iterating over the line information without a range match. If there is other valid code at lower addresses (starting at 0x0), the defunct line information of a garbage-collected section will accidentally match against that address, producing incorrect addr2line output. There is no clean way of fixing this, so we hack addr2line to distinguish ranges that were truncated due to garbage-collection from ranges that were not specified to begin with. If all range-information of a compilation unit was truncated, then don't fall through to check line information, but pass over that compilation unit. Cherry-picked 038a17f from https://github.com/MIPS/binutils-gdb Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com> Signed-off-by: Milica Matic <milica.matic@htecgroup.com> bfd/ * dwarf2.c (arange) <truncated>: New field. (arange_add): Set/reset truncated flag for the range. (comp_unit_find_nearest_line): Short-circuit to fail for compilation unit with only truncated ranges. --- bfd/dwarf2.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Comments
On 02.04.2025 14:18, Jovan Dmitrovic wrote: > From: Faraz Shahbazker <fshahbazker@wavecomp.com> > > Release branch only commit Would you mind clarifying what this means (here)? Jan
On 02.04.2025 14:18, Jovan Dmitrovic wrote: > From: Faraz Shahbazker <fshahbazker@wavecomp.com> > > Release branch only commit > > If all the functions in a C module are garbage-collected by the linker, > debug_ranges for that module consists of a list of empty ranges. In > this case, lookup falls to iterating over the line information without > a range match. If there is other valid code at lower addresses > (starting at 0x0), the defunct line information of a garbage-collected > section will accidentally match against that address, producing > incorrect addr2line output. > > There is no clean way of fixing this, so we hack addr2line to > distinguish ranges that were truncated due to garbage-collection from > ranges that were not specified to begin with. And why is it necessary to distinguish the two cases? > If all range-information > of a compilation unit was truncated, then don't fall through to check > line information, but pass over that compilation unit. > > Cherry-picked 038a17f > from https://github.com/MIPS/binutils-gdb I don't think such should be there in the eventual commits. Jan > Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com> > Signed-off-by: Milica Matic <milica.matic@htecgroup.com> > > bfd/ > * dwarf2.c (arange) <truncated>: New field. > (arange_add): Set/reset truncated flag for the range. > (comp_unit_find_nearest_line): Short-circuit to fail for > compilation unit with only truncated ranges. > --- > bfd/dwarf2.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c > index ceca4225076..20d0ad933bd 100644 > --- a/bfd/dwarf2.c > +++ b/bfd/dwarf2.c > @@ -342,6 +342,7 @@ struct arange > struct arange *next; > bfd_vma low; > bfd_vma high; > + bool truncated; > }; > > /* A minimal decoding of DWARF2 compilation units. We only decode > @@ -2319,7 +2320,11 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, > > /* Ignore empty ranges. */ > if (low_pc == high_pc) > - return true; > + { > + if (first_arange->high == 0) > + first_arange->truncated = true; > + return true; > + } > > if (trie_root != NULL) > { > @@ -2339,6 +2344,7 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, > { > first_arange->low = low_pc; > first_arange->high = high_pc; > + first_arange->truncated = false; > return true; > } > > @@ -2367,6 +2373,7 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, > return false; > arange->low = low_pc; > arange->high = high_pc; > + arange->truncated = false; > arange->next = first_arange->next; > first_arange->next = arange; > return true; > @@ -4733,6 +4740,9 @@ comp_unit_maybe_decode_line_info (struct comp_unit *unit) > if (unit->error) > return false; > > + if (unit->arange.truncated) > + return false; > + > if (! unit->line_table) > { > if (! unit->stmtlist)
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index ceca4225076..20d0ad933bd 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -342,6 +342,7 @@ struct arange struct arange *next; bfd_vma low; bfd_vma high; + bool truncated; }; /* A minimal decoding of DWARF2 compilation units. We only decode @@ -2319,7 +2320,11 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, /* Ignore empty ranges. */ if (low_pc == high_pc) - return true; + { + if (first_arange->high == 0) + first_arange->truncated = true; + return true; + } if (trie_root != NULL) { @@ -2339,6 +2344,7 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, { first_arange->low = low_pc; first_arange->high = high_pc; + first_arange->truncated = false; return true; } @@ -2367,6 +2373,7 @@ arange_add (struct comp_unit *unit, struct arange *first_arange, return false; arange->low = low_pc; arange->high = high_pc; + arange->truncated = false; arange->next = first_arange->next; first_arange->next = arange; return true; @@ -4733,6 +4740,9 @@ comp_unit_maybe_decode_line_info (struct comp_unit *unit) if (unit->error) return false; + if (unit->arange.truncated) + return false; + if (! unit->line_table) { if (! unit->stmtlist)