public inbox for
 help / color / mirror / Atom feed
From: "jakub at redhat dot com" <>
Subject: [Bug default/26679] New: Perform dead DIE removal in dwz
Date: Wed, 30 Sep 2020 07:35:44 +0000	[thread overview]
Message-ID: <> (raw)

            Bug ID: 26679
           Summary: Perform dead DIE removal in dwz
           Product: dwz
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: jakub at redhat dot com
                CC: dwz at sourceware dot org
  Target Milestone: ---

E.g. on:
struct S { virtual ~S () {} int s; };
S s;
int main () {}
struct S { virtual ~S () {} int s; };
S t;
without -flto both the S::~S() dtors will be emitted with DW_AT_low_pc etc. and
all the details, but as the definition is comdat, only one of them will be
chosen by the linker and therefore the other one will end up with DW_AT_low_pc
of 0.
It would be nice if dwz could perform some form of dead DIE removal, it should
be very easy to discover them (subroutine or variable DIEs with zero
addresses), but the question is what to do with those exactly.  Just drop those
DIEs and their children, or e.g. first check if there is a real definition DIE
for that entity elsewhere and drop only then?  Or just prune some sub-DIEs and
some attributes?
Dropping DIEs or parts of DIEs shouldn't be that hard, but I guess dropping
stuff from .debug_loc/.debug_loclists if they are never referenced because of
such removal would be harder, there is no code for that right now.
On the bright side, this is something that would need to be done only at the
single executable/DSO mode, at multifile processing which is more memory
intensive this would be already done.
And, haven't checked, but probably it isn't relevant to -flto, because then the
compiler emits or should emit only one definition.

You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2020-09-30  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30  7:35 jakub at redhat dot com [this message]
2021-03-02  7:52 ` [Bug default/26679] " vries at gcc dot

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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).