This is the mail archive of the
mailing list for the binutils project.
Re: Map ".text.hot" and ".text.unlikely" input section prefixes to separate output sections.
On Fri, Dec 21, 2012 at 7:38 AM, H.J. Lu <firstname.lastname@example.org> wrote:
> On Thu, Dec 20, 2012 at 10:26 PM, Ian Lance Taylor <email@example.com> wrote:
>> On Thu, Dec 20, 2012 at 2:38 PM, Cary Coutant <firstname.lastname@example.org> 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?
>> Thanks for tracking this down.
>> It would be nice to avoid doing it for .text, but I don't see how to
>> do that while remaining compatible with GNU ld.
>> I reimplemented this code in a different way that I think fits in
>> better with the existing section ordering code. Committed to
>> 2012-12-20 Ian Lance Taylor <email@example.com>
>> * layout.cc (Layout::special_ordering_of_input_section): New
>> (Layout::layout): If input section requires special ordering, must
>> sort input sections.
>> (Layout::make_output_section): May sort .text input sections.
>> (Layout::is_section_name_prefix_grouped): Remove.
>> * layout.h (class Layout): Declare
>> special_ordering_of_input_section. Don't declare
>> * output.cc (Output_section::add_input_section): Revert last
>> (Output_section::Input_section_sort::match_file_name): Don't crash
>> if called on output section data.
>> (Output_section::Input_section_sort_compare): Sort based on
>> special ordering.
>> Revert last patch.
>> (Output_section::sort_attached_input_sections): Likewise.
> It doesn't fix regressions with x32 gold:
> `echo g++ -mx32 -W -Wall -Werror -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -fmerge-constants -static-libstdc++
> -static-libgcc -o incremental_test_2 | sed -e
> 's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'` -Wl,--incremental-update
> -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o
> two_file_test_2_ndebug.o two_file_test_main_ndebug.o
> gcctestdir/ld: internal error in convert_types, at
> collect2: error: ld returned 1 exit status
> make: *** [incremental_test_2] Error 1
I don't really see how that could be related to this patch series. I
don't have an x32 system so I also can't debug this. Can you show a
backtrace at the point of failure? You can set a breakpoint on