From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6937 invoked by alias); 13 Feb 2015 20:06:35 -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 6901 invoked by uid 48); 13 Feb 2015 20:06:32 -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 20:06: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/msg01542.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015 --- Comment #17 from H.J. Lu --- This patch works wit the existing linker: diff --git a/gcc/varasm.c b/gcc/varasm.c index 0211306..f3241a8 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -7043,7 +7043,12 @@ default_file_start (void) fputs (ASM_APP_OFF, asm_out_file); if (targetm.asm_file_start_file_directive) - output_file_directive (asm_out_file, main_input_filename); + { + if (in_lto_p) + output_file_directive (asm_out_file, ""); + else + output_file_directive (asm_out_file, main_input_filename); + } } /* This is a generic routine suitable for use as TARGET_ASM_FILE_END