public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/26679] New: Perform dead DIE removal in dwz
@ 2020-09-30  7:35 jakub at redhat dot com
  2021-03-02  7:52 ` [Bug default/26679] " vries at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: jakub at redhat dot com @ 2020-09-30  7:35 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26679

            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:
test1.C:
struct S { virtual ~S () {} int s; };
S s;
int main () {}
test2.C:
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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug default/26679] Perform dead DIE removal in dwz
  2020-09-30  7:35 [Bug default/26679] New: Perform dead DIE removal in dwz jakub at redhat dot com
@ 2021-03-02  7:52 ` vries at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2021-03-02  7:52 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=26679

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
                 CC|                            |vries at gcc dot gnu.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30  7:35 [Bug default/26679] New: Perform dead DIE removal in dwz jakub at redhat dot com
2021-03-02  7:52 ` [Bug default/26679] " vries at gcc dot gnu.org

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