Map ".text.hot" and ".text.unlikely" input section prefixes to separate output sections.

Ian Lance Taylor iant@google.com
Wed Dec 19 01:39:00 GMT 2012


On Tue, Nov 20, 2012 at 7:08 PM, Sriraman Tallam <tmsriram@google.com> wrote:

>	* layout.cc (Layout::is_section_name_prefix_grouped): New function.
>	* layout.h (Layout::is_section_name_prefix_grouped): New function.
>	* output.cc (Output_section::add_input_section): Check if section
>	name contains special prefix.  Keep input sections to sort such
>	sections.
>	(Output_section::Input_section_sort_section_order_index_compare
>	 ::operator()): Group sections according to prefixes.
>	* (Output_section::sort_attached_input_sections): Add condition
>	to Input_section_entry constructor call.
>	* testsuite/Makefile.am (text_section_grouping): New test.
>	* testsuite/Makefile.in: Regenerate.
>	* testsuite/text_section_grouping.cc: New file.
>	* testsuite/text_section_grouping.sh: New file.


> +  // If it is a text section use the following order:
> +  // .text.unlikely, .text.startup, .text.hot.
> +  const char* section_prefix [] =
> +  {
> +    ".text.unlikely",
> +    ".text.startup",
> +    ".text.hot"
> +  };

Please mention in the comment that this should match
Layout::is_section_name_prefix_grouped.

This is OK with that change.

Thanks, and sorry for the long delay.

Ian



More information about the Binutils mailing list