From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E548C3852744; Mon, 13 Jun 2022 13:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E548C3852744 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/105877] GNU strip breaks -flto -g .o files Date: Mon, 13 Jun 2022 13:07:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 13:07:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105877 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #3 from Richard Biener --- (In reply to hubicka from comment #2) > > "strip -g" removed .gnu.debuglto_.debug_info sections. Should LTO remov= e the > > references of stripped debug info? Or should "strip -g" keep LTO debug= info? >=20 > I suppose we should try to immitate what happens without -flto, so > probably check for the presence of debuglto sections and avoid producing > debug info when they have been stripped? > I am not sure how hard would be to implement this especially in > situations where part of object files were stripped and others not? I think it might be possible to detect whether the compiled objects are stripped and then avoid streaming references to its debug sections by magically turning it to -g0. But not sure how awkward this will be. Not sure why strip now strips .gnu.debuglto_.debug_info, it didn't do that before.=