This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Map ".text.hot" and ".text.unlikely" input section prefixes to separate output sections.
On Thu, Dec 20, 2012 at 2:38 PM, Cary Coutant <ccoutant@google.com> wrote:
> This patch fixes the problems I've been seeing. It sets the "may sort
> attached input sections" flag for the .text section, which ensures
> that we track all input sections for that output section. The problem
> was that we can't start tracking input sections in mid-stream. We may
> not want to do this unconditionally for .text, so maybe you'll want a
> linker option to enable this reordering?
>
> Ian, HJ, does this patch fix the errors you're seeing as well?
Yes, it fixes the problem for me.
> -cary
>
>
> diff --git a/gold/layout.cc b/gold/layout.cc
> index 62b4cad..a9583c4 100644
> --- a/gold/layout.cc
> +++ b/gold/layout.cc
> @@ -1602,6 +1602,7 @@ Layout::make_output_section(const char* name,
> elfcpp::Elf_Word type,
> && !parameters->options().relocatable()
> && (strcmp(name, ".init_array") == 0
> || strcmp(name, ".fini_array") == 0
> + || strcmp(name, ".text") == 0
> || (!parameters->options().ctors_in_init_array()
> && (strcmp(name, ".ctors") == 0
> || strcmp(name, ".dtors") == 0))))
>
--
H.J.