From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/24249] Section offsets not monotonically increasing
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <bug-24249-11298-cDf4z2X8Wv@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24249-11298@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24249
--- Comment #10 from Tom de Vries <vries at gcc dot gnu.org> ---
(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 this
Sorry, not sure what you mean here.
> or only care (and reshuffle) the non-allocated sections that way and ignore
> 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, and
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?
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2019-02-22 12:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-01 0:00 [Bug default/24249] New: " vries at gcc dot gnu.org
2019-01-01 0:00 ` [Bug default/24249] " vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` vries at gcc dot gnu.org [this message]
2019-01-01 0:00 ` jakub at redhat dot com
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` jakub at redhat dot com
2019-01-01 0:00 ` vries at gcc dot gnu.org
2019-01-01 0:00 ` jakub at redhat dot com
2019-01-01 0:00 ` mark at klomp dot org
2019-01-01 0:00 ` vries at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-24249-11298-cDf4z2X8Wv@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=dwz@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).