Performance bug while ordering .text sections by default in gold.
Ian Lance Taylor
iant@google.com
Wed Jan 23 16:29:00 GMT 2013
On Tue, Jan 22, 2013 at 11:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>
> This patch to gold :
> http://sourceware.org/ml/binutils/2012-12/msg00227.html introduces
> unnecessary behaviour while ordering text sections and this is causing
> performance regressions in some benchmarks. The intent of this patch
> was to group .text sections with special prefixes like ".text.hot",
> ".text.unlikely" , ".text.startup" together, which it achieves.
> However, it does other undesired things too like sorting section names
> of those sections without these special prefixes. This is because it
> uses the compare function "Input_section_sort_compare" which was used
> to sort ".ctors" and ".dtors". Sorting by section names can cause
> undesired ordering like splitting functions in the same module.
>
> I am fixing this by making ".text" default sorting use the sort
> function Input_section_sort_section_order_index_compare. I think this
> is better as the different comparison criteria are much less and is
> all applicable to ".text" under different contexts.
Why reuse Input_section_sort_section_order_index_compare?
It seems to me that you've identified a need for a new kind of
ordering. Use a new function for that.
Ian
More information about the Binutils
mailing list