This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Group static constructors and destructors in specific subsections
- From: Cary Coutant <ccoutant at google dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de, iant at google dot com, iains at gcc dot gnu dot org, tglek at mozilla dot com
- Date: Thu, 21 Oct 2010 10:34:54 -0700
- Subject: Re: Group static constructors and destructors in specific subsections
- References: <20101014203817.GB15487@kam.mff.cuni.cz>
> I am not sure how to update gold - I basically copied existing code in binutils
> for .text.unlikely group in GNU LD linker script, but I think gold is doing
> independent decisions somewhere.
Gold doesn't have a default linker script. The code that handles the
default section name mappings is Layout::output_section_name() in
gold/layout.cc. If you add a couple of entries to the mapping array
Layout::section_name_mapping[], you can easily change gold to group
.text.startup and .text.exit sections together without mapping them
all into .text. You can tweak the ordering of the output sections, if
you want to, in Layout::default_section_order().
-cary