From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B31E38618BB; Wed, 30 Sep 2020 07:35:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B31E38618BB From: "jakub at redhat dot com" To: dwz@sourceware.org Subject: [Bug default/26679] New: Perform dead DIE removal in dwz Date: Wed, 30 Sep 2020 07:35:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at redhat dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 07:35:45 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26679 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 sho= uld 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 t= hose 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=