[PATCH][3/n] Fix PR65015

Richard Biener rguenther@suse.de
Mon Feb 16 18:07:00 GMT 2015


On Mon, 16 Feb 2015, H.J. Lu wrote:

> On Mon, Feb 16, 2015 at 6:25 AM, Richard Biener <rguenther@suse.de> wrote:
> >
> > This fixes another leakage of random LTO temporary filenames into
> > executables, this time via .symtab FILE entries.  Removing it
> > doesn't work (GNU ld adds it back) and is said to be incorrect.
> 
> FWIW, ld.bfd will be fixed in 2.26.  But it is still a good idea to
> support older links.

Yeah, especiall as I plan to backport this series if the reporter is
happy.

Richard.

> > So the following patch, similar to the dwarf CU DW_AT_name uses
> > <artificial>.
> >
> > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> >
> > Richard.
> >
> > 2015-02-16  Richard Biener  <rguenther@suse.de>
> >
> >         PR lto/65015
> >         * varasm.c (default_file_start): For LTO produced units
> >         emit <artificial> as file directive.
> >
> > Index: gcc/varasm.c
> > ===================================================================
> > --- gcc/varasm.c        (revision 220677)
> > +++ gcc/varasm.c        (working copy)
> > @@ -7043,7 +7047,13 @@ 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);
> > +    {
> > +      /* LTO produced units have no meaningful main_input_filename.  */
> > +      if (in_lto_p)
> > +       output_file_directive (asm_out_file, "<artificial>");
> > +      else
> > +       output_file_directive (asm_out_file, main_input_filename);
> > +    }
> >  }
> >
> >  /* This is a generic routine suitable for use as TARGET_ASM_FILE_END
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Jennifer Guild,
Dilip Upmanyu, Graham Norton HRB 21284 (AG Nuernberg)



More information about the Gcc-patches mailing list