From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 5DCE03858D1E for ; Sun, 19 May 2024 13:23:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DCE03858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5DCE03858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716125008; cv=none; b=G5ooQi4NP4Vs4uIQWbGwFEtK1PyP6tE42ESjzF4UHEJbzcGZVHm23yKVg8656jeSn7Oh7WpeCRNiJpSmL6eZrQ7/SJv3RRZ3CLT+j6E7mOFpVBTJolAmOZ4e1How8bpRFHI9gxC1+/i+yUQiOpvkVMChbna6hQU/6l/Lmhla+PI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716125008; c=relaxed/simple; bh=/8j++D0bOi2ZMG2w7xjidtICOuB2mniqWWgP79cT9QA=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=qU9oTjveZj3snqigAEpfyfCYJVNXdfaMzIjShX2Ms7Q+CM5zeO+ubpxqRPYbgwgz2lf2vyPPPSOgxdcJVRsHjy4VllJZvHrHPIcCVyeL/EL1Au+O5tLVlhive5w6kQpjfV+rmaTBDZ12TTn4EZm42pbK3sfAY+sprt7/LyIhTjU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 5886830003AE; Sun, 19 May 2024 15:23:26 +0200 (CEST) Date: Sun, 19 May 2024 15:23:26 +0200 From: Mark Wielaard To: debugedit@sourceware.org Subject: Re: [PATCH] Make relocation reading explicit Message-ID: <20240519132326.GE25437@gnu.wildebeest.org> References: <20240515204012.1120994-1-mark@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240515204012.1120994-1-mark@klomp.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, On Wed, May 15, 2024 at 10:40:12PM +0200, Mark Wielaard wrote: > Relocation handling used to be linear per section. But since handling > .debug_str_offsets (which can have relocations itself) we had to > "reset" the relocation handling when switching between reading > sections. This caused a lnear search from the start of the relocation > table each time section reading was switched. Since this was slow > do_read_32_relocated needed to be optimized using a binary search > (commit fbad879eb). > > Since we do a binary search now, resetting the relocation > datastructure isn't really needed. It is also a little confusing and > fragile. Rewrite the relocation code so it works per section and > doesn't need "switching". > > Make the relocation related data structures part of struct > debug_section. And change do_read_32_relocated to take a struct > debug_section. This way we make explicit from which section we are > reading. I pushed this to main. Cheers, Mark