From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110281 invoked by alias); 22 Feb 2019 12:42:41 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 110077 invoked by uid 48); 22 Feb 2019 12:42:36 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/24249] Section offsets not monotonically increasing Date: Tue, 01 Jan 2019 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q1/txt/msg00043.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24249 --- Comment #10 from Tom de Vries --- (In reply to Jakub Jelinek from comment #9) > I still have concerns, FWIW, dwz-0.12-ignore-nobits.patch handles this PR without reordering of the section table, so from that point of view it's the easier solution. > e.g. if we process *.debug files stripped into file > by objcopy or eu-strip, won't this shdr reordering then break the matching > between original binary and *.debug file? Indeed the ordering of entries in the section table in the original binary = and the .debug file will not be the same. I'm not aware though of a tool that relies on this ordering to be the same. > On the other side, this code has been written primarily for prelink, when > dwz only modifies debug sections perhaps it could away with relying on th= is Sorry, not sure what you mean here. > or only care (and reshuffle) the non-allocated sections that way and igno= re > others. Agreed, that would work for this example. I start to wonder now whether a mix of the two posted approaches (dwz-0.12-ignore-nobits.patch and the tentative patch) would be the best solution: 1. resort the section header based on offset (ignoring nobits offsets, see PR24251) 2. recalculate the offsets base on the new sizes (in write_dso) 3. unsort the sections back into the original order. This approach would have the same result as dwz-0.12-ignore-nobits.patch, a= nd avoid the problem of having to rewrite symbol tables, but would be less intrusive to write_dso than dwz-0.12-ignore-nobits.patch. WDYT? --=20 You are receiving this mail because: You are on the CC list for the bug.