[2.23] Fix main() relocation issue on x32 gold

Can be seen as runtime segfault on any test linked by gold 2.23 for x32
target. bfd linker is fine. gold starting from 2.23 supports x32.

Backport of patch tracked by gold/ChangeLog revision 1.957:

    2012-09-12  Ian Lance Taylor  <iant@google.com>

        PR gold/14570
        * output.cc: Rename Output_data_got template parameter from size
        to got_size for all functions.  Compile all variants of
        Output_data_got.
        (Output_data_got::Got_entry::write): Correct use of size for
        symbol value.  Use local_is_tls rather than casting to
        Sized_relobj_file.
        * object.h (class Object): Add local_is_tls and do_local_is_tls.
        (class Sized_relobj_file): Add do_local_is_tls.
        * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.

Change-Id: I2d3848b2a3ca4b8942649ee04d53ad2679c05f8c
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

Author: Pavel Chupin <pavel.v.chupin@intel.com>
Date:   Fri May 31 15:12:28 2013 +0400
[2.22], [2.23] Backport of the patch that enables "--sort-section=name"
    command line option in gold.

    2013-05-30  Alexander Ivchenko  <alexander.ivchenko@intel.com>
                Sriraman Tallam  <tmsriram@google.com>

        * options.h (sort_section): New option.
        * output.h (Input_section_sort_section_prefix_special_ordering_compare):
        Rename from Input_section_sort_section_name_special_ordering_compare.
        (Input_section_sort_section_name_compare): New struct.
        * output.cc (Output_section::Input_section_sort_section_name_compare::
        operator()): New function.
        (Output_section::sort_attached_input_sections): Use new sort function
        for .text if --sort-section=name is specified.
        * layout.cc (Layout::make_output_section):
        Add sorting by name when --sort-section=name is specified.
        * testsuite/Makefile.am (text_section_grouping): Test option
        --sort-section=name.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/section_sorting_name.cc: New file.
        * testsuite/section_sorting_name.sh: New file.

Change-Id: Icbb4bb11b95398c1f052326145aefaa2bdf41614
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>

Author: Alexander Ivchenko <alexander.ivchenko@intel.com>
Date:   Fri May 31 15:23:56 2013 +0400