This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Restore Tru64 UNIX bootstrap (PR middle-end/46671)


> > > 	* varasm.c (default_function_section): Return NULL unless
> > > 	targetm.have_named_sections.
> > > --- a/gcc/varasm.c	Fri Dec 10 17:50:52 2010 +0100
> > > +++ b/gcc/varasm.c	Fri Dec 10 17:52:57 2010 +0100
> > > @@ -533,6 +533,9 @@
> > >  default_function_section (tree decl, enum node_frequency freq,
> > >  			  bool startup, bool exit)
> > >  {
> > > +  if (!targetm.have_named_sections)
> > > +    return NULL;
> > 
> > Yes, this seems sane default for me.
> 
> I think this doesn't go far enough in restoring previous behaviour.
> There may be targets with named sections that aren't ELF.
> 
> The current implementation of default_function_section is really
> ELF/GNU ld specific.  I think it would be better if it were changed
> to elf_default_function_section selected in elfos.h.  The default for

OK, I see that currently only GNU linker does the ordering, but the previous
code was enabled by default on non-elf targets too?
choose_function was called with flag_reorder_function and set DECL_NAMED_SECTION
that in my understanding affects all targets, elf or non-elf.

I lost the flag_reorder_functions check in my patch, will add it back into
default_function_section and dwarf2_function_section code.

Honza

> TARGET_ASM_FUNCTION_SECTION could be NULL so the hook isn't called
> at all for the default case.  The code would then fall through to
> hot_function_section.  This probably could be further simplified.
> 
> I am probably stuck in defining TARGET_ASM_FUNCTION_SECTION on PA
> because of a problem in handling nested functions when they are in
> different sections...
> 
> Dave
> -- 
> J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
> National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]