From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5368 invoked by alias); 13 Feb 2015 19:32:37 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5280 invoked by uid 48); 13 Feb 2015 19:32:33 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/65015] LTO produces randomly ordered debug information Date: Fri, 13 Feb 2015 19:32:00 -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: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg01537.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015 --- Comment #16 from H.J. Lu --- (In reply to Richard Biener from comment #11) > For reference, the following patch doesn't work: > > Index: gcc/varasm.c > =================================================================== > --- gcc/varasm.c (revision 220677) > +++ gcc/varasm.c (working copy) > @@ -7042,7 +7042,9 @@ default_file_start (void) > && !(flag_verbose_asm || flag_debug_asm || flag_dump_rtl_in_asm)) > fputs (ASM_APP_OFF, asm_out_file); > > - if (targetm.asm_file_start_file_directive) > + if (targetm.asm_file_start_file_directive > + /* LTO produced units have no meaningful main_input_filename. */ > + && !in_lto_p) > output_file_directive (asm_out_file, main_input_filename); > } > > and -g is not necessary to trigger the bogus tempfile name in .symtab This patch works together with BFD linker patch: https://sourceware.org/ml/binutils/2015-02/msg00193.html