From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2081.outbound.protection.outlook.com [40.107.101.81]) by sourceware.org (Postfix) with ESMTPS id 29D723858014 for ; Fri, 19 Nov 2021 05:28:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29D723858014 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6Mk4BQ/WhUzV4Z7eLGul3TDuaipVYqTDEzwf2IdiS6dVk/a31i2QJhbHXuLMme33y8vdih5xeUfxjpnJLBLScYUMZBf+RipWAQ5KLMtnEetGsBo42c2bfzQr+/AKJ0cEFJ2Oxcgh7P0hzSFX7zxvqfme/xk5d41zsaW5Fa2qVxnLwPvSCZ46BeSE47fjVvfBNrFkz1ke9YjoqCuB91xWJNFtE+jJqw44mZl6gPFYLhkSvhBt4V9y27jqzzYEgiRLp44GVtg3J+KKnx2+CjVZc7rtK89tY2wE7ydTtsMp+POg6LgacksJLLJw+hNNmp5wuk9Egy5VgV0UBDIFxTYGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=fKA2Vg09rL+F1MsBCkV7DE0DyUw77u1b9nYkV1O1Jrc=; b=TuCJB3vkmXMNmDZu4aPR4wEzYHUYlaZWt4t8nyRzwa/tw71wsxrIjY3UNFhGBx6hXpO29wQVnPPNiYHrDQhC5oiKKKtxZwJh4YfHIRRN/ynt42o/9ltZRWgkQ0Khc3MglF4LRWuHtsqA1E1Bzcqjphk6AxeIMTkjWsgoHLdOzuGos4SP6R25jsBnZ3dPIEdHpVahOqpUzGTPMJPkNOy6zdeR6QzbgcwCCFt+QMab+S7cX5ezjiEGYq2iKfCQXU3+rgZRSOpK6UtIV/+kxBHUO5/NH9F07dlUKrCnNMtTcfj6iXBSFMP/BfuPPxu+Nib/gsuWzUGDxWkrSZlwyAWJQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from BN9PR12MB5243.namprd12.prod.outlook.com (2603:10b6:408:100::8) by BN9PR12MB5367.namprd12.prod.outlook.com (2603:10b6:408:104::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.26; Fri, 19 Nov 2021 05:28:24 +0000 Received: from BN9PR12MB5243.namprd12.prod.outlook.com ([fe80::b401:b961:fe33:2304]) by BN9PR12MB5243.namprd12.prod.outlook.com ([fe80::b401:b961:fe33:2304%6]) with mapi id 15.20.4713.022; Fri, 19 Nov 2021 05:28:24 +0000 From: "Achra, Nitika" To: "dwz@sourceware.org" CC: "George, Jini Susan" Subject: RE: [PING][PATCH] DWARFv5: Support for unit type DW_UT_type and DW_TAG_type_unit. Thread-Topic: [PING][PATCH] DWARFv5: Support for unit type DW_UT_type and DW_TAG_type_unit. Thread-Index: AdePMURJLq5tNUaoSQylxX8NCOhzvAK/8EHAB533OjkJF1Ccuw== Date: Fri, 19 Nov 2021 05:28:24 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Enabled=True; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SetDate=2021-11-19T05:27:28.3120025Z; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ContentBits=0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Method=Privileged x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e78a318e-b3ab-4b5e-4d63-08d9ab1d687d x-ms-traffictypediagnostic: BN9PR12MB5367: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:37; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EtDJe1as83keH5MfLzGrBiIy245Op7cMPwRmZV1+iAn0BjMXqgz402n2IjV9fjeOFKeiK63atY0VKDQzxFcFsf4HE5Rid/HR+eoDQ4zijB74drm7gGj3EIYxjqwWFEq4pdXbv5ktKwvFBlQ8VKdZQYU7fJNmmBdOQvcxkmWKyJYVvy3Bk1UNbFNNWA6uLKPvwHZfXwe8ISh1w8dAVeBDt1VZnR+unfDI9CZroxKnEAKVXPLh+vxeU1DKCd+nFNrn7CCtHQMf6oT72UpO/rPCq4KhmYwM54A6TpVj1/TPWwDM0M3OJpB+Li3F9LClWaa14tIigGpFOVsOgQKRUA00wSjj0gkaf7Y+GAlv4Ft21l13vlt9zRDAijrGySqyvFE//8jilg2khu+nh5W5zaRs+7x5b+hq3kjlfBqx0p2bd+bgfLfiwRPtfeTDzTzgb+XMMO/COWjKxXKlOaxPYa04doJms4rKuGhwoDAeBnUGVN7QjTvXu1HiaGpu/70KPLN52oSAZfyytJMBTU/wPA2247La7uxy/4lh7WKFxRidWOYCx9k0UfP8S/jO6TrwY/vwp1Tn/wJWOxG+cpBEEVMQtEW9Jl4A5fCbaDtRdSUr13ziLtn+rqvGgisR9zPhRDRjSlLiqbbZmL8jNOGwTx3fdSuJKBsnoK+TAjLOBnP1jIuu3Oi9uyoJkIh+PtQya49Xh4vq1jd56YTfKoVZ0z7OLttuVzNKCLJjroVwYDDOjyB6YaIhsLCDkPNGA42iOtvglMs5RCY5DuJRWqotIqpF1GwHgqxN0u1fVNK5NjTT7bXWwi6yWZPWqjPkMTw7i2zi x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR12MB5243.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(45080400002)(38100700002)(5660300002)(2906002)(66946007)(52536014)(316002)(186003)(71200400001)(66446008)(38070700005)(508600001)(86362001)(64756008)(30864003)(83380400001)(7696005)(6506007)(122000001)(66556008)(166002)(76116006)(4326008)(33656002)(91956017)(9686003)(8936002)(99936003)(6916009)(8676002)(55016002)(53546011)(66476007)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RNTHAXBKaJAQLn9LdHK2zN4EjFdgG5X5Q7cqcrGmk1OCvhY5IxxbVB1IrjBA?= =?us-ascii?Q?OaowH2lvllVWhg1HoCYqRKkYjGxm6U7cuIBSykhpKQyS80r8INJ/kTw2U5w1?= =?us-ascii?Q?Kbx5/PxlFFg4zsIdrv7UzkumYSX91ddB1ylSAB22np6VlSRWsXjaf+b2JQRG?= =?us-ascii?Q?CC5Pc+TDX4/LDJP9AhsNDYBcCh87iBuEhNDS9q+SowqGYol1pQUiBfvxAJBj?= =?us-ascii?Q?UiYlIHDTUFLQKHcgL39KeCAztB3FpuXBiQlM0gdFoFAf9VcXPxQugpQIp7dN?= =?us-ascii?Q?XrZe3H7tA8q1qcrqufgz9eGUHSW+XebPPo0MuKjTmMkgIYpTNeiniZauBMfn?= =?us-ascii?Q?WFRmhTneFhTM3CS/ip4rZAOQRnkYJo4jGql2f1JTr9k970gHVkaDC0pgZCO5?= =?us-ascii?Q?43ollK9mkHY0UxV1aTCat5nkZ5TK/wyxE2EPuYqh3twQVbxgTViW6Ak3tDE0?= =?us-ascii?Q?TANUytp9mJu9J0sjnIccXjGFV1JtH80oO5n3Iq/wpKRg+OqjjTxX99j81P0B?= =?us-ascii?Q?piJrOxJZ+moItAhuoKUGY86whiynvmjzotPGyalX5uN9wGdXudkH1fMdEl0m?= =?us-ascii?Q?JgZLvOCbyoL6iApN6HayqzgyqHLeSjT5otn1Z9pwHW/LaNpDO8+UDdHVYcXw?= =?us-ascii?Q?btD4iIxew7ZVJ1KqEiOAGSQl+kfpL8LG/zBXRnkQm9AWkVGFyhmJLOcn6lRj?= =?us-ascii?Q?qvma9oFVVbJCzyf9GBNoR11pMw7kC/STyl7ZseO3NmYgPJ2T2APdZJK/2xGy?= =?us-ascii?Q?w0bnCjJBU1pEWImOfRK095qkQ2RsFubXlveHSyCiJSGnMKLvTcPBUUkZRtaE?= =?us-ascii?Q?4tDEDVA6KEdUZMCFP47QDrfX58cTunIdwXAfumUUip18SdVfYHsUMe5gCYn0?= =?us-ascii?Q?dWBzV5vNvDGwYN1a/Wq27PaTCJPvtsecBpaSG3nS+KBdXMgaGi3PhNETXLV/?= =?us-ascii?Q?/Fqia2S+0N43ynuHY4orwq8RLw48yfytfbO39O5ZcHkDojeORRBB54sBOw9r?= =?us-ascii?Q?oRp4wmdjLL9uaQMOsjyUMtpDS0i1TcHun7Wqn3eEk3tNRu3kYoUafFXWHYic?= =?us-ascii?Q?S2xUo0prQvEFqE+3HQxRe+TfjmCVJxnYskgTc3gLl7WOFlRHDwf1g50ATNbU?= =?us-ascii?Q?kLnBYfhpGp59WOaEMK3qDn04w7gnROJTGDt9YynG84RAnjV9kcZp2MfYB5aR?= =?us-ascii?Q?yChuhF3BcQzChIcvOmGCq+h55ROQ/BkeqNgUIVKFyCFNPNQs88VlJgjb8gQ0?= =?us-ascii?Q?V6s4DDM2AYdRWJJHLMtr5zzuLhXLl8i1KeR/SJ2DH5ZQHxbiIZ5wp0frJ2sz?= =?us-ascii?Q?IO55LRTB32XbXtAxWUh9CeucZP9/b5XXp3zvekDF6mljcZLEdqy/XCU9hFps?= =?us-ascii?Q?P5RLrj+3kdrLarmvq9M2kWCy6ofUum4y/mKsg1O6f8tVOM6IAQltmM2vnliF?= =?us-ascii?Q?Yr5seovhW3l6KUZYNODHk63s3M2TCPfEJzKqnYjXLNScxlDot+if0UID/Cfh?= =?us-ascii?Q?83b4RThu4rrVbPjx/NmSklDXSDqTbvbUK8mjEfZQBDIBgU8rmGlbNE3+UzzG?= =?us-ascii?Q?qIaI+bRVSyvrkan/GZKpvLKVzswF20Vv7rEeozlWxXQVL0fSz/taP5jQf308?= =?us-ascii?Q?Y67p8PsThAlVUIeY3Q0QbcsebO3MqYmUPz5TOphZoN3C?= Content-Type: multipart/related; boundary="_004_BN9PR12MB5243418C91081E90B097E8AC9A9C9BN9PR12MB5243namp_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5243.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e78a318e-b3ab-4b5e-4d63-08d9ab1d687d X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2021 05:28:24.3217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n4FmWi6NGY3pljp4CKrX7YnCD+zaHSs+wl7KN7gC0raCRN/yiaFv95r6mby8DFqTBOyoK3I5zXYaQxwS4mN0TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5367 X-Spam-Status: No, score=3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, IMAGE_ATTACHED, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 05:28:33 -0000 --_004_BN9PR12MB5243418C91081E90B097E8AC9A9C9BN9PR12MB5243namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only] A gentle reminder to please review this patch. Regards, Nitika Sent from Mail for Window= s From: Achra, Nitika Sent: Monday, October 4, 2021 4:20 AM To: Jakub Jelinek; dwz@sourceware.org Cc: George, Jini Susan Subject: Re: [PING][PATCH] DWARFv5: Support for unit type DW_UT_type and DW= _TAG_type_unit. Requesting to please review this. Regards, Nitika Get Outlook for Android From: Achra, Nitika Sent: Thursday, August 26, 2021 9:47:14 AM To: Jakub Jelinek ; dwz@sourceware.org Cc: George, Jini Susan Subject: RE: [PING][PATCH] DWARFv5: Support for unit type DW_UT_type and DW= _TAG_type_unit. [AMD Official Use Only] A gentle reminder. Regards Nitika -----Original Message----- From: Achra, Nitika Sent: Thursday, August 12, 2021 9:50 AM To: 'Jakub Jelinek' ; dwz@sourceware.org Cc: George, Jini Susan Subject: RE: [PING][PATCH] DWARFv5: Support for unit type DW_UT_type and DW= _TAG_type_unit. [AMD Official Use Only] Just a gentle reminder for review. Regards, Nitika -----Original Message----- From: Achra, Nitika Sent: Wednesday, July 28, 2021 8:02 PM To: Jakub Jelinek Cc: dwz@sourceware.org; George, Jini Susan Subject: RE: [PATCH] DWARFv5: Support for unit type DW_UT_type and DW_TAG_t= ype_unit. [AMD Official Use Only] Hi Jakub, Thanks for the review. Please find the attached patch with some of the chan= ges you suggested. Please take a look at it. Regards, Nitika -----Original Message----- From: Jakub Jelinek Sent: Friday, June 11, 2021 4:25 PM To: Achra, Nitika Cc: dwz@sourceware.org; George, Jini Susan Subject: Re: [PATCH] DWARFv5: Support for unit type DW_UT_type and DW_TAG_t= ype_unit. [CAUTION: External Email] On Fri, Jun 11, 2021 at 09:37:18AM +0000, Achra, Nitika via Dwz wrote: > The attached patch handles the DW_UT_type and DW_TAG_type_unit for DWARFv= 5. Requesting everyone to please review this. Ideally, dwz should rewrite all those DW_TAG_type_units into DW_TAG_partial= _unit, after a library or binary is linked, nothing from outside can refer = to its type units. The DW_FORM_ref_sig8 references are too large, DW_FORM_= ref_addr is (for 32-bit DWARF) half the size and cheaper for the consumer w= hich doesn't have to look up the type id in some hash table. Furthermore o= ne can save some bytes from the unit header too. --- a/dwz.c +++ b/dwz.c @@ -903,6 +903,13 @@ struct dw_cu unsigned int cu_offset; /* DWARF version of the CU. */ unsigned int cu_version; + /* True if the CU unit_type is DW_UT_type inside the debug_info. */ + bool isUTType; Why can't this be in cu_kind instead, just another kind? And, dwz doesn't use this kind of variable/field names. + /* A unique 8-byte signature of the type described in this type unit. + */ uint64_t cu_type_signature; + /* A 4-byte unsigned offset relative to the beginning of the type unit + header. */ + unsigned int cu_type_offset; This will create unnecessary padding in the struct on 64-bit arches. They should be moved somewhere where that doesn't happen. /* Cached DW_AT_comp_dir value from DW_TAG_*_unit cu_die, or NULL if that attribute is not present. */ char *cu_comp_dir; @@ -3245,6 +3252,7 @@ checksum_die (DSO *dso, dw_cu_ref cu, dw_die_ref top_= die, dw_die_ref die) die->u.p1.die_hash =3D 0; if (die->die_tag =3D=3D DW_TAG_compile_unit || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit || die->die_tag =3D=3D DW_TAG_namespace || die->die_tag =3D=3D DW_TAG_module || die->die_tag =3D=3D DW_TAG_imported_unit) @@ -4065,6 +4073,7 @@ c= hecksum_ref_die (dw_cu_ref cu, dw_die_ref top_die, dw_die_ref die, while (!reft->die_root && reft->die_parent->die_tag !=3D DW_TAG_compile_unit && reft->die_parent->die_tag !=3D DW_TAG_partial_unit + && reft->die_parent->die_tag !=3D DW_TAG_type_unit && !reft->die_parent->die_named_namespace) reft =3D reft->die_parent; if (reft->die_ck_state !=3D CK_KNOWN || reft->die_root) @@ -4= 580,9 +4589,11 @@ die_eq_1 (dw_cu_ref cu1, dw_cu_ref cu2, { const char *name1, *name2; if ((ref1->die_tag =3D=3D DW_TAG_compile_unit - || ref1->die_tag =3D=3D DW_TAG_partial_unit) + || ref1->die_tag =3D=3D DW_TAG_partial_unit + || ref1->die_tag =3D=3D DW_TAG_type_unit) && (ref2->die_tag =3D=3D DW_TAG_compile_unit - || ref2->die_tag =3D=3D DW_TAG_partial_unit)) + || ref2->die_tag =3D=3D DW_TAG_partial_unit + || ref2->die_tag =3D=3D DW_TAG_type_unit)) break; if (ref1->die_tag !=3D ref2->die_tag) return 0; @@ -6023,6 +6034,7 @@ mark_refs (dw_cu_ref cu, dw_die_ref top_die, dw_die_r= ef die, int mode) while (!reft->die_root && reft->die_parent->die_tag !=3D DW_TAG_compile_unit && reft->die_parent->die_tag !=3D DW_TAG_partial_unit + && reft->die_parent->die_tag !=3D DW_TAG_type_unit && !reft->die_parent->die_named_namespace) reft =3D reft->die_parent; if ((mode & MARK_REFS_FOLLOW_DUPS) && reft->die_dup !=3D NULL= ) @@ -6342,7 +6354,7 @@ try_debug_info (DSO *dso) if (cu_version =3D=3D 5) { value =3D read_8 (ptr); - if (value !=3D DW_UT_compile && value !=3D DW_UT_partial) + if (value !=3D DW_UT_compile && value !=3D DW_UT_partial && value + !=3D DW_UT_type) error (0, 0, "%s: DWARF CU type %s unhandled", dso->filename, get_DW_UT_str (value)); } @@ -6571,6 +6583,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) bool present; unsigned int debug_line_off; unsigned int type_offset =3D 0; + uint64_t type_signature =3D 0; + bool isUTType =3D false; /* Note header is one bigger with DWARF version 5. */ if (ptr + (kind =3D=3D DEBUG_TYPES ? 23 : 11) > endsec) @@ -6613,12 = +6627,13 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count) if (cu_version =3D=3D 5) { value =3D read_8 (ptr); - if (value !=3D DW_UT_compile && value !=3D DW_UT_partial) + if (value !=3D DW_UT_compile && value !=3D DW_UT_partial && value + !=3D DW_UT_type) { error (0, 0, "%s: DWARF CU type %s unhandled", dso->filename, get_DW_UT_str (value)); goto fail; } + isUTType =3D (value =3D=3D DW_UT_type); } else { @@ -6760,9 +6775,9 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) } last_abbrev_offset =3D value; - if (unlikely (kind =3D=3D DEBUG_TYPES)) + if (unlikely (kind =3D=3D DEBUG_TYPES) || isUTType) { - ptr +=3D 8; + type_signature =3D read_64 (ptr); type_offset =3D read_32 (ptr); } @@ -6775,6 +6790,10 @@ read_debug_info (DSO *dso, int kind, unsigned int *d= ie_count) cu->cu_offset =3D cu_offset; cu->cu_version =3D cu_version; cu->cu_chunk =3D cu_chunk; + cu->cu_type_offset =3D type_offset; + cu->cu_type_signature =3D type_signature; + cu->isUTType =3D isUTType; + if (unlikely (op_multifile || low_mem)) cu->cu_abbrev =3D abbrev; diep =3D &cu->cu_die; @@ -6955,14 +6974,16 @@ read_debug_info (DSO *dso, int kind, unsigned int *= die_count) case DW_FORM_implicit_const: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) cu->lang =3D t->values[i]; break; case DW_FORM_data1: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) cu->lang =3D *ptr; /* FALLTHRU */ @@ -6973,7 +6994,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) case DW_FORM_data2: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) cu->lang =3D do_read_16 (ptr); /* FALLTHRU */ @@ -6983,7 +7005,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) case DW_FORM_data4: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) read_lang (ptr, form, &cu->lang); /* FALLTHRU */ @@ -6994,7 +7017,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) case DW_FORM_data8: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) read_lang (ptr, form, &cu->lang); /* FALLTHRU */ @@ -7009,7 +7033,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *di= e_count) case DW_FORM_udata: if (lang_p && (die->die_tag =3D=3D DW_TAG_compile_unit - || die->die_tag =3D=3D DW_TAG_partial_unit) + || die->die_tag =3D=3D DW_TAG_partial_unit + || die->die_tag =3D=3D DW_TAG_type_unit) && t->attr[i].attr =3D=3D DW_AT_language) { ptr =3D read_lang (ptr, form, &cu->lang); @@ -7559,6 = +7584,7 @@ mark_singletons (dw_cu_ref cu, dw_die_ref top_die, dw_die_ref di= e, while (!reft->die_root && reft->die_parent->die_tag !=3D DW_TAG_compile_unit && reft->die_parent->die_tag !=3D DW_TAG_partial_unit + && reft->die_parent->die_tag !=3D DW_TAG_type_unit && !reft->die_parent->die_named_namespace) reft =3D reft->die_parent; if (reft->die_dup !=3D NULL || reft->die_nextdup !=3D NULL) @@ -1= 1001,6 +11027,7 @@ build_abbrevs_for_die (htab_t h, dw_cu_ref cu, dw_die_re= f die, { case DW_TAG_partial_unit: case DW_TAG_compile_unit: + case DW_TAG_type_unit: t->nattr =3D 0; die->die_size =3D 0; if (origin =3D=3D NULL) @@ -11014,7 +11041,7 @@ build_abbrevs_for_die (htab_t h, dw_cu_ref cu, dw_d= ie_ref die, die->die_size +=3D 4; t->nattr++; } - if (uni_lang_p || cu->cu_die->die_tag =3D=3D DW_TAG_compile_unit) + if (uni_lang_p || cu->cu_die->die_tag =3D=3D DW_TAG_compile_unit || + cu->cu_die->die_tag =3D=3D DW_TAG_type_unit) { unsigned int lang_size =3D nr_bytes_for (cu->lang); die->die_size +=3D lang_size; @@ -11421,7 +11448,7 @@ compute_abbrevs (DSO *dso) enum dwarf_form intracuform =3D DW_FORM_ref4; dw_die_ref child, *lastotr, child_next, *last; unsigned int headersz =3D (cu->cu_kind =3D=3D CU_TYPES - ? 23 : (cu->cu_version >=3D 5 ? 12 : 11)); + ? 23 : (cu->cu_version >=3D 5 ? + (cu->isUTType ? 24 : 12) : 11)); if (unlikely (fi_multifile) && cu->cu_die->die_remove) continue; @@ -12639,6 +12666,7 @@ write_die (unsigned char *ptr, dw_cu_ref cu, dw_die= _ref die, { case DW_TAG_partial_unit: case DW_TAG_compile_unit: + case DW_TAG_type_unit: ptr =3D write_unit_die (ptr, die, origin); break; case DW_TAG_namespace: @@ -12737,7 +12765,7 @@ static void recompute_abbrevs (dw_cu_ref cu, unsigned int cu_size) { unsigned int headersz =3D (cu->cu_kind =3D=3D CU_TYPES - ? 23 : (cu->cu_version >=3D 5 ? 12 : 11)); + ? 23 : (cu->cu_version >=3D 5 ? (cu->isUTType ? + 24 : 12) : 11)); struct abbrev_tag *t; unsigned int ndies =3D 0, intracusize, off, i; dw_die_ref *intracuarr, *intracuvec; @@ -12846,13 +12874,23 @@ write_info (unsigned int *die_count) write_16 (ptr, cu->cu_version); if (cu->cu_version >=3D 5) { - *ptr++ =3D (cu->cu_die->die_tag =3D=3D DW_TAG_compile_unit - ? DW_UT_compile : DW_UT_partial); + if (cu->cu_die->die_tag =3D=3D DW_TAG_compile_unit) + *ptr++ =3D DW_UT_compile; + else if (cu->cu_die->die_tag =3D=3D DW_TAG_type_unit) + *ptr++ =3D DW_UT_type; + else + *ptr++ =3D DW_UT_partial; write_8 (ptr, ptr_size); } write_32 (ptr, cu->u2.cu_new_abbrev_offset); if (cu->cu_version < 5) write_8 (ptr, ptr_size); + if (cu->cu_die->die_tag =3D=3D DW_TAG_type_unit) + { + write_64 (ptr, cu->cu_type_signature); + write_32 (ptr, cu->cu_type_offset); + } + ptr =3D write_die (ptr, cu, cu->cu_die, NULL, NULL, die_count); assert (info + (next_off - (wr_multifile ? multi_info_off : 0)) =3D= =3D ptr); if (unlikely (low_mem) && cu->cu_kind !=3D CU_PU) @@ -14470,6 +14508= ,7 @@ propagate_multifile_refs_backward (dw_cu_ref cu, dw_die_ref top_die, while (!reft->die_root && reft->die_parent->die_tag !=3D DW_TAG_compile_unit && reft->die_parent->die_tag !=3D DW_TAG_partial_unit + && reft->die_parent->die_tag !=3D DW_TAG_type_unit && !reft->die_parent->die_named_namespace) reft =3D reft->die_parent; if (reft->die_root) -- 2.17.1 Jakub --_004_BN9PR12MB5243418C91081E90B097E8AC9A9C9BN9PR12MB5243namp_ Content-Type: image/png; name="9621A344DF2947759E2F261BB231CE8A.png" Content-Description: 9621A344DF2947759E2F261BB231CE8A.png Content-Disposition: inline; filename="9621A344DF2947759E2F261BB231CE8A.png"; size=159; creation-date="Fri, 19 Nov 2021 05:28:23 GMT"; modification-date="Fri, 19 Nov 2021 05:28:23 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAArYAAAADCAYAAABmm0wDAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA0SURBVGhD7dZBCQAwDATB+DdVBVUQMSn0GQcH szAets7tAQCAdH9sS5IkSUpvny4AAOTpeVQ/cX0X8qc8AAAAAElFTkSuQmCC --_004_BN9PR12MB5243418C91081E90B097E8AC9A9C9BN9PR12MB5243namp_--