From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id E5C133854802 for ; Mon, 22 Feb 2021 07:51:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E5C133854802 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0CA08AE36; Mon, 22 Feb 2021 07:51:27 +0000 (UTC) Subject: Re: [PATCH] Fix CK_BAD propagation for --odr From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org References: <20210216091146.GA32276@delia> <54d0e486-a712-13be-1f72-d5df15d1152b@suse.de> Message-ID: <39407bf8-6624-f610-cd19-b8ad78e29136@suse.de> Date: Mon, 22 Feb 2021 08:51:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <54d0e486-a712-13be-1f72-d5df15d1152b@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: Mon, 22 Feb 2021 07:51:29 -0000 On 2/18/21 3:20 PM, Tom de Vries wrote: > The problem is caused by the odr code in checksum_ref_die, which skips > checksum calculation for the children of odr types, with as unintended > side-effect that it break the CK_BAD propagation to toplevel DIEs. > > Fix this by making the skipping of the checksum calculation less intrusive. > Specially: > - undo all modifications related to odr in checksum_ref_die > - After calling checksum_ref_die in read_debug_info: > - override die_ref_hash for odr DIEs, and > - recalculate die_ref_hash for all other DIEs. > @@ -6742,6 +6741,24 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count) > > for (cu = cuf; cu; cu = cu->cu_next) > checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); > + if (odr) > + { > + for (cu = cuf; cu; cu = cu->cu_next) > + { > + dw_die_ref die; > + FOREACH_LOW_TOPLEVEL_DIE_IN_CU (die, cu) > + { > + if (die->die_ck_state != CK_KNOWN) > + continue; > + if (die_odr_state (die_cu (die), die) != ODR_NONE) > + die->u.p1.die_ref_hash = die->u.p1.die_hash; > + else > + die->die_ref_hash_computed = 0; > + } > + } > + for (cu = cuf; cu; cu = cu->cu_next) > + checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); > + } > > if (dump_dies_p) > for (cu = cuf; cu; cu = cu->cu_next) > @@ -7292,6 +7323,24 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count) > > for (cu = first_cu; cu; cu = cu->cu_next) > checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); > + if (odr) > + { > + for (cu = first_cu; cu; cu = cu->cu_next) > + { > + dw_die_ref die; > + FOREACH_LOW_TOPLEVEL_DIE_IN_CU (die, cu) > + { > + if (die->die_ck_state != CK_KNOWN) > + continue; > + if (die_odr_state (die_cu (die), die) != ODR_NONE) > + die->u.p1.die_ref_hash = die->u.p1.die_hash; > + else > + die->die_ref_hash_computed = 0; > + } > + } > + for (cu = first_cu; cu; cu = cu->cu_next) > + checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); > + } > > if (dump_dies_p) > for (cu = first_cu; cu; cu = cu->cu_next) > I've realized that these two bits (for op_multifile, and rd_multifile || fi_multifile) are not useful, because odr is not a multi-file optimization, so the die_odr_state (die_cu (die), die) != ODR_NONE would always return false. Committed with these bits dropped. Thanks, - Tom