From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 576EC3858C55 for ; Thu, 23 Jun 2022 17:21:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 576EC3858C55 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-_gR4pY-BO9qGzndh-unNcw-1; Thu, 23 Jun 2022 13:21:00 -0400 X-MC-Unique: _gR4pY-BO9qGzndh-unNcw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8867D1C16B44; Thu, 23 Jun 2022 17:21:00 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 444BB40CF8EE; Thu, 23 Jun 2022 17:21:00 +0000 (UTC) Date: Thu, 23 Jun 2022 10:20:58 -0700 From: Kevin Buettner To: Markus Metzger via Gdb-patches Subject: Re: [PATCH v5 06/15] gdb, compile: unlink objfile stored in module Message-ID: <20220623102058.45d572ef@f35-zws-1> In-Reply-To: <20220602132514.957983-7-markus.t.metzger@intel.com> References: <20220602132514.957983-1-markus.t.metzger@intel.com> <20220602132514.957983-7-markus.t.metzger@intel.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2022 17:21:07 -0000 On Thu, 2 Jun 2022 15:25:05 +0200 Markus Metzger via Gdb-patches wrote: > When cleaning up after a compile command, we iterate over all objfiles and > unlink the first objfile with the same name as the one we compiled. > > Since we already store a pointer to that objfile in the module and use it > to get the name we're comparing against, there's no reason to iterate, at > all. We can simply use that objfile. > > This further avoids potential issues when an objfile with the same name is > loaded into a different linker namespace. > --- > gdb/compile/compile-object-run.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) LGTM. Kevin