OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [ChangeLog] - Diff between revs 163 and 166

Only display areas with differences | Details | Blame | View Log

Rev 163 Rev 166
 
2012-02-29  Cary Coutant  
 
 
 
        * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
 
 
 
2012-02-29  Cary Coutant  
 
 
 
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
 
        Call Object::decompressed_section_contents.
 
        * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
 
        New dtor.
 
        (Sized_dwarf_line_info::buffer_start_): New data member.
 
        * merge.cc (Output_merge_data::do_add_input_section): Call
 
        Object::decompressed_section_contents.
 
        (Output_merge_string::do_add_input_section): Likewise.
 
        * object.cc (need_decompressed_section): New function.
 
        (build_compressed_section_map): Decompress sections needed later.
 
        (Sized_relobj_file::do_decompressed_section_contents): New function.
 
        (Sized_relobj_file::do_discard_decompressed_sections): New function.
 
        * object.h (Object::decompressed_section_contents): New function.
 
        (Object::discard_decompressed_sections): New function.
 
        (Object::do_decompressed_section_contents): New function.
 
        (Object::do_discard_decompressed_sections): New function.
 
        (Compressed_section_info): New type.
 
        (Compressed_section_map): Include decompressed section contents.
 
        (Sized_relobj_file::do_decompressed_section_contents): New function.
 
        (Sized_relobj_file::do_discard_decompressed_sections): New function.
 
 
 
2012-02-16  Cary Coutant  
 
 
 
        * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
 
        * testsuite/Makefile.in: Regenerate.
 
 
 
2012-02-14  Cary Coutant  
 
 
 
        * options.cc (General_options::finalize): Disallow -pie and -static.
 
 
 
2012-02-03  Doug Kwan  
 
 
 
        * arm.cc (Arm_relocate_functions::abs8,
 
        Arm_relocate_functions::abs16): Use
 
        Bits::has_signed_unsigned_overflow32.
 
        (Arm_relocate_functions::thm_abs8): Correct range of
 
        overflow check.
 
        * reloc.h (Bits class): Change minimum number of bits from 0 to 1
 
        in assertions.
 
 
 
2012-02-02  Doug Kwan  
 
 
 
        * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
 
        position independent outputs, not just shared objects.
 
 
 
2012-01-30  H.J. Lu  
 
 
 
        * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
 
        * configure: Regenerated.
 
 
 
2012-01-27  Ian Lance Taylor  
 
 
 
        * reloc.h (Bits): New class with static functions, copied from
 
        namespace utils in arm.cc.
 
        * arm.cc (namespace utils): Remove.  Rewrite all uses to use Bits
 
        instead.
 
 
 
2012-01-27  H.J. Lu  
 
 
 
        * incremental.cc (write_info_blocks): Correct relocation offset.
 
 
 
2012-01-27  H.J. Lu  
 
 
 
        * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
 
        (Relocate::tls_gd_to_le): Likewise.
 
 
 
2012-01-27  H.J. Lu  
 
 
 
        * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
 
 
 
2012-01-27  H.J. Lu  
 
 
 
        * configure.ac: Check if -mcmodel=medium works.
 
        * configure: Regenerated.
 
 
 
2012-01-24  Cary Coutant  
 
 
 
        * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
 
        definition and ...
 
        (read_unsigned_LEB_128_x): ... this new function.
 
        (read_signed_LEB_128): Replaced with inline definition and ...
 
        (read_signed_LEB_128_x): ... this new function.
 
        * int_encoding.h  (read_unsigned_LEB_128_x): New function.
 
        (read_unsigned_LEB_128): Add inline definition.
 
        (read_signed_LEB_128_x): New function.
 
        (read_signed_LEB_128): Add inline definition.
 
        * testsuite/Makefile.am (leb128_unittest): New unit test.
 
        * testsuite/Makefile.in: Regenerate.
 
        * testsuite/leb128_unittest.cc: New unit test.
 
 
 
2012-01-23  Ian Lance Taylor  
 
 
 
        PR gold/13617
 
        * i386.cc (Target_i386::do_code_fill): When using a jmp
 
        instruction, pad with nop instructions.
 
        * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
 
 
 
2012-01-22  H.J. Lu  
 
 
 
        * x86_64.cc (gc_process_relocs): Add typename on types used in
 
        template.
 
        (scan_relocs): Likewise.
 
        (relocate_section): Likewise.
 
        (apply_relocation): Likewise.
 
 
 
2012-01-10  H.J. Lu  
 
 
 
        * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
 
        (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
 
        under x32.
 
 
 
2012-01-09  H.J. Lu  
 
 
 
        * x86_64.cc: Initial support for x32.
 
 
 
2012-01-03  Cary Coutant  
 
 
 
        * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
 
        Use abstract base class for GOT.
 
        * gold/output.h (class Output_data_got_base): New abstract base class.
 
        (class Output_data_got): Derive from new base class, adjust ctors.
 
        (Output_data_got::reserve_slot): Make virtual; rename to
 
        do_reserve_slot; Adjust callers.
 
        * gold/target.h (Sized_target::init_got_plt_for_update): Return
 
        pointer to abstract base class.
 
        * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
 
 
 
2011-12-18  Ian Lance Taylor  
 
 
 
        * object.h (Relobj::local_symbol_value): New function.
 
        (Relobj::local_plt_offset): New function.
 
        (Relobj::local_has_got_offset): New function.
 
        (Relobj::local_got_offset): New function.
 
        (Relobj::set_local_got_offset): New function.
 
        (Relobj::do_local_symbol_value): New pure virtual function.
 
        (Relobj::do_local_plt_offset): Likewise.
 
        (Relobj::do_local_has_got_offset): Likewise.
 
        (Relobj::do_local_got_offset): Likewise.
 
        (Relobj::do_set_local_got_offset): Likewise.
 
        (Sized_relobj::do_local_has_got_offset): Rename from
 
        local_has_got_offset.
 
        (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
 
        (Sized_relobj::do_set_local_got_offset): Rename from
 
        set_local_got_offset.
 
        (Sized_relobj_file::do_local_plt_offset): Rename from
 
        local_plt_offset.
 
        (Sized_relobj_file::do_local_symbol_value): New function.
 
        * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
 
        local_plt_offset.
 
        * output.cc (Output_data_got::Got_entry::write): Change object to
 
        Relobj.  Use local_symbol_value.
 
        (Output_data_got::add_global_with_rel): Change rel_dyn to
 
        Output_data_reloc_generic*.  Use add_global_generic.
 
        (Output_data_got::add_global_with_rela): Remove.  Change all
 
        callers to use add_global_with_rel.
 
        (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
 
        Output_data_reloc_generic*.  Use add_global_generic.
 
        (Output_data_got::add_global_pair_with_rela): Remove.  Change all
 
        callers to use add_global_pair_with_rel.
 
        (Output_data_got::add_local): Change object to Relobj*.
 
        (Output_data_got::add_local_plt): Likewise.
 
        (Output_data_got::add_local_with_rel): Change object to Relobj*,
 
        change rel_dyn to Output_data_reloc_generic*.  Use
 
        add_local_generic.
 
        (Output_data_got::add_local_with_rela): Remove.  Change all
 
        callers to use all_local_with_rel.
 
        (Output_data_got::add_local_pair_with_rel): Change object to
 
        Relobj*, change rel_dyn to Output_data_reloc_generic*.  Use
 
        add_output_section_generic.
 
        (Output_data_got::add_local_pair_with_rela): Remove.  Change all
 
        callers to use add_local_pair_with_rel.
 
        (Output_data_got::reserve_local): Change object to Relobj*.
 
        * output.h: (class Output_data_reloc_generic): Add pure virtual
 
        declarations for add_global_generic, add_local_generic,
 
        add_output_section_generic.
 
        (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
 
        functions for Output_data_reloc_generic.  Update declarations for
 
        changes listed in output.cc.
 
        (class Output_data_got): Change template parameter to got_size.
 
        Don't define Rel_dyn or Rela_dyn.  Update declarations per above.
 
        * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
 
        function.
 
        (Sized_relobj_incr::do_local_plt_offset): New function.
 
        * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
 
        add_global_generic.
 
 
 
2011-12-17  Cary Coutant  
 
 
 
        * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
 
        * resolve.cc (Symbol_table::resolve): Likewise.
 
        * i386.cc (Target_i386::do_code_fill): Use char constants for nop
 
        arrays.
 
        * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
 
 
 
2011-12-16  Ian Lance Taylor  
 
 
 
        * output.h (Output_data_reloc_generic::add): Only call
 
        add_dynamic_reloc if this is a dynamic reloc section.
 
 
 
2011-12-15  H.J. Lu  
 
 
 
        PR gold/13505
 
        * target-reloc.h (apply_relocation): Replace <64, false> with
 
        .
 
 
 
2011-11-25  Nick Clifton  
 
 
 
        * po/it.po: New Italian translation.
 
 
 
2011-11-17  Sterling Augustine  
 
 
 
        * script.cc (script_include_directive): Implement.
 
        (read_script_file): New local variables name and search_path. Update
 
        comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
 
        * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
 
        * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
 
 
2011-11-11  Sterling Augustine  
2011-11-11  Sterling Augustine  
        * yyscript.y (section_cmd): Add support for INCLUDE directive.
        * yyscript.y (section_cmd): Add support for INCLUDE directive.
        (file_or_sections_cmd): Likewise.
        (file_or_sections_cmd): Likewise.
2011-11-11  Doug Kwan  
2011-11-11  Doug Kwan  
        * arm.cc (Target_arm::do_make_elf_object): Allow executable also
        * arm.cc (Target_arm::do_make_elf_object): Allow executable also
        if --just-symbols is given.
        if --just-symbols is given.
2011-11-10  Doug Kwan  
2011-11-10  Doug Kwan  
        PR gold/13362
        PR gold/13362
        * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
        * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
        when processing data relocs.
        when processing data relocs.
        * reloc.h (Relocate_functions::rel_unaligned): New method.
        * reloc.h (Relocate_functions::rel_unaligned): New method.
        (Relocate_functions::pcrel_unaligned): Ditto.
        (Relocate_functions::pcrel_unaligned): Ditto.
        (Relocate_functions::rel32_unaligned): Ditto.
        (Relocate_functions::rel32_unaligned): Ditto.
        (Relocate_functions::pcrel32_unaligned): Ditto.
        (Relocate_functions::pcrel32_unaligned): Ditto.
2011-11-09  Doug Kwan  
2011-11-09  Doug Kwan  
        PR gold/13362
        PR gold/13362
        * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
        * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
        Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
        Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
        * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
        * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        (Relocate_functions::rel_unaligned): New.
        (Relocate_functions::rel_unaligned): New.
        (Relocate_functions::rel32_unaligned): New.
        (Relocate_functions::rel32_unaligned): New.
        * target-reloc.h (relocate_for_relocatable): Add code to handle
        * target-reloc.h (relocate_for_relocatable): Add code to handle
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
        * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
        arm_unaligned_reloc_r): New targets.
        arm_unaligned_reloc_r): New targets.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
        * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
        linking.
        linking.
2011-11-02  Ian Lance Taylor  
2011-11-02  Ian Lance Taylor  
        * configure.ac: Add --with-lib-path option.  Define LIB_PATH and
        * configure.ac: Add --with-lib-path option.  Define LIB_PATH and
        NATIVE_LINKER.
        NATIVE_LINKER.
        * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
        * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
        * options.cc (General_options::finalize): Use library search path
        * options.cc (General_options::finalize): Use library search path
        from configure script if specified.  If not native and no sysroot,
        from configure script if specified.  If not native and no sysroot,
        only search TOOLLIBDIR.
        only search TOOLLIBDIR.
        * options.h (Search_directory::Search_directory): Change name to
        * options.h (Search_directory::Search_directory): Change name to
        const std::string&.
        const std::string&.
        (General_options::add_to_library_path_with_sysroot): Change arg to
        (General_options::add_to_library_path_with_sysroot): Change arg to
        const std::string&.
        const std::string&.
        * configure, Makefile.in, config.in: Rebuild.
        * configure, Makefile.in, config.in: Rebuild.
2011-11-02  Matthew Gretton-Dann  
2011-11-02  Matthew Gretton-Dann  
        * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
        * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
        we are working around the ARM1176 Erratum.
        we are working around the ARM1176 Erratum.
        * options.h (General_options::fix_arm1176): Add option.
        * options.h (General_options::fix_arm1176): Add option.
        * testsuite/Makefile.am: Add testcases, and keep current ones
        * testsuite/Makefile.am: Add testcases, and keep current ones
        working.
        working.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_fix_1176.s: New file.
        * testsuite/arm_fix_1176.s: New file.
        * testsuite/arm_fix_1176.sh: Likewise.
        * testsuite/arm_fix_1176.sh: Likewise.
2011-11-02  Matthew Gretton-Dann  
2011-11-02  Matthew Gretton-Dann  
        * arm.cc (Target_arm::Target_arm): Remove initialisation of
        * arm.cc (Target_arm::Target_arm): Remove initialisation of
        may_use_blx_.
        may_use_blx_.
        (Target_arm::may_use_blx): Remove method.
        (Target_arm::may_use_blx): Remove method.
        (Target_arm::set_may_use_blx): Likewise.
        (Target_arm::set_may_use_blx): Likewise.
        (Target_arm::may_use_v4t_interworking): New method.
        (Target_arm::may_use_v4t_interworking): New method.
        (Target_arm::may_use_v5t_interworking): Likewise.
        (Target_arm::may_use_v5t_interworking): Likewise.
        (Target_arm::may_use_blx_): Remove member variable.
        (Target_arm::may_use_blx_): Remove member variable.
        (Arm_relocate_functions::arm_branch_common): Check for v5T
        (Arm_relocate_functions::arm_branch_common): Check for v5T
        interworking.
        interworking.
        (Arm_relocate_functions::thumb_branch_common): Likewise.
        (Arm_relocate_functions::thumb_branch_common): Likewise.
        (Reloc_stub::stub_type_for_reloc): Likewise.
        (Reloc_stub::stub_type_for_reloc): Likewise.
        (Target_arm::do_finalize_sections): Correct interworking checks.
        (Target_arm::do_finalize_sections): Correct interworking checks.
        * testsuite/Makefile.am: Add new tests.
        * testsuite/Makefile.am: Add new tests.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_farcall_arm_arm.s: New test.
        * testsuite/arm_farcall_arm_arm.s: New test.
        * testsuite/arm_farcall_arm_arm.sh: Likewise.
        * testsuite/arm_farcall_arm_arm.sh: Likewise.
        * testsuite/arm_farcall_arm_thumb.s: Likewise.
        * testsuite/arm_farcall_arm_thumb.s: Likewise.
        * testsuite/arm_farcall_arm_thumb.sh: Likewise.
        * testsuite/arm_farcall_arm_thumb.sh: Likewise.
        * testsuite/arm_farcall_thumb_arm.s: Likewise.
        * testsuite/arm_farcall_thumb_arm.s: Likewise.
        * testsuite/arm_farcall_thumb_arm.sh: Likewise.
        * testsuite/arm_farcall_thumb_arm.sh: Likewise.
        * testsuite/arm_farcall_thumb_thumb.s: Likewise.
        * testsuite/arm_farcall_thumb_thumb.s: Likewise.
        * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
        * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2011-10-31  Cary Coutant  
2011-10-31  Cary Coutant  
        PR gold/13023
        PR gold/13023
        * expression.cc (Expression::eval_with_dot): Add
        * expression.cc (Expression::eval_with_dot): Add
        is_section_dot_assignment parameter.
        is_section_dot_assignment parameter.
        (Expression::eval_maybe_dot): Likewise.  Adjust value when rhs is
        (Expression::eval_maybe_dot): Likewise.  Adjust value when rhs is
        absolute and assigning to dot within a section.
        absolute and assigning to dot within a section.
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_assignment::set_section_addresses): Pass
        (Output_section_element_assignment::set_section_addresses): Pass
        dot_section to set_if_absolute.
        dot_section to set_if_absolute.
        (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
        (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
        as is_section_dot_assignment flag to eval_with_dot.
        as is_section_dot_assignment flag to eval_with_dot.
        (Output_section_element_dot_assignment::set_section_addresses):
        (Output_section_element_dot_assignment::set_section_addresses):
        Likewise.
        Likewise.
        * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
        * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
        parameter.  Also set value if relative to dot_section; set the
        parameter.  Also set value if relative to dot_section; set the
        symbol's output_section.
        symbol's output_section.
        * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
        * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
        parameter.  Adjust all callers.
        parameter.  Adjust all callers.
        (Expression::eval_maybe_dot): Likewise.
        (Expression::eval_maybe_dot): Likewise.
        (Symbol_assignment::set_if_absolute): Add dot_section parameter.
        (Symbol_assignment::set_if_absolute): Add dot_section parameter.
        Adjust all callers.
        Adjust all callers.
        * testsuite/script_test_2.t: Test assignment of an absolute value
        * testsuite/script_test_2.t: Test assignment of an absolute value
        to dot within an output section element.
        to dot within an output section element.
2011-10-31  Cary Coutant  
2011-10-31  Cary Coutant  
        * options.h (class General_options): Add --[no-]gnu-unique options.
        * options.h (class General_options): Add --[no-]gnu-unique options.
        * symtab.cc (Symbol_table::sized_write_globals): Convert
        * symtab.cc (Symbol_table::sized_write_globals): Convert
        STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
        STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2011-10-31  Cary Coutant  
2011-10-31  Cary Coutant  
        PR gold/13359
        PR gold/13359
        * i386.cc (Target_i386::Relocate::relocate_tls): Remove
        * i386.cc (Target_i386::Relocate::relocate_tls): Remove
        unnecessary assertion.
        unnecessary assertion.
        * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
        * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2011-10-31 Sriraman Tallam  
2011-10-31 Sriraman Tallam  
        * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
        * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
        gc_mark_symbol.
        gc_mark_symbol.
        * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
        * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
        gc_mark_symbol.
        gc_mark_symbol.
        Change to just keep the section associated with symbol.
        Change to just keep the section associated with symbol.
        (Symbol_table::add_from_relobj): Mark symbols as not garbage when
        (Symbol_table::add_from_relobj): Mark symbols as not garbage when
        they are externally visible and --export-dynamic is turned on.
        they are externally visible and --export-dynamic is turned on.
        (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
        (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2011-10-19  Ian Lance Taylor  
2011-10-19  Ian Lance Taylor  
        PR gold/13163
        PR gold/13163
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_dot_assignment::needs_output_section): New
        (Output_section_element_dot_assignment::needs_output_section): New
        function.
        function.
2011-10-19  Ian Lance Taylor  
2011-10-19  Ian Lance Taylor  
        PR gold/13204
        PR gold/13204
        * layout.cc (Layout::segment_precedes): Don't assert failure if a
        * layout.cc (Layout::segment_precedes): Don't assert failure if a
        --section-start option was seen.
        --section-start option was seen.
        * options.h (General_options::any_section_start): New function.
        * options.h (General_options::any_section_start): New function.
2011-10-18  David S. Miller  
2011-10-18  David S. Miller  
        PR binutils/13301
        PR binutils/13301
        * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
        * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
        member to track relocation locations that have moved during TLS
        member to track relocation locations that have moved during TLS
        reloc optimizations.
        reloc optimizations.
        (Target_sparc::Relocate::Relocate): Initialize to NULL.
        (Target_sparc::Relocate::Relocate): Initialize to NULL.
        (Target_sparc::Relocate::relocate): Adjust view down by 4
        (Target_sparc::Relocate::relocate): Adjust view down by 4
        bytes if it matches reloc_adjust_addr_.
        bytes if it matches reloc_adjust_addr_.
        (Target_sparc::Relocate::relocate_tls): Always move the
        (Target_sparc::Relocate::relocate_tls): Always move the
        __tls_get_addr call delay slot instruction forward 4 bytes when
        __tls_get_addr call delay slot instruction forward 4 bytes when
        performing relaxation.
        performing relaxation.
2011-10-18  Cary Coutant  
2011-10-18  Cary Coutant  
        * output.cc (posix_fallocate): Return 0 on success, errno on failure.
        * output.cc (posix_fallocate): Return 0 on success, errno on failure.
        (Output_file::map_no_anonymous): Check for non-zero
        (Output_file::map_no_anonymous): Check for non-zero
        return code from posix_fallocate.
        return code from posix_fallocate.
2011-10-17  Cary Coutant  
2011-10-17  Cary Coutant  
        PR gold/13245
        PR gold/13245
        * plugin.cc (is_visible_from_outside): Check for symbols
        * plugin.cc (is_visible_from_outside): Check for symbols
        referenced from dynamic objects.
        referenced from dynamic objects.
        * resolve.cc (Symbol_table::resolve): Don't count references
        * resolve.cc (Symbol_table::resolve): Don't count references
        from dynamic objects as references from real ELF files.
        from dynamic objects as references from real ELF files.
        * testsuite/plugin_test_2.sh: Adjust expected result.
        * testsuite/plugin_test_2.sh: Adjust expected result.
2011-10-17  Cary Coutant  
2011-10-17  Cary Coutant  
        * gold.cc: Include timer.h.
        * gold.cc: Include timer.h.
        (queue_middle_tasks): Stamp time.
        (queue_middle_tasks): Stamp time.
        (queue_final_tasks): Likewise.
        (queue_final_tasks): Likewise.
        * main.cc (main): Store timer in parameters.  Print timers
        * main.cc (main): Store timer in parameters.  Print timers
        for each pass.
        for each pass.
        * parameters.cc (Parameters::Parameters): Initialize timer_.
        * parameters.cc (Parameters::Parameters): Initialize timer_.
        (Parameters::set_timer): New function.
        (Parameters::set_timer): New function.
        (set_parameters_timer): New function.
        (set_parameters_timer): New function.
        * parameters.h (Parameters::set_timer): New function.
        * parameters.h (Parameters::set_timer): New function.
        (Parameters::timer): New function.
        (Parameters::timer): New function.
        (Parameters::timer_): New data member.
        (Parameters::timer_): New data member.
        (set_parameters_timer): New function.
        (set_parameters_timer): New function.
        * timer.cc (Timer::stamp): New function.
        * timer.cc (Timer::stamp): New function.
        (Timer::get_pass_time): New function.
        (Timer::get_pass_time): New function.
        * timer.h (Timer::stamp): New function.
        * timer.h (Timer::stamp): New function.
        (Timer::get_pass_time): New function.
        (Timer::get_pass_time): New function.
        (Timer::pass_times_): New data member.
        (Timer::pass_times_): New data member.
2011-10-17  Cary Coutant  
2011-10-17  Cary Coutant  
        * readsyms.cc (Read_symbols::run): Don't queue an unblocker
        * readsyms.cc (Read_symbols::run): Don't queue an unblocker
        task for members of lib groups.
        task for members of lib groups.
2011-10-17  Cary Coutant  
2011-10-17  Cary Coutant  
        PR gold/13288
        PR gold/13288
        * fileread.cc (File_read::find_view): Add assert.
        * fileread.cc (File_read::find_view): Add assert.
        (File_read::make_view): Move bounds check (replace with assert)...
        (File_read::make_view): Move bounds check (replace with assert)...
        (File_read::find_or_make_view): ... to here.
        (File_read::find_or_make_view): ... to here.
2011-10-12  Cary Coutant  
2011-10-12  Cary Coutant  
        * output.cc (Output_file::open_base_file): Handle case where
        * output.cc (Output_file::open_base_file): Handle case where
        ::read returns less than requested size.
        ::read returns less than requested size.
2011-10-10  Cary Coutant  
2011-10-10  Cary Coutant  
        * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
        * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
        Initialize defined_count_.
        Initialize defined_count_.
        (Sized_relobj_incr::do_add_symbols): Count defined symbols.
        (Sized_relobj_incr::do_add_symbols): Count defined symbols.
        (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
        (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
        (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
        (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
        (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
        (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
        (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
        (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
        * incremental.h (Sized_relobj_incr::defined_count_): New data
        * incremental.h (Sized_relobj_incr::defined_count_): New data
        member.
        member.
        (Sized_incr_dynobj::defined_count_): New data member.
        (Sized_incr_dynobj::defined_count_): New data member.
        * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
        * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
        Return zeroes instead of internal error.
        Return zeroes instead of internal error.
2011-10-10  Cary Coutant  
2011-10-10  Cary Coutant  
        PR gold/13249
        PR gold/13249
        * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
        * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
        (Output_reloc::symbol_value): Return PLT offset if flag is set.
        (Output_reloc::symbol_value): Return PLT offset if flag is set.
        * output.h (class Output_reloc): Add use_plt_offset flag.
        * output.h (class Output_reloc): Add use_plt_offset flag.
        (Output_reloc::type_): Adjust size of bit field.
        (Output_reloc::type_): Adjust size of bit field.
        (Output_reloc::use_plt_offset_): New bit field.
        (Output_reloc::use_plt_offset_): New bit field.
        (class Output_data_reloc): Adjust all calls to Output_reloc_type.
        (class Output_data_reloc): Adjust all calls to Output_reloc_type.
        (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
        (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
        flag.  Adjust all callers.
        flag.  Adjust all callers.
        * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
        * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
        creating RELATIVE relocations.
        creating RELATIVE relocations.
2011-10-10  Nick Clifton  
2011-10-10  Nick Clifton  
        * po/es.po: Updated Spanish translation.
        * po/es.po: Updated Spanish translation.
        * po/fi.po: Updated Finnish translation.
        * po/fi.po: Updated Finnish translation.
2011-10-03   Diego Novillo  
2011-10-03   Diego Novillo  
        * options.cc (parse_uint): Fix dereference of RETVAL.
        * options.cc (parse_uint): Fix dereference of RETVAL.
2011-09-29  Sriraman Tallam  
2011-09-29  Sriraman Tallam  
        * layout.h (section_order_map_): New member.
        * layout.h (section_order_map_): New member.
        (get_section_order_map): New member function.
        (get_section_order_map): New member function.
        * output.cc (Output_section::add_input_section): Check for patterns
        * output.cc (Output_section::add_input_section): Check for patterns
        only when --section-ordering-file is specified.
        only when --section-ordering-file is specified.
        * gold.cc (queue_middle_tasks): Delay updating order of sections till
        * gold.cc (queue_middle_tasks): Delay updating order of sections till
        output_sections have been formed.
        output_sections have been formed.
        * layout.cc (Layout_Layout): Initialize section_order_map_.
        * layout.cc (Layout_Layout): Initialize section_order_map_.
        * plugin.cc (update_section_order): Store order in order_map. Do not
        * plugin.cc (update_section_order): Store order in order_map. Do not
        update the order.
        update the order.
        * testsuite/Makefile.am: Add test case for plugin_final_layout.
        * testsuite/Makefile.am: Add test case for plugin_final_layout.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/plugin_section_order.c: New file.
        * testsuite/plugin_section_order.c: New file.
        * testsuite/plugin_final_layout.cc: New file.
        * testsuite/plugin_final_layout.cc: New file.
        * testsuite/plugin_final_layout.sh: New file.
        * testsuite/plugin_final_layout.sh: New file.
2011-09-29  Cary Coutant  
2011-09-29  Cary Coutant  
        * incremental.cc (Sized_incremental_binary::do_process_got_plt):
        * incremental.cc (Sized_incremental_binary::do_process_got_plt):
        Check for NULL.
        Check for NULL.
        * symtab.cc (Symbol_table::add_from_relobj): Ignore version
        * symtab.cc (Symbol_table::add_from_relobj): Ignore version
        symbols during incremental update.
        symbols during incremental update.
        (Symbol_table::add_from_dynobj): Likewise.
        (Symbol_table::add_from_dynobj): Likewise.
2011-09-27  Viktor Kutuzov  
2011-09-27  Viktor Kutuzov  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * symtab.cc (Symbol_table::define_special_symbol): Always
        * symtab.cc (Symbol_table::define_special_symbol): Always
        canonicalize version string.
        canonicalize version string.
2011-09-26  Cary Coutant  
2011-09-26  Cary Coutant  
        * gold.cc (queue_initial_tasks): Move option checks ...
        * gold.cc (queue_initial_tasks): Move option checks ...
        * options.cc (General_options::finalize): ... to here. Disable
        * options.cc (General_options::finalize): ... to here. Disable
        some options; make others fatal.
        some options; make others fatal.
2011-09-26  Cary Coutant  
2011-09-26  Cary Coutant  
        gcc PR lto/47247
        gcc PR lto/47247
        * plugin.cc (get_symbols_v2): New function.
        * plugin.cc (get_symbols_v2): New function.
        (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
        (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
        (is_referenced_from_outside): New function.
        (is_referenced_from_outside): New function.
        (Pluginobj::get_symbol_resolution_info): Add version parameter, return
        (Pluginobj::get_symbol_resolution_info): Add version parameter, return
        LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
        LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
        (get_symbols): Pass version parameter.
        (get_symbols): Pass version parameter.
        (get_symbols_v2): New function.
        (get_symbols_v2): New function.
        * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
        * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
        parameter.
        parameter.
        * testsuite/plugin_test.c (get_symbols_v2): New static variable.
        * testsuite/plugin_test.c (get_symbols_v2): New static variable.
        (onload): Add LDPT_GET_SYMBOLS_V2.
        (onload): Add LDPT_GET_SYMBOLS_V2.
        (all_symbols_read_hook): Use get_symbols_v2; check for
        (all_symbols_read_hook): Use get_symbols_v2; check for
        LDPR_PREVAILING_DEF_IRONLY_EXP.
        LDPR_PREVAILING_DEF_IRONLY_EXP.
        * testsuite/plugin_test_3.sh: Update expected results.
        * testsuite/plugin_test_3.sh: Update expected results.
2011-09-23  Simon Baldwin  
2011-09-23  Simon Baldwin  
        * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
        * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
        configuration options.
        configuration options.
        * configure: Regenerate.
        * configure: Regenerate.
        * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
        * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-09-19  Sriraman Tallam  
2011-09-19  Sriraman Tallam  
        * plugin.h (should_defer_layout): Modify to check for any_claimed_.
        * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2011-09-19  Cary Coutant  
2011-09-19  Cary Coutant  
        * incremental.cc (can_incremental_update): Fix typo in comment.
        * incremental.cc (can_incremental_update): Fix typo in comment.
        * incremental.h (can_incremental_update): Likewise.
        * incremental.h (can_incremental_update): Likewise.
2011-09-18  Cary Coutant  
2011-09-18  Cary Coutant  
        * incremental.cc (can_incremental_update): New function.
        * incremental.cc (can_incremental_update): New function.
        * incremental.h (can_incremental_update): New function.
        * incremental.h (can_incremental_update): New function.
        * layout.cc (Layout::init_fixed_output_section): Call it.
        * layout.cc (Layout::init_fixed_output_section): Call it.
        (Layout::make_output_section): Don't allow patch space in .eh_frame.
        (Layout::make_output_section): Don't allow patch space in .eh_frame.
        * object.cc (Sized_relobj_file::do_layout): Call
        * object.cc (Sized_relobj_file::do_layout): Call
        can_incremental_update.
        can_incremental_update.
2011-09-13  Cary Coutant  
2011-09-13  Cary Coutant  
        * configure.ac: Check for glibc support for gnu_indirect_function
        * configure.ac: Check for glibc support for gnu_indirect_function
        support with static linking, setting automake conditional
        support with static linking, setting automake conditional
        IFUNC_STATIC.
        IFUNC_STATIC.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * configure: Regenerate.
        * configure: Regenerate.
        * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
        * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
        (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
        (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
        for IFUNC_STATIC.
        for IFUNC_STATIC.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-09-13  Cary Coutant  
2011-09-13  Cary Coutant  
        * incremental.cc (Sized_relobj_incr::do_layout): Call
        * incremental.cc (Sized_relobj_incr::do_layout): Call
        report_comdat_group for kept comdat sections.
        report_comdat_group for kept comdat sections.
        * testsuite/Makefile.am (incremental_comdat_test_1): New test.
        * testsuite/Makefile.am (incremental_comdat_test_1): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/incr_comdat_test_1.cc: New source file.
        * testsuite/incr_comdat_test_1.cc: New source file.
        * testsuite/incr_comdat_test_2_v1.cc: New source file.
        * testsuite/incr_comdat_test_2_v1.cc: New source file.
        * testsuite/incr_comdat_test_2_v2.cc: New source file.
        * testsuite/incr_comdat_test_2_v2.cc: New source file.
        * testsuite/incr_comdat_test_2_v3.cc: New source file.
        * testsuite/incr_comdat_test_2_v3.cc: New source file.
2011-09-13  Ian Lance Taylor  
2011-09-13  Ian Lance Taylor  
        * object.cc (Sized_relobj_file::do_layout): Remove unused local
        * object.cc (Sized_relobj_file::do_layout): Remove unused local
        variable external_symbols_offset.
        variable external_symbols_offset.
2011-09-12  Ian Lance Taylor  
2011-09-12  Ian Lance Taylor  
        * object.cc (Sized_relobj_file::do_layout): Remove assertion which
        * object.cc (Sized_relobj_file::do_layout): Remove assertion which
        triggered if object has no symbols.
        triggered if object has no symbols.
2011-09-09  David S. Miller  
2011-09-09  David S. Miller  
        * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
        * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
        (Output_fill_debug_line::do_write): Likewise.
        (Output_fill_debug_line::do_write): Likewise.
2011-08-29  Cary Coutant  
2011-08-29  Cary Coutant  
        * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
        * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
        casts to match formatting specs.
        casts to match formatting specs.
        (Output_fill_debug_line::do_minimum_hole_size): Likewise.
        (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2011-08-26  Cary Coutant  
2011-08-26  Cary Coutant  
        * layout.cc (Free_list::allocate): Provide guarantee of minimum
        * layout.cc (Free_list::allocate): Provide guarantee of minimum
        remaining hole size when allocating.
        remaining hole size when allocating.
        (Layout::make_output_section): Set fill methods for debug sections.
        (Layout::make_output_section): Set fill methods for debug sections.
        * layout.h (Free_list::Free_list_node): Move from private to
        * layout.h (Free_list::Free_list_node): Move from private to
        public.
        public.
        (Free_list::set_min_hole_size): New function.
        (Free_list::set_min_hole_size): New function.
        (Free_list::begin, Free_list::end): New functions.
        (Free_list::begin, Free_list::end): New functions.
        (Free_list::min_hole_): New data member.
        (Free_list::min_hole_): New data member.
        * output.cc: Include dwarf.h.
        * output.cc: Include dwarf.h.
        (Output_fill_debug_info::do_minimum_hole_size): New function.
        (Output_fill_debug_info::do_minimum_hole_size): New function.
        (Output_fill_debug_info::do_write): New function.
        (Output_fill_debug_info::do_write): New function.
        (Output_fill_debug_line::do_minimum_hole_size): New function.
        (Output_fill_debug_line::do_minimum_hole_size): New function.
        (Output_fill_debug_line::do_write): New function.
        (Output_fill_debug_line::do_write): New function.
        (Output_section::Output_section): Initialize new data member.
        (Output_section::Output_section): Initialize new data member.
        (Output_section::set_final_data_size): Ensure patch space is larger
        (Output_section::set_final_data_size): Ensure patch space is larger
        than minimum hole size.
        than minimum hole size.
        (Output_section::do_write): Fill holes in debug sections.
        (Output_section::do_write): Fill holes in debug sections.
        * output.h (Output_fill): New class.
        * output.h (Output_fill): New class.
        (Output_fill_debug_info): New class.
        (Output_fill_debug_info): New class.
        (Output_fill_debug_line): New class.
        (Output_fill_debug_line): New class.
        (Output_section::set_free_space_fill): New function.
        (Output_section::set_free_space_fill): New function.
        (Output_section::free_space_fill_): New data member.
        (Output_section::free_space_fill_): New data member.
        * testsuite/Makefile.am (incremental_test_3): Add
        * testsuite/Makefile.am (incremental_test_3): Add
        --incremental-patch option.
        --incremental-patch option.
        (incremental_test_4): Likewise.
        (incremental_test_4): Likewise.
        (incremental_test_5): Likewise.
        (incremental_test_5): Likewise.
        (incremental_test_6): Likewise.
        (incremental_test_6): Likewise.
        (incremental_copy_test): Likewise.
        (incremental_copy_test): Likewise.
        (incremental_common_test_1): Likewise.
        (incremental_common_test_1): Likewise.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-08-26  Nick Clifton  
2011-08-26  Nick Clifton  
        * po/es.po: Updated Spanish translation.
        * po/es.po: Updated Spanish translation.
2011-08-01  Cary Coutant  
2011-08-01  Cary Coutant  
        * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
        * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
        * gold/testsuite/Makefile.in: Regenerate.
        * gold/testsuite/Makefile.in: Regenerate.
        * gold/testsuite/justsyms_exec.c: New source file.
        * gold/testsuite/justsyms_exec.c: New source file.
        * gold/testsuite/justsyms_lib.c: New source file.
        * gold/testsuite/justsyms_lib.c: New source file.
2011-08-01  Cary Coutant  
2011-08-01  Cary Coutant  
        * layout.cc (Layout::set_segment_offsets): Don't realign text
        * layout.cc (Layout::set_segment_offsets): Don't realign text
        segment if -Ttext was specified.
        segment if -Ttext was specified.
        * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
        * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
        file type.
        file type.
        * object.h (Sized_relobj_file::e_type): New function.
        * object.h (Sized_relobj_file::e_type): New function.
        (Sized_relobj_file::e_type_): New data member.
        (Sized_relobj_file::e_type_): New data member.
        * symtab.cc (Symbol_table::add_from_relobj): Don't add section
        * symtab.cc (Symbol_table::add_from_relobj): Don't add section
        base address for ET_EXEC files.
        base address for ET_EXEC files.
        * target.cc (Target::do_make_elf_object_implementation): Allow
        * target.cc (Target::do_make_elf_object_implementation): Allow
        ET_EXEC files with --just-symbols option.
        ET_EXEC files with --just-symbols option.
2011-07-28  Cary Coutant  
2011-07-28  Cary Coutant  
        * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
        * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
        Add thread_number parameter.
        Add thread_number parameter.
        (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
        (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
        * workqueue-threads.cc
        * workqueue-threads.cc
        (Workqueue_threader_threadpool::should_cancel_thread): Cancel
        (Workqueue_threader_threadpool::should_cancel_thread): Cancel
        current thread if its thread number is greater than desired thread
        current thread if its thread number is greater than desired thread
        count.
        count.
        * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
        * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
        Add thread_number parameter.
        Add thread_number parameter.
        (Workqueue::should_cancel_thread): Likewise.
        (Workqueue::should_cancel_thread): Likewise.
        (Workqueue::find_runnable_or_wait): Pass thread_number to
        (Workqueue::find_runnable_or_wait): Pass thread_number to
        should_cancel_thread.
        should_cancel_thread.
        * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
        * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
        parameter.
        parameter.
2011-07-22  Sriraman Tallam  
2011-07-22  Sriraman Tallam  
        * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
        * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
        only after checking if it cannot be forced local.
        only after checking if it cannot be forced local.
        * symtab.h (is_externally_visible): Check if the symbol is not forced
        * symtab.h (is_externally_visible): Check if the symbol is not forced
        local.
        local.
2011-07-15  Ian Lance Taylor  
2011-07-15  Ian Lance Taylor  
        * options.h (class General_options): Add --print-output-format.
        * options.h (class General_options): Add --print-output-format.
        Move -EL next to -EB, for  better --help output.
        Move -EL next to -EB, for  better --help output.
        * target-select.cc: Include , "options.h", and
        * target-select.cc: Include , "options.h", and
        "parameters.h".
        "parameters.h".
        (Target_selector::do_target_bfd_name): New function.
        (Target_selector::do_target_bfd_name): New function.
        (print_output_format): New function.
        (print_output_format): New function.
        * target-select.h (class Target_selector): Update declarations.
        * target-select.h (class Target_selector): Update declarations.
        (Target_selector::target_bfd_name): New function.
        (Target_selector::target_bfd_name): New function.
        (print_output_format): Declare.
        (print_output_format): Declare.
        * main.cc: Include "target-select.h".
        * main.cc: Include "target-select.h".
        (main): Handle --print-output-format.
        (main): Handle --print-output-format.
        * gold.cc: Include "target-select.h".
        * gold.cc: Include "target-select.h".
        (queue_initial_tasks): Handle --print-output-format when there are
        (queue_initial_tasks): Handle --print-output-format when there are
        no input files.
        no input files.
        * parameters.cc (parameters_force_valid_target): Give a better
        * parameters.cc (parameters_force_valid_target): Give a better
        error message if -EB/-EL does not match target.
        error message if -EB/-EL does not match target.
        * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
        * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
        function.
        function.
2011-07-15  Ian Lance Taylor  
2011-07-15  Ian Lance Taylor  
        * i386.cc (class Output_data_plt_i386): Add layout_ field.
        * i386.cc (class Output_data_plt_i386): Add layout_ field.
        (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
        (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
        (Output_data_plt_i386::do_write): Write address of .dynamic
        (Output_data_plt_i386::do_write): Write address of .dynamic
        section to first entry in .got.plt section.
        section to first entry in .got.plt section.
        * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
        * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
        (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
        (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
        Initialize layout_.
        Initialize layout_.
        (Output_data_plt_x86_64::do_write): Write address of .dynamic
        (Output_data_plt_x86_64::do_write): Write address of .dynamic
        section to first entry in .got.plt section.
        section to first entry in .got.plt section.
        * layout.h (Layout::dynamic_section): New function.
        * layout.h (Layout::dynamic_section): New function.
2011-07-13  Sriraman Tallam  
2011-07-13  Sriraman Tallam  
        * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
        * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
        to claim_file call.
        to claim_file call.
        * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
        * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
        input_section_position_, and input_section_glob_.
        input_section_position_, and input_section_glob_.
        (read_layout_from_file): Call function section_ordering_specified.
        (read_layout_from_file): Call function section_ordering_specified.
        * layout.h (is_section_ordering_specified): New function.
        * layout.h (is_section_ordering_specified): New function.
        (section_ordering_specified): New function.
        (section_ordering_specified): New function.
        (section_ordering_specified_): New boolean member.
        (section_ordering_specified_): New boolean member.
        * main.cc(main): Call load_plugins after layout object is defined.
        * main.cc(main): Call load_plugins after layout object is defined.
        * output.cc (Output_section::add_input_section): Use
        * output.cc (Output_section::add_input_section): Use
        function section_ordering_specified to check if section ordering is
        function section_ordering_specified to check if section ordering is
        needed.
        needed.
        * output.cc (Output_section::add_relaxed_input_section): Use
        * output.cc (Output_section::add_relaxed_input_section): Use
        function section_ordering_specified to check if section ordering is
        function section_ordering_specified to check if section ordering is
        needed.
        needed.
        (Output_section::update_section_layout): New function.
        (Output_section::update_section_layout): New function.
        (Output_section::sort_attached_input_sections): Check if input section
        (Output_section::sort_attached_input_sections): Check if input section
        must be reordered.
        must be reordered.
        * output.h (Output_section::update_section_layout): New function.
        * output.h (Output_section::update_section_layout): New function.
        * plugin.cc (get_section_count): New function.
        * plugin.cc (get_section_count): New function.
        (get_section_type): New function.
        (get_section_type): New function.
        (get_section_name): New function.
        (get_section_name): New function.
        (get_section_contents): New function.
        (get_section_contents): New function.
        (update_section_order): New function.
        (update_section_order): New function.
        (allow_section_ordering): New function.
        (allow_section_ordering): New function.
        (Plugin::load): Add the new interfaces to the transfer vector.
        (Plugin::load): Add the new interfaces to the transfer vector.
        (Plugin_manager::load_plugins): New parameter.
        (Plugin_manager::load_plugins): New parameter.
        (Plugin_manager::all_symbols_read): New parameter.
        (Plugin_manager::all_symbols_read): New parameter.
        (Plugin_manager::claim_file): New parameter. Save the elf object for
        (Plugin_manager::claim_file): New parameter. Save the elf object for
        unclaimed objects.
        unclaimed objects.
        (Plugin_manager::get_elf_object): New function.
        (Plugin_manager::get_elf_object): New function.
        (Plugin_manager::get_view): Change to directly use the bool to check
        (Plugin_manager::get_view): Change to directly use the bool to check
        if get_view is called from claim_file_hook.
        if get_view is called from claim_file_hook.
        * plugin.h (input_objects): New function
        * plugin.h (input_objects): New function
        (Plugin__manager::load_plugins): New parameter.
        (Plugin__manager::load_plugins): New parameter.
        (Plugin_manager::claim_file): New parameter.
        (Plugin_manager::claim_file): New parameter.
        (Plugin_manager::get_elf_object): New function.
        (Plugin_manager::get_elf_object): New function.
        (Plugin_manager::in_claim_file_handler): New function.
        (Plugin_manager::in_claim_file_handler): New function.
        (Plugin_manager::in_claim_file_handler_): New member.
        (Plugin_manager::in_claim_file_handler_): New member.
        (layout): New function.
        (layout): New function.
        * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
        * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
        handler with an extra parameter. Make the elf object before calling
        handler with an extra parameter. Make the elf object before calling
        claim_file handler.
        claim_file handler.
        * testsuite/plugin_test.c (get_section_count): New function pointer.
        * testsuite/plugin_test.c (get_section_count): New function pointer.
        (get_section_type): New function pointer.
        (get_section_type): New function pointer.
        (get_section_name): New function pointer.
        (get_section_name): New function pointer.
        (get_section_contents): New function pointer.
        (get_section_contents): New function pointer.
        (update_section_order): New function pointer.
        (update_section_order): New function pointer.
        (allow_section_ordering): New function pointer.
        (allow_section_ordering): New function pointer.
        (onload): Check if the new interfaces exist.
        (onload): Check if the new interfaces exist.
2011-07-13  Ian Lance Taylor  
2011-07-13  Ian Lance Taylor  
        * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
        * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
        relro section.
        relro section.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
        (relro_now_test_SOURCES): New variable.
        (relro_now_test_SOURCES): New variable.
        (relro_now_test_DEPENDENCIES): New variable.
        (relro_now_test_DEPENDENCIES): New variable.
        (relro_now_test_LDFLAGS): New variable.
        (relro_now_test_LDFLAGS): New variable.
        (relro_now_test_LDADD): New variable.
        (relro_now_test_LDADD): New variable.
        (relro_now_test.so): New target.
        (relro_now_test.so): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-07-12  Ian Lance Taylor  
2011-07-12  Ian Lance Taylor  
        PR gold/12980
        PR gold/12980
        * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
        * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
        GLOB_DAT relocation rather than a RELATIVE relocation for a
        GLOB_DAT relocation rather than a RELATIVE relocation for a
        protected symbol when creating a shared library.
        protected symbol when creating a shared library.
        * x86_64.cc (Target_x86_64::Scan::global): Likewise.
        * x86_64.cc (Target_x86_64::Scan::global): Likewise.
        * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
        * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
        * testsuite/protected_main_1.cc (main): Test that protected
        * testsuite/protected_main_1.cc (main): Test that protected
        function has same address.
        function has same address.
2011-07-11  Ian Lance Taylor  
2011-07-11  Ian Lance Taylor  
        PR gold/12979
        PR gold/12979
        * options.h (class General_options): Add -Bgroup.
        * options.h (class General_options): Add -Bgroup.
        * options.cc (General_options::finalize): If -Bgroup is set,
        * options.cc (General_options::finalize): If -Bgroup is set,
        default to --unresolved-symbols=report-all.
        default to --unresolved-symbols=report-all.
        * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
        * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
        * target-reloc.h (issue_undefined_symbol_error): Handle
        * target-reloc.h (issue_undefined_symbol_error): Handle
        --unresolved-symbols=report-all.
        --unresolved-symbols=report-all.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        PR gold/11985
        PR gold/11985
        * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
        * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
        if linker script discards key sections.
        if linker script discards key sections.
        (Layout::create_dynamic_symtab): Likewise.
        (Layout::create_dynamic_symtab): Likewise.
        (Layout::assign_local_dynsym_offsets): Likewise.
        (Layout::assign_local_dynsym_offsets): Likewise.
        (Layout::sized_create_version_sections): Likewise.
        (Layout::sized_create_version_sections): Likewise.
        (Layout::create_interp): Likewise.
        (Layout::create_interp): Likewise.
        (Layout::finish_dynamic_section): Likewise.
        (Layout::finish_dynamic_section): Likewise.
        (Layout::set_dynamic_symbol_size): Likewise.
        (Layout::set_dynamic_symbol_size): Likewise.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        PR gold/12386
        PR gold/12386
        * options.h (class General_options): Add --unresolved-symbols.
        * options.h (class General_options): Add --unresolved-symbols.
        * target-reloc.h (issue_undefined_symbol_error): Check
        * target-reloc.h (issue_undefined_symbol_error): Check
        --unresolved-symbols.  Add comments.
        --unresolved-symbols.  Add comments.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        * testsuite/odr_violation2.cc (Ordering::operator()): Make
        * testsuite/odr_violation2.cc (Ordering::operator()): Make
        expression more complex.
        expression more complex.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        PR gold/11317
        PR gold/11317
        * target-reloc.h (issue_undefined_symbol_error): New inline
        * target-reloc.h (issue_undefined_symbol_error): New inline
        function, broken out of relocate_section.
        function, broken out of relocate_section.
        (relocate_section): Call issue_undefined_symbol_error.
        (relocate_section): Call issue_undefined_symbol_error.
        * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
        * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
        there is no TLS segment if we are about to issue an undefined
        there is no TLS segment if we are about to issue an undefined
        symbol error.
        symbol error.
        * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
        * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        PR gold/12279
        PR gold/12279
        * resolve.cc (Symbol_table::should_override): Add fromtype
        * resolve.cc (Symbol_table::should_override): Add fromtype
        parameter.  Change all callers.  Give error when linking together
        parameter.  Change all callers.  Give error when linking together
        TLS and non-TLS symbol.
        TLS and non-TLS symbol.
        (Symbol_table::should_override_with_special): Add fromtype
        (Symbol_table::should_override_with_special): Add fromtype
        parameter.  Change all callers.
        parameter.  Change all callers.
        * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
        * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
        there is no TLS segment if we have reported some errors.
        there is no TLS segment if we have reported some errors.
        * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
        * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2011-07-08  Ian Lance Taylor  
2011-07-08  Ian Lance Taylor  
        PR gold/12372
        PR gold/12372
        * target.h (Target::plt_address_for_global): New function.
        * target.h (Target::plt_address_for_global): New function.
        (Target::plt_address_for_local): New function.
        (Target::plt_address_for_local): New function.
        (Target::plt_section_for_global): Remove.
        (Target::plt_section_for_global): Remove.
        (Target::plt_section_for_local): Remove.
        (Target::plt_section_for_local): Remove.
        (Target::do_plt_address_for_global): New virtual function.
        (Target::do_plt_address_for_global): New virtual function.
        (Target::do_plt_address_for_local): New virtual function.
        (Target::do_plt_address_for_local): New virtual function.
        (Target::do_plt_section_for_global): Remove.
        (Target::do_plt_section_for_global): Remove.
        (Target::do_plt_section_for_local): Remove.
        (Target::do_plt_section_for_local): Remove.
        (Target::register_global_plt_entry): Add Symbol_table and Layout
        (Target::register_global_plt_entry): Add Symbol_table and Layout
        parameters.
        parameters.
        * output.cc (Output_data_got::Got_entry::write): Use
        * output.cc (Output_data_got::Got_entry::write): Use
        plt_address_for_global and plt_address_for_local.
        plt_address_for_global and plt_address_for_local.
        * layout.cc (Layout::add_target_dynamic_tags): Use size and
        * layout.cc (Layout::add_target_dynamic_tags): Use size and
        address of output section.
        address of output section.
        * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
        * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
        got_irelative_, and irelative_count_ fields.  Update
        got_irelative_, and irelative_count_ fields.  Update
        declarations.
        declarations.
        (Output_data_plt_i386::has_irelative_section): New function.
        (Output_data_plt_i386::has_irelative_section): New function.
        (Output_data_plt_i386::entry_count): Add irelative_count_.
        (Output_data_plt_i386::entry_count): Add irelative_count_.
        (Output_data_plt_i386::set_final_data_size): Likewise.
        (Output_data_plt_i386::set_final_data_size): Likewise.
        (class Target_i386): Add got_irelative_ and rel_irelative_
        (class Target_i386): Add got_irelative_ and rel_irelative_
        fields.  Update declarations.
        fields.  Update declarations.
        (Target_i386::Target_i386): Initialize new fields.
        (Target_i386::Target_i386): Initialize new fields.
        (Target_i386::do_plt_address_for_global): New function replacing
        (Target_i386::do_plt_address_for_global): New function replacing
        do_plt_section_for_global.
        do_plt_section_for_global.
        (Target_i386::do_plt_address_for_local): New function replacing
        (Target_i386::do_plt_address_for_local): New function replacing
        do_plt_section_for_local.
        do_plt_section_for_local.
        (Target_i386::got_section): Create got_irelative_.
        (Target_i386::got_section): Create got_irelative_.
        (Target_i386::rel_irelative_section): New function.
        (Target_i386::rel_irelative_section): New function.
        (Output_data_plt_i386::Output_data_plt_i386): Initialize new
        (Output_data_plt_i386::Output_data_plt_i386): Initialize new
        fields.  Don't define __rel_iplt_{start,end}.
        fields.  Don't define __rel_iplt_{start,end}.
        (Output_data_plt_i386::add_entry): Add symtab and layout
        (Output_data_plt_i386::add_entry): Add symtab and layout
        parameters.  Change all callers.  Use different PLT and GOT for
        parameters.  Change all callers.  Use different PLT and GOT for
        IFUNC symbols.
        IFUNC symbols.
        (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
        (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
        layout parameters.  Change all callers.  Use different PLT and
        layout parameters.  Change all callers.  Use different PLT and
        GOT.
        GOT.
        (Output_data_plt_i386::rel_tls_desc): Fix formatting.
        (Output_data_plt_i386::rel_tls_desc): Fix formatting.
        (Output_data_plt_i386::rel_irelative): New function.
        (Output_data_plt_i386::rel_irelative): New function.
        (Output_data_plt_i386::address_for_global): New function.
        (Output_data_plt_i386::address_for_global): New function.
        (Output_data_plt_i386::address_for_local): New function.
        (Output_data_plt_i386::address_for_local): New function.
        (Output_data_plt_i386::do_write): Write out IRELATIVE area.  Use
        (Output_data_plt_i386::do_write): Write out IRELATIVE area.  Use
        IRELATIVE GOT when changing IFUNC GOT entries.
        IRELATIVE GOT when changing IFUNC GOT entries.
        (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
        (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
        reloc.
        reloc.
        (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
        (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
        if we didn't create an IRELATIVE GOT.
        if we didn't create an IRELATIVE GOT.
        (Target_i386::Relocate::relocate): Use plt_address_for_global and
        (Target_i386::Relocate::relocate): Use plt_address_for_global and
        plt_address_for_local.
        plt_address_for_local.
        (Target_i386::do_dynsym_value): Use plt_address_for_global.
        (Target_i386::do_dynsym_value): Use plt_address_for_global.
        * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
        * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
        got_irelative_, and irelative_count_ fields.  Update
        got_irelative_, and irelative_count_ fields.  Update
        declarations.
        declarations.
        (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
        (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
        Initialize new fields.  Remove symtab parameter.  Change all
        Initialize new fields.  Remove symtab parameter.  Change all
        callers.
        callers.
        (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
        (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
        irelative_count_.
        irelative_count_.
        (Output_data_plt_x86_64::has_irelative_section): New function.
        (Output_data_plt_x86_64::has_irelative_section): New function.
        (Output_data_plt_x86_64::entry_count): Add irelative_count_.
        (Output_data_plt_x86_64::entry_count): Add irelative_count_.
        (class Target_x86_64): Add got_irelative_ and rel_irelative_
        (class Target_x86_64): Add got_irelative_ and rel_irelative_
        fields.  Update declarations.
        fields.  Update declarations.
        (Target_x86_64::Target_x86_64): Initialize new fields.
        (Target_x86_64::Target_x86_64): Initialize new fields.
        (Target_x86_64::do_plt_address_for_global): New function replacing
        (Target_x86_64::do_plt_address_for_global): New function replacing
        do_plt_section_for_global.
        do_plt_section_for_global.
        (Target_x86_64::do_plt_address_for_local): New function replacing
        (Target_x86_64::do_plt_address_for_local): New function replacing
        do_plt_section_for_local.
        do_plt_section_for_local.
        (Target_x86_64::got_section): Create got_irelative_.
        (Target_x86_64::got_section): Create got_irelative_.
        (Target_x86_64::rela_irelative_section): New function.
        (Target_x86_64::rela_irelative_section): New function.
        (Output_data_plt_x86_64::init): Remove symtab parameter.  Change
        (Output_data_plt_x86_64::init): Remove symtab parameter.  Change
        all callers.  Don't create __rel_iplt_{start,end}.
        all callers.  Don't create __rel_iplt_{start,end}.
        (Output_data_plt_x86_64::add_entry): Add symtab and layout
        (Output_data_plt_x86_64::add_entry): Add symtab and layout
        parameters.  Change all callers.  Use different PLT and GOT for
        parameters.  Change all callers.  Use different PLT and GOT for
        IFUNC symbols.
        IFUNC symbols.
        (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
        (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
        layout parameters.  Change all callers.  Use different PLT and
        layout parameters.  Change all callers.  Use different PLT and
        GOT.
        GOT.
        (Output_data_plt_x86_64::add_relocation): Add symtab and layout
        (Output_data_plt_x86_64::add_relocation): Add symtab and layout
        parameters.  Change all callers.  Use different PLT and GOT for
        parameters.  Change all callers.  Use different PLT and GOT for
        IFUNC symbols.
        IFUNC symbols.
        (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
        (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
        (Output_data_plt_x86_64::rela_irelative): New function.
        (Output_data_plt_x86_64::rela_irelative): New function.
        (Output_data_plt_x86_64::address_for_global): New function.
        (Output_data_plt_x86_64::address_for_global): New function.
        (Output_data_plt_x86_64::address_for_local): New function.
        (Output_data_plt_x86_64::address_for_local): New function.
        (Output_data_plt_x86_64::set_final_data_size): Likewise.
        (Output_data_plt_x86_64::set_final_data_size): Likewise.
        (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
        (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
        (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
        (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
        (Target_x86_64::register_global_plt_entry): Add symtab and layout
        (Target_x86_64::register_global_plt_entry): Add symtab and layout
        parameters.
        parameters.
        (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
        (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
        reloc.
        reloc.
        (Target_x86_64::do_finalize_sections): Create the __rela_iplt
        (Target_x86_64::do_finalize_sections): Create the __rela_iplt
        symbols if we didn't create an IRELATIVE GOT.
        symbols if we didn't create an IRELATIVE GOT.
        (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
        (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
        plt_address_for_local.
        plt_address_for_local.
        (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
        (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
        * testsuite/ifuncvar1.c: New test file.
        * testsuite/ifuncvar1.c: New test file.
        * testsuite/ifuncvar2.c: New test file.
        * testsuite/ifuncvar2.c: New test file.
        * testsuite/ifuncvar3.c: New test file.
        * testsuite/ifuncvar3.c: New test file.
        * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
        * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
        (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
        (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
        (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
        (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
        (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
        (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-07-07  Cary Coutant  
2011-07-07  Cary Coutant  
        * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
        * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
        (two_file_test_1_ndebug.o): Likewise.
        (two_file_test_1_ndebug.o): Likewise.
        (two_file_test_1b_ndebug.o): Likewise.
        (two_file_test_1b_ndebug.o): Likewise.
        (two_file_test_2_ndebug.o): Likewise.
        (two_file_test_2_ndebug.o): Likewise.
        (two_file_test_main_ndebug.o): Likewise.
        (two_file_test_main_ndebug.o): Likewise.
        (incremental_test_2): Link with no-debug versions.
        (incremental_test_2): Link with no-debug versions.
2011-07-06  Cary Coutant  
2011-07-06  Cary Coutant  
        * gold/incremental.cc
        * gold/incremental.cc
        (Output_section_incremental_inputs::write_info_blocks): Check for
        (Output_section_incremental_inputs::write_info_blocks): Check for
        hidden and internal symbols.
        hidden and internal symbols.
2011-07-06  Cary Coutant  
2011-07-06  Cary Coutant  
        * incremental.cc (Sized_incremental_binary::do_file_has_changed):
        * incremental.cc (Sized_incremental_binary::do_file_has_changed):
        Check disposition for startup file.
        Check disposition for startup file.
        (Incremental_inputs::report_command_line): Ignore
        (Incremental_inputs::report_command_line): Ignore
        --incremental-startup-unchanged option.
        --incremental-startup-unchanged option.
        * options.cc (General_options::parse_incremental_startup_unchanged):
        * options.cc (General_options::parse_incremental_startup_unchanged):
        New function.
        New function.
        (General_options::General_options): Initialize new data member.
        (General_options::General_options): Initialize new data member.
        * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
        * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
        (General_options): Add --incremental-startup-unchanged option.
        (General_options): Add --incremental-startup-unchanged option.
        (General_options::incremental_startup_disposition): New function.
        (General_options::incremental_startup_disposition): New function.
        (General_options::incremental_startup_disposition_): New data member.
        (General_options::incremental_startup_disposition_): New data member.
2011-07-06  Cary Coutant  
2011-07-06  Cary Coutant  
        * incremental.cc (Sized_incremental_binary::setup_readers): Pass
        * incremental.cc (Sized_incremental_binary::setup_readers): Pass
        input file index to Script_info ctor.
        input file index to Script_info ctor.
        (Sized_incremental_binary::do_file_has_changed): Find the
        (Sized_incremental_binary::do_file_has_changed): Find the
        command-line argument for files named in scripts.
        command-line argument for files named in scripts.
        * incremental.h (Script_info::Script_info): New ctor
        * incremental.h (Script_info::Script_info): New ctor
        with input file index.
        with input file index.
        (Script_info::input_file_index): New function.
        (Script_info::input_file_index): New function.
        (Script_info::input_file_index_): New data member.
        (Script_info::input_file_index_): New data member.
        (Incremental_binary::get_library): Add const.
        (Incremental_binary::get_library): Add const.
        (Incremental_binary::get_script_info): Add const.
        (Incremental_binary::get_script_info): Add const.
        * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
        * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
        * testsuite/Makefile.am (incremental_test_5): New test case.
        * testsuite/Makefile.am (incremental_test_5): New test case.
        (incremental_test_6): New test case.
        (incremental_test_6): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-07-06  Cary Coutant  
2011-07-06  Cary Coutant  
        * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
        * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
        debug output when command lines differ.
        debug output when command lines differ.
2011-07-06  Cary Coutant  
2011-07-06  Cary Coutant  
        * incremental.cc (Incremental_inputs::report_command_line): Ignore
        * incremental.cc (Incremental_inputs::report_command_line): Ignore
        --incremental-patch option.
        --incremental-patch option.
        * layout.cc (Free_list::allocate): Extend allocation beyond original
        * layout.cc (Free_list::allocate): Extend allocation beyond original
        end if enabled.
        end if enabled.
        (Layout::make_output_section): Mark sections that should get
        (Layout::make_output_section): Mark sections that should get
        patch space.
        patch space.
        * options.cc (parse_percent): New function.
        * options.cc (parse_percent): New function.
        * options.h (parse_percent): New function.
        * options.h (parse_percent): New function.
        (DEFINE_percent): New macro.
        (DEFINE_percent): New macro.
        (General_options): Add --incremental-patch option.
        (General_options): Add --incremental-patch option.
        * output.cc (Output_section::Output_section): Initialize new data
        * output.cc (Output_section::Output_section): Initialize new data
        members.
        members.
        (Output_section::add_input_section): Print section name when out
        (Output_section::add_input_section): Print section name when out
        of patch space.
        of patch space.
        (Output_section::add_output_section_data): Likewise.
        (Output_section::add_output_section_data): Likewise.
        (Output_section::set_final_data_size): Add patch space when
        (Output_section::set_final_data_size): Add patch space when
        doing --incremental-full.
        doing --incremental-full.
        (Output_section::do_reset_address_and_file_offset): Remove patch
        (Output_section::do_reset_address_and_file_offset): Remove patch
        space.
        space.
        (Output_segment::set_section_list_addresses): Print debug output
        (Output_segment::set_section_list_addresses): Print debug output
        only if --incremental-update.
        only if --incremental-update.
        * output.h (Output_section::set_is_patch_space_allowed): New function.
        * output.h (Output_section::set_is_patch_space_allowed): New function.
        (Output_section::is_patch_space_allowed_): New data member.
        (Output_section::is_patch_space_allowed_): New data member.
        (Output_section::patch_space_): New data member.
        (Output_section::patch_space_): New data member.
        * parameters.cc (Parameters::incremental_full): New function.
        * parameters.cc (Parameters::incremental_full): New function.
        * parameters.h (Parameters::incremental_full): New function
        * parameters.h (Parameters::incremental_full): New function
        * testsuite/Makefile.am (incremental_test_2): Add test for
        * testsuite/Makefile.am (incremental_test_2): Add test for
        --incremental-patch option.
        --incremental-patch option.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
        * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
        (t18): Remove function body.
        (t18): Remove function body.
2011-07-05  Doug Kwan  
2011-07-05  Doug Kwan  
        PR gold/12771
        PR gold/12771
        * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
        * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
        Arm_Address type for relocation result.
        Arm_Address type for relocation result.
        (Arm_relocate_functions::abs16): Use unaligned access.  Also fix
        (Arm_relocate_functions::abs16): Use unaligned access.  Also fix
        overflow check.
        overflow check.
        (Arm_relocate_functions::abs32): Use unaligned access.
        (Arm_relocate_functions::abs32): Use unaligned access.
        (Arm_relocate_functions::rel32): Ditto.
        (Arm_relocate_functions::rel32): Ditto.
        (Arm_relocate_functions::prel31): Ditto.
        (Arm_relocate_functions::prel31): Ditto.
        (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
        (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
        * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
        * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
        static data relocations.
        static data relocations.
        * testsuite/Makefile.in: Regnerate.
        * testsuite/Makefile.in: Regnerate.
        * testsuite/arm_unaligned_reloc.{s,sh}: New files.
        * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2011-07-05  Ian Lance Taylor  
2011-07-05  Ian Lance Taylor  
        PR gold/12392
        PR gold/12392
        * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
        * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
        symbols if necessary.
        symbols if necessary.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2011-07-05  Ian Lance Taylor  
2011-07-05  Ian Lance Taylor  
        PR gold/12952
        PR gold/12952
        * resolve.cc (Symbol::override_base_with_special): Simply override
        * resolve.cc (Symbol::override_base_with_special): Simply override
        version with special symbol version, ignoring previous version.
        version with special symbol version, ignoring previous version.
2011-07-05  Ian Lance Taylor  
2011-07-05  Ian Lance Taylor  
        * object.cc (Sized_relobj_file::include_section_group): Add
        * object.cc (Sized_relobj_file::include_section_group): Add
        information to comment about signature location.
        information to comment about signature location.
2011-07-02  Ian Lance Taylor  
2011-07-02  Ian Lance Taylor  
        PR gold/12957
        PR gold/12957
        * options.h (class General_options): Add -f and -F.
        * options.h (class General_options): Add -f and -F.
        * options.cc (General_options::finalize): Fatal error if -f/-F
        * options.cc (General_options::finalize): Fatal error if -f/-F
        are used without -shared.
        are used without -shared.
        * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
        * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2011-07-02  Ian Lance Taylor  
2011-07-02  Ian Lance Taylor  
        * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
        * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2011-07-01  Ian Lance Taylor  
2011-07-01  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        PR gold/12952
        PR gold/12952
        * resolve.cc (Symbol::override_base_with_special): Don't override
        * resolve.cc (Symbol::override_base_with_special): Don't override
        the version if the overriding symbol has a different name.
        the version if the overriding symbol has a different name.
        * dynobj.cc (Versions::add_def): Add dynpool parameter.  Change
        * dynobj.cc (Versions::add_def): Add dynpool parameter.  Change
        all callers.  If we give an error about an undefined version,
        all callers.  If we give an error about an undefined version,
        define the base version if necessary.
        define the base version if necessary.
        * dynobj.h (class Versions): Update declaration.
        * dynobj.h (class Versions): Update declaration.
        * testsuite/weak_alias_test_5.cc: New file.
        * testsuite/weak_alias_test_5.cc: New file.
        * testsuite/weak_alias_test.script: New file.
        * testsuite/weak_alias_test.script: New file.
        * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
        * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
        and versioned_alias have the right value, and call t2.
        and versioned_alias have the right value, and call t2.
        * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
        * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
        weak_alias_test_5.so.
        weak_alias_test_5.so.
        (weak_alias_test_LDADD): Likewise.
        (weak_alias_test_LDADD): Likewise.
        (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
        (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-07-01  Ian Lance Taylor  
2011-07-01  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        * options.h (class General_options): Support -z notext.
        * options.h (class General_options): Support -z notext.
        * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
        * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
        -Wl,-z,notext.
        -Wl,-z,notext.
        (two_file_shared_nonpic.so): Likewise.
        (two_file_shared_nonpic.so): Likewise.
        (two_file_shared_mixed.so): Likewise.
        (two_file_shared_mixed.so): Likewise.
        (two_file_shared_mixed_1.so): Likewise.
        (two_file_shared_mixed_1.so): Likewise.
        (weak_undef_lib_nonpic.so): Likewise.
        (weak_undef_lib_nonpic.so): Likewise.
        (alt/weak_undef_lib_nonpic.so): Likewise.
        (alt/weak_undef_lib_nonpic.so): Likewise.
        (tls_test_shared_nonpic.so): Likewise.
        (tls_test_shared_nonpic.so): Likewise.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-07-01  Ian Lance Taylor  
2011-07-01  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        * configure.ac: Test whether static linking works, setting
        * configure.ac: Test whether static linking works, setting
        the automake conditional HAVE_STATIC.
        the automake conditional HAVE_STATIC.
        * testsuite/Makefile.am: Disable tests using -static if
        * testsuite/Makefile.am: Disable tests using -static if
        HAVE_STATIC is not true.
        HAVE_STATIC is not true.
        * configure, testsuite/Makefile.in: Rebuild.
        * configure, testsuite/Makefile.in: Rebuild.
2011-07-01  Ian Lance Taylor  
2011-07-01  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
        * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
        Assert if we see DW_EH_PE_indirect.
        Assert if we see DW_EH_PE_indirect.
        * target.h (Target::ehframe_datarel_base): New function.
        * target.h (Target::ehframe_datarel_base): New function.
        (Target::do_ehframe_datarel_base): New target function.
        (Target::do_ehframe_datarel_base): New target function.
        * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
        * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
        * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
        * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
        function.
        function.
2011-07-01  Ian Lance Taylor  
2011-07-01  Ian Lance Taylor  
        PR gold/12571
        PR gold/12571
        * options.h (class General_options): Add
        * options.h (class General_options): Add
        --ld-generated-unwind-info.
        --ld-generated-unwind-info.
        * ehframe.cc (Fde::write): Add address parameter.  Change all
        * ehframe.cc (Fde::write): Add address parameter.  Change all
        callers.  If associated with PLT, fill in address and size.
        callers.  If associated with PLT, fill in address and size.
        (Cie::set_output_offset): Only add merge mapping if there is an
        (Cie::set_output_offset): Only add merge mapping if there is an
        object.
        object.
        (Cie::write): Add address parameter.  Change all callers.
        (Cie::write): Add address parameter.  Change all callers.
        (Eh_frame::add_ehframe_for_plt): New function.
        (Eh_frame::add_ehframe_for_plt): New function.
        * ehframe.h (class Fde): Update declarations.  Move shndx_ and
        * ehframe.h (class Fde): Update declarations.  Move shndx_ and
        input_offset_ fields into union u_, with new plt field.
        input_offset_ fields into union u_, with new plt field.
        (Fde::Fde): Adjust for new union field.
        (Fde::Fde): Adjust for new union field.
        (Fde::Fde) [Output_data version]: New constructor.
        (Fde::Fde) [Output_data version]: New constructor.
        (Fde::add_mapping): Only add merge mapping if there is an object.
        (Fde::add_mapping): Only add merge mapping if there is an object.
        (class Cie): Update declarations.
        (class Cie): Update declarations.
        (class Eh_frame): Declare add_ehframe_for_plt.
        (class Eh_frame): Declare add_ehframe_for_plt.
        * layout.cc (Layout::layout_eh_frame): Break out code into
        * layout.cc (Layout::layout_eh_frame): Break out code into
        make_eh_frame_section, and call it.
        make_eh_frame_section, and call it.
        (Layout::make_eh_frame_section): New function.
        (Layout::make_eh_frame_section): New function.
        (Layout::add_eh_frame_for_plt): New function.
        (Layout::add_eh_frame_for_plt): New function.
        * layout.h (class Layout): Update declarations.
        * layout.h (class Layout): Update declarations.
        * merge.cc (Merge_map::add_mapping): Add assertion.
        * merge.cc (Merge_map::add_mapping): Add assertion.
        * i386.cc: Include "dwarf.h".
        * i386.cc: Include "dwarf.h".
        (class Output_data_plt_i386): Make first_plt_entry,
        (class Output_data_plt_i386): Make first_plt_entry,
        dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const.  Add
        dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const.  Add
        plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
        plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
        and plt_eh_frame_fde.
        and plt_eh_frame_fde.
        (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
        (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
        boundary.  Call add_eh_frame_for_plt if appropriate.
        boundary.  Call add_eh_frame_for_plt if appropriate.
        * x86_64.cc: Include "dwarf.h".
        * x86_64.cc: Include "dwarf.h".
        (class Output_data_plt_x86_64): Align to 16-byte boundary.  Make
        (class Output_data_plt_x86_64): Align to 16-byte boundary.  Make
        first_plt_entry, plt_entry and tlsdesc_plt_entry const.  Add
        first_plt_entry, plt_entry and tlsdesc_plt_entry const.  Add
        plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
        plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
        and plt_eh_frame_fde.
        and plt_eh_frame_fde.
        (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
        (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
        appropriate.
        appropriate.
2011-06-29  Ian Lance Taylor  
2011-06-29  Ian Lance Taylor  
        PR gold/12629
        PR gold/12629
        * object.cc (Sized_relobj_file::layout_section): Change shdr
        * object.cc (Sized_relobj_file::layout_section): Change shdr
        parameter to be const.
        parameter to be const.
        (Sized_relobj_file::layout_eh_frame_section): New function, broken
        (Sized_relobj_file::layout_eh_frame_section): New function, broken
        out of do_layout.
        out of do_layout.
        (Sized_relobj_file::do_layout): Defer .eh_frame sections if
        (Sized_relobj_file::do_layout): Defer .eh_frame sections if
        appropriate.  Call layout_eh_frame_section.
        appropriate.  Call layout_eh_frame_section.
        (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
        (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
        sections.
        sections.
        * object.h (class Sized_relobj_file): Update declarations.
        * object.h (class Sized_relobj_file): Update declarations.
2011-06-29  Ian Lance Taylor  
2011-06-29  Ian Lance Taylor  
        PR gold/12652
        PR gold/12652
        * script.cc (Token::integer_value): Accept trailing M/m/K/k
        * script.cc (Token::integer_value): Accept trailing M/m/K/k
        modifier.
        modifier.
        (Lex::gather_token): Accept trailing M/m/K/k for integers.
        (Lex::gather_token): Accept trailing M/m/K/k for integers.
2011-06-29  Ian Lance Taylor  
2011-06-29  Ian Lance Taylor  
        PR gold/12675
        PR gold/12675
        * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
        * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
        SHT_X86_64_UNWIND.
        SHT_X86_64_UNWIND.
        * layout.cc (Layout::layout_eh_frame): Likewise.
        * layout.cc (Layout::layout_eh_frame): Likewise.
2011-06-29  Ian Lance Taylor  
2011-06-29  Ian Lance Taylor  
        PR gold/12695
        PR gold/12695
        * layout.cc (Layout::symtab_section_shndx): New function.
        * layout.cc (Layout::symtab_section_shndx): New function.
        * layout.h (class Layout): Declare symtab_section_shndx.
        * layout.h (class Layout): Declare symtab_section_shndx.
        * output.cc (Output_section::write_header): Call it.
        * output.cc (Output_section::write_header): Call it.
2011-06-29  Ian Lance Taylor  
2011-06-29  Ian Lance Taylor  
        PR gold/12818
        PR gold/12818
        * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
        * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
        symbols which are not used in a relocation.
        symbols which are not used in a relocation.
2011-06-28  Ian Lance Taylor  
2011-06-28  Ian Lance Taylor  
        PR gold/12898
        PR gold/12898
        * layout.cc (Layout::segment_precedes): Don't crash if a linker
        * layout.cc (Layout::segment_precedes): Don't crash if a linker
        script create indistinguishable segments.
        script create indistinguishable segments.
        (Layout::set_segment_offsets): Use stable_sort when sorting
        (Layout::set_segment_offsets): Use stable_sort when sorting
        segments.  Pass this to Compare_segments constructor.
        segments.  Pass this to Compare_segments constructor.
        * layout.h (class Layout): Make segment_precedes non-static.
        * layout.h (class Layout): Make segment_precedes non-static.
        (class Compare_segments): Change from struct to class.  Add
        (class Compare_segments): Change from struct to class.  Add
        layout_ field.  Add constructor.
        layout_ field.  Add constructor.
        * script-sections.cc
        * script-sections.cc
        (Script_sections::attach_sections_using_phdrs_clause): Rename
        (Script_sections::attach_sections_using_phdrs_clause): Rename
        local orphan to is_orphan.  Don't report failure to put empty
        local orphan to is_orphan.  Don't report failure to put empty
        section in segment.  On attachment failure, report name of
        section in segment.  On attachment failure, report name of
        section, and attach to first PT_LOAD segment.
        section, and attach to first PT_LOAD segment.
2011-06-28  Ian Lance Taylor  
2011-06-28  Ian Lance Taylor  
        PR gold/12934
        PR gold/12934
        * target-select.cc (Target_selector::Target_selector): Add
        * target-select.cc (Target_selector::Target_selector): Add
        emulation parameter.  Change all callers.
        emulation parameter.  Change all callers.
        (select_target_by_bfd_name): Rename from select_target_by_name.
        (select_target_by_bfd_name): Rename from select_target_by_name.
        Change all callers.
        Change all callers.
        (select_target_by_emulation): New function.
        (select_target_by_emulation): New function.
        (supported_emulation_names): New function.
        (supported_emulation_names): New function.
        * target-select.h (class Target_selector): Add emulation_ field.
        * target-select.h (class Target_selector): Add emulation_ field.
        Update declarations.
        Update declarations.
        (Target_selector::recognize_by_bfd_name): Rename from
        (Target_selector::recognize_by_bfd_name): Rename from
        recognize_by_name.  Change all callers.
        recognize_by_name.  Change all callers.
        (Target_selector::supported_bfd_names): Rename from
        (Target_selector::supported_bfd_names): Rename from
        supported_names.  Change all callers.
        supported_names.  Change all callers.
        (Target_selector::recognize_by_emulation): New function.
        (Target_selector::recognize_by_emulation): New function.
        (Target_selector::supported_emulations): New function.
        (Target_selector::supported_emulations): New function.
        (Target_selector::emulation): New function.
        (Target_selector::emulation): New function.
        (Target_selector::do_recognize_by_bfd_name): Rename from
        (Target_selector::do_recognize_by_bfd_name): Rename from
        do_recognize_by_name.  Change all callers.
        do_recognize_by_name.  Change all callers.
        (Target_selector::do_supported_bfd_names): Rename from
        (Target_selector::do_supported_bfd_names): Rename from
        do_supported_names.  Change all callers.
        do_supported_names.  Change all callers.
        (Target_selector::do_recognize_by_emulation): New function.
        (Target_selector::do_recognize_by_emulation): New function.
        (Target_selector::do_supported_emulations): New function.
        (Target_selector::do_supported_emulations): New function.
        (select_target_by_bfd_name): Change name in declaration.
        (select_target_by_bfd_name): Change name in declaration.
        (select_target_by_emulation): Declare.
        (select_target_by_emulation): Declare.
        (supported_emulation_names): Declare.
        (supported_emulation_names): Declare.
        * parameters.cc (parameters_force_valid_target): Try to find
        * parameters.cc (parameters_force_valid_target): Try to find
        target based on emulation from -m option.
        target based on emulation from -m option.
        * options.h (class General_options): Change doc string for -m.
        * options.h (class General_options): Change doc string for -m.
        * options.cc (help): Print emulations.
        * options.cc (help): Print emulations.
        (General_options::parse_V): Likewise.
        (General_options::parse_V): Likewise.
        * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
        * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
        Add emulation parameter.  Change all callers.
        Add emulation parameter.  Change all callers.
2011-06-28  Ian Lance Taylor  
2011-06-28  Ian Lance Taylor  
        * target.h (class Target): Add osabi_ field.
        * target.h (class Target): Add osabi_ field.
        (Target::osabi): New function.
        (Target::osabi): New function.
        (Target::set_osabi): New function.
        (Target::set_osabi): New function.
        (Target::Target): Initialize osabi_.
        (Target::Target): Initialize osabi_.
        (Target::do_adjust_elf_header): Make pure virtual.
        (Target::do_adjust_elf_header): Make pure virtual.
        (Sized_target::do_adjust_elf_header): Declare.
        (Sized_target::do_adjust_elf_header): Declare.
        * target.cc (Sized_target::do_adjust_elf_header): New function.
        * target.cc (Sized_target::do_adjust_elf_header): New function.
        (class Sized_target): Instantiate all versions.
        (class Sized_target): Instantiate all versions.
        * freebsd.h (class Target_freebsd): Remove.
        * freebsd.h (class Target_freebsd): Remove.
        (Target_selector_freebsd::do_recognize): Call set_osabi on
        (Target_selector_freebsd::do_recognize): Call set_osabi on
        Target.
        Target.
        (Target_selector_freebsd::do_recognize_by_name): Likewise.
        (Target_selector_freebsd::do_recognize_by_name): Likewise.
        (Target_selector_freebsd::set_osabi): Remove.
        (Target_selector_freebsd::set_osabi): Remove.
        * i386.cc (class Target_i386): Inherit from Sized_target rather
        * i386.cc (class Target_i386): Inherit from Sized_target rather
        than Target_freebsd.
        than Target_freebsd.
        * x86_64.cc (class Target_x86_64): Likewise.
        * x86_64.cc (class Target_x86_64): Likewise.
2011-06-28  Ian Lance Taylor  
2011-06-28  Ian Lance Taylor  
        * target.h (Target::can_check_for_function_pointers): Rewrite.
        * target.h (Target::can_check_for_function_pointers): Rewrite.
        Make non-virtual.
        Make non-virtual.
        (Target::can_icf_inline_merge_sections): Likewise.
        (Target::can_icf_inline_merge_sections): Likewise.
        (Target::section_may_have_icf_unsafe_poineters): Likewise.
        (Target::section_may_have_icf_unsafe_poineters): Likewise.
        (Target::Target_info): Add can_icf_inline_merge_sections field.
        (Target::Target_info): Add can_icf_inline_merge_sections field.
        (Target::do_can_check_for_function_pointers): New virtual
        (Target::do_can_check_for_function_pointers): New virtual
        function.
        function.
        (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
        (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
        * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
        * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
        from can_check_for_function_pointers, move in file.
        from can_check_for_function_pointers, move in file.
        (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
        (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
        section_may_have_icf_unsafe_poineters, move in file.
        section_may_have_icf_unsafe_poineters, move in file.
        (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
        (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
        * i386.cc (Target_i386::do_can_check_for_function_pointers):
        * i386.cc (Target_i386::do_can_check_for_function_pointers):
        Rename from can_check_for_function_pointers, move in file.
        Rename from can_check_for_function_pointers, move in file.
        (Target_i386::can_icf_inline_merge_sections): Remove.
        (Target_i386::can_icf_inline_merge_sections): Remove.
        (Target_i386::i386_info): Initialize
        (Target_i386::i386_info): Initialize
        can_icf_inline_merge_sections.
        can_icf_inline_merge_sections.
        * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
        * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
        Initialize can_icf_inline_merge_sections.
        Initialize can_icf_inline_merge_sections.
        * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
        * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
        * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
        * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
        Rename from can_check_for_function_pointers, move in file.
        Rename from can_check_for_function_pointers, move in file.
        (Target_x86_64::can_icf_inline_merge_sections): Remove.
        (Target_x86_64::can_icf_inline_merge_sections): Remove.
        (Target_x86_64::x86_64_info): Initialize
        (Target_x86_64::x86_64_info): Initialize
        can_icf_inline_merge_sections.
        can_icf_inline_merge_sections.
        * testsuite/testfile.cc (Target_test::test_target_info):
        * testsuite/testfile.cc (Target_test::test_target_info):
        Likewise.
        Likewise.
        * icf.cc (get_section_contents): Correct formatting.
        * icf.cc (get_section_contents): Correct formatting.
2011-06-27  Ian Lance Taylor  
2011-06-27  Ian Lance Taylor  
        * symtab.cc (Symbol::versioned_name): New function.
        * symtab.cc (Symbol::versioned_name): New function.
        (Symbol_table::add_to_final_symtab): Use versioned_name when
        (Symbol_table::add_to_final_symtab): Use versioned_name when
        appropriate.
        appropriate.
        (Symbol_table::sized_write_symbol): Likewise.
        (Symbol_table::sized_write_symbol): Likewise.
        * symtab.h (class Symbol): Declare versioned_name.
        * symtab.h (class Symbol): Declare versioned_name.
        * stringpool.h (class Stringpool_template): Add variant of add
        * stringpool.h (class Stringpool_template): Add variant of add
        which takes a std::basic_string.
        which takes a std::basic_string.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
        (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
        (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
        (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
        (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
        (ver_test_12.o): New target.
        (ver_test_12.o): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-06-27  Doug Kwan  
2011-06-27  Doug Kwan  
        * arm.cc (Arm_relocate_functions::thm_jump8,
        * arm.cc (Arm_relocate_functions::thm_jump8,
        Arm_relocate_functions::thm_jump11): Use a wider signed
        Arm_relocate_functions::thm_jump11): Use a wider signed
        type to compute offset.
        type to compute offset.
        * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
        * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
        arm_thm_jump8.
        arm_thm_jump8.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_branch_in_range.sh: Check test results of
        * testsuite/arm_branch_in_range.sh: Check test results of
        arm_thm_jump11 and arm_thm_jump8.
        arm_thm_jump11 and arm_thm_jump8.
        * testsuite/arm_thm_jump11.s: New test source file.
        * testsuite/arm_thm_jump11.s: New test source file.
        * testsuite/arm_thm_jump11.t: New linker script.
        * testsuite/arm_thm_jump11.t: New linker script.
        * testsuite/arm_thm_jump8.s: New test source file.
        * testsuite/arm_thm_jump8.s: New test source file.
        * testsuite/arm_thm_jump8.t: New linker script.
        * testsuite/arm_thm_jump8.t: New linker script.
2011-06-24  Ian Lance Taylor  
2011-06-24  Ian Lance Taylor  
        * layout.cc: Include "object.h".
        * layout.cc: Include "object.h".
        (ctors_sections_in_init_array): New static variable.
        (ctors_sections_in_init_array): New static variable.
        (Layout::is_ctors_in_init_array): New function.
        (Layout::is_ctors_in_init_array): New function.
        (Layout::layout): Add entry to ctors_sections_in_init_array if
        (Layout::layout): Add entry to ctors_sections_in_init_array if
        appropriate.
        appropriate.
        * layout.h (class Layout): Declare is_ctors_in_init_array.
        * layout.h (class Layout): Declare is_ctors_in_init_array.
        * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
        * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
        is_ctors_reverse_view is set.
        is_ctors_reverse_view is set.
        (Sized_relobj_file::write_sections): Add layout parameter.  Change
        (Sized_relobj_file::write_sections): Add layout parameter.  Change
        all callers.  Set is_ctors_reverse_view field of View_size.
        all callers.  Set is_ctors_reverse_view field of View_size.
        (Sized_relobj_file::reverse_words): New function.
        (Sized_relobj_file::reverse_words): New function.
        * object.h (Sized_relobj_file::View_size): Add
        * object.h (Sized_relobj_file::View_size): Add
        is_ctors_reverse_view field.
        is_ctors_reverse_view field.
        (class Sized_relobj_file): Update declarations.
        (class Sized_relobj_file): Update declarations.
        * testsuite/initpri3.c: New test.
        * testsuite/initpri3.c: New test.
        * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
        * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
        initpri3b.
        initpri3b.
        (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
        (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
        (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
        (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
        (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
        (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
        (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
        (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-06-24  Cary Coutant  
2011-06-24  Cary Coutant  
        * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
        * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
        (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
        (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
        (debug_msg_cdebug.err): New targets.
        (debug_msg_cdebug.err): New targets.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/debug_msg.sh: Check output of link with compressed debug.
        * testsuite/debug_msg.sh: Check output of link with compressed debug.
        Fix checks for link with shared library.
        Fix checks for link with shared library.
2011-06-24  Doug Kwan  
2011-06-24  Doug Kwan  
        * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
        * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
        skip empty text sections.
        skip empty text sections.
        * testsuite/arm_exidx_test.s: Test handling of an empty text section.
        * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2011-06-22  Ian Lance Taylor  
2011-06-22  Ian Lance Taylor  
        PR gold/12910
        PR gold/12910
        * options.h (class General_options): Add --ctors-in-init-array.
        * options.h (class General_options): Add --ctors-in-init-array.
        * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
        * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
        friends as SHT_PROGBITS for merging sections.
        friends as SHT_PROGBITS for merging sections.
        (Layout::layout): Remove special handling of .init_array and
        (Layout::layout): Remove special handling of .init_array and
        friends.  Don't sort if doing relocatable link.  Sort for .ctors
        friends.  Don't sort if doing relocatable link.  Sort for .ctors
        and .dtors if ctors_in_init_array.
        and .dtors if ctors_in_init_array.
        (Layout::make_output_section): Force correct section types for
        (Layout::make_output_section): Force correct section types for
        .init_array and friends.  Don't sort if doing relocatable link,
        .init_array and friends.  Don't sort if doing relocatable link,
        Don't sort .ctors and .dtors if ctors_in_init_array.
        Don't sort .ctors and .dtors if ctors_in_init_array.
        (Layout::section_name_mapping): Remove .ctors. and .dtorso.
        (Layout::section_name_mapping): Remove .ctors. and .dtorso.
        (Layout::output_section_name): Add relobj parameter.  Change all
        (Layout::output_section_name): Add relobj parameter.  Change all
        callers.  Handle .ctors. and .dtors. in code rather than table.
        callers.  Handle .ctors. and .dtors. in code rather than table.
        Handle .ctors and .dtors if ctors_in_init_array.
        Handle .ctors and .dtors if ctors_in_init_array.
        (Layout::match_file_name): New function, moved from output.cc.
        (Layout::match_file_name): New function, moved from output.cc.
        * layout.h (class Layout): Update declarations.
        * layout.h (class Layout): Update declarations.
        * output.cc: Include "layout.h".
        * output.cc: Include "layout.h".
        (Input_section_sort_entry::get_priority): New function.
        (Input_section_sort_entry::get_priority): New function.
        (Input_section_sort_entry::match_file_name): Just call
        (Input_section_sort_entry::match_file_name): Just call
        Layout::match_file_name.
        Layout::match_file_name.
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        Handle .ctors and .dtors.  Sort by explicit priority rather than
        Handle .ctors and .dtors.  Sort by explicit priority rather than
        by name.
        by name.
        * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
        * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
        * testsuite/initpri2.c: New test.
        * testsuite/initpri2.c: New test.
        * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
        * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
        (check_PROGRAMS): Add initpri2.
        (check_PROGRAMS): Add initpri2.
        (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
        (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
        (initpri2_LDFLAGS, initpri2_LDADD): New variables.
        (initpri2_LDFLAGS, initpri2_LDADD): New variables.
        * configure, testsuite/Makefile.in: Rebuild.
        * configure, testsuite/Makefile.in: Rebuild.
2011-06-19  Ian Lance Taylor  
2011-06-19  Ian Lance Taylor  
        PR gold/12880
        PR gold/12880
        * layout.cc (Layout::attach_allocated_section_to_segment): Add a
        * layout.cc (Layout::attach_allocated_section_to_segment): Add a
        .interp section to a PT_INTERP segment even if we have seen a
        .interp section to a PT_INTERP segment even if we have seen a
        --dynamic-linker option.  Don't do it if we have seen a PHDRS
        --dynamic-linker option.  Don't do it if we have seen a PHDRS
        clause in a linker script.
        clause in a linker script.
        (Layout::finalize): Don't create a .interp section if we've
        (Layout::finalize): Don't create a .interp section if we've
        already create a PT_INTERP segment.
        already create a PT_INTERP segment.
        (Layout::create_interp): Always call choose_output_section (revert
        (Layout::create_interp): Always call choose_output_section (revert
        patch of 2011-06-17).  Don't create PT_INTERP segment.
        patch of 2011-06-17).  Don't create PT_INTERP segment.
        * script-sections.cc
        * script-sections.cc
        (Script_sections::create_note_and_tls_segments): Add a .interp
        (Script_sections::create_note_and_tls_segments): Add a .interp
        section to a PT_INTERP segment even if we have seen a
        section to a PT_INTERP segment even if we have seen a
        --dynamic-linker option.
        --dynamic-linker option.
2011-06-18  Ian Lance Taylor  
2011-06-18  Ian Lance Taylor  
        * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
        * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
        merely because a non-PT_LOAD segment has a dynamic reloc.
        merely because a non-PT_LOAD segment has a dynamic reloc.
2011-06-18  Ian Lance Taylor  
2011-06-18  Ian Lance Taylor  
        * layout.cc (Layout::finish_dynamic_section): Don't create
        * layout.cc (Layout::finish_dynamic_section): Don't create
        DT_FLAGS entry if not needed.
        DT_FLAGS entry if not needed.
2011-06-18  Ian Lance Taylor  
2011-06-18  Ian Lance Taylor  
        PR gold/12745
        PR gold/12745
        * layout.cc (Layout::layout_eh_frame): Correct handling of
        * layout.cc (Layout::layout_eh_frame): Correct handling of
        writable .eh_frame section.
        writable .eh_frame section.
2011-06-17  Ian Lance Taylor  
2011-06-17  Ian Lance Taylor  
        PR gold/12893
        PR gold/12893
        * resolve.cc (Symbol_table::resolve): Don't give an error if a
        * resolve.cc (Symbol_table::resolve): Don't give an error if a
        symbol is redefined with the exact same object and value.
        symbol is redefined with the exact same object and value.
2011-06-17  Ian Lance Taylor  
2011-06-17  Ian Lance Taylor  
        PR gold/12880
        PR gold/12880
        * layout.h (class Layout): Add interp_segment_ field.
        * layout.h (class Layout): Add interp_segment_ field.
        * layout.cc (Layout::Layout): Initialize interp_segment_ field.
        * layout.cc (Layout::Layout): Initialize interp_segment_ field.
        (Layout::attach_allocated_section_to_segment): If making shared
        (Layout::attach_allocated_section_to_segment): If making shared
        library, put .interp section in PT_INTERP segment.
        library, put .interp section in PT_INTERP segment.
        (Layout::finalize): Also call create_interp if -dynamic-linker
        (Layout::finalize): Also call create_interp if -dynamic-linker
        option was used.
        option was used.
        (Layout::create_interp): Assert that there is no PT_INTERP
        (Layout::create_interp): Assert that there is no PT_INTERP
        segment.  If not using a SECTIONS clause, use make_output_section.
        segment.  If not using a SECTIONS clause, use make_output_section.
        (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
        (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
        * script-sections.cc
        * script-sections.cc
        (Script_sections::create_note_and_tls_segments): If making shared
        (Script_sections::create_note_and_tls_segments): If making shared
        library, put .interp section in PT_INTERP segment.
        library, put .interp section in PT_INTERP segment.
2011-06-17  Ian Lance Taylor  
2011-06-17  Ian Lance Taylor  
        * object.cc (Sized_relobj_file::do_layout): Keep warning sections
        * object.cc (Sized_relobj_file::do_layout): Keep warning sections
        when making a shared library.
        when making a shared library.
2011-06-17  Ian Lance Taylor  
2011-06-17  Ian Lance Taylor  
        * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
        * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
        parameter.  Change all callers.  Don't issue warning about PC32
        parameter.  Change all callers.  Don't issue warning about PC32
        against locally defined symbol.
        against locally defined symbol.
2011-06-16  Ian Lance Taylor  
2011-06-16  Ian Lance Taylor  
        * symtab.cc (Warnings::issue_warning): Don't warn if relocation
        * symtab.cc (Warnings::issue_warning): Don't warn if relocation
        occurs in same object.
        occurs in same object.
2011-06-14  Alan Modra  
2011-06-14  Alan Modra  
        * po/POTFILES.in: Regenerate.
        * po/POTFILES.in: Regenerate.
2011-06-09  Ian Lance Taylor  
2011-06-09  Ian Lance Taylor  
        * script-sections.cc
        * script-sections.cc
        (Orphan_output_section::set_section_addresses): For a relocatable
        (Orphan_output_section::set_section_addresses): For a relocatable
        link set address to 0.
        link set address to 0.
2011-06-09  Cary Coutant  
2011-06-09  Cary Coutant  
        PR gold/12804
        PR gold/12804
        * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
        * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
        used with --compress-debug-sections.
        used with --compress-debug-sections.
        * gold/object.cc (Sized_relobj_file::do_layout): Report
        * gold/object.cc (Sized_relobj_file::do_layout): Report
        uncompressed size of compressed input sections.
        uncompressed size of compressed input sections.
2011-06-08  Cary Coutant  
2011-06-08  Cary Coutant  
        PR gold/12804
        PR gold/12804
        * testsuite/two_file_test_2_v1.cc: Change initialization of
        * testsuite/two_file_test_2_v1.cc: Change initialization of
        v2 to keep it in .data.
        v2 to keep it in .data.
2011-06-07  Cary Coutant  
2011-06-07  Cary Coutant  
        * common.cc (Symbol_table::do_allocate_commons_list): Call
        * common.cc (Symbol_table::do_allocate_commons_list): Call
        gold_fallback.
        gold_fallback.
        * errors.cc (Errors::fatal): Adjust call to gold_exit.
        * errors.cc (Errors::fatal): Adjust call to gold_exit.
        (Errors::fallback): New function.
        (Errors::fallback): New function.
        (gold_fallback): New function.
        (gold_fallback): New function.
        * errors.h (Errors::fallback): New function.
        * errors.h (Errors::fallback): New function.
        * gold.cc (gold_exit): Change status parameter to enum; adjust
        * gold.cc (gold_exit): Change status parameter to enum; adjust
        all callers.
        all callers.
        (queue_initial_tasks): Call gold_fallback.
        (queue_initial_tasks): Call gold_fallback.
        * gold.h: Include cstdlib.
        * gold.h: Include cstdlib.
        (Exit_status): New enum type.
        (Exit_status): New enum type.
        (gold_exit): Change status parameter to enum.
        (gold_exit): Change status parameter to enum.
        (gold_fallback): New function.
        (gold_fallback): New function.
        * layout.cc (Layout::set_section_offsets): Call gold_fallback.
        * layout.cc (Layout::set_section_offsets): Call gold_fallback.
        (Layout::create_symtab_sections): Likewise.
        (Layout::create_symtab_sections): Likewise.
        (Layout::create_shdrs): Likewise.
        (Layout::create_shdrs): Likewise.
        * main.cc (main): Adjust call to gold_exit.
        * main.cc (main): Adjust call to gold_exit.
        * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
        * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
        (Output_data_got::add_got_entry_pair): Likewise.
        (Output_data_got::add_got_entry_pair): Likewise.
        (Output_section::add_input_section): Likewise.
        (Output_section::add_input_section): Likewise.
        (Output_section::add_output_section_data): Likewise.
        (Output_section::add_output_section_data): Likewise.
        (Output_segment::set_section_list_addresses): Likewise.
        (Output_segment::set_section_list_addresses): Likewise.
        * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
        * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2011-06-07  Cary Coutant  
2011-06-07  Cary Coutant  
        * layout.cc (Layout::set_segment_offsets): Don't adjust layout
        * layout.cc (Layout::set_segment_offsets): Don't adjust layout
        for incremental links.
        for incremental links.
        * output.cc (Output_segment::set_section_list_addresses): Remove
        * output.cc (Output_segment::set_section_list_addresses): Remove
        FIXME and test for TLS or BSS.
        FIXME and test for TLS or BSS.
2011-06-07  Cary Coutant  
2011-06-07  Cary Coutant  
        * testsuite/Makefile.am: Add incremental_copy_test,
        * testsuite/Makefile.am: Add incremental_copy_test,
        incremental_common_test_1.
        incremental_common_test_1.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/common_test_1_v1.c: New source file.
        * testsuite/common_test_1_v1.c: New source file.
        * testsuite/common_test_1_v2.c: New source file.
        * testsuite/common_test_1_v2.c: New source file.
        * testsuite/copy_test_v1.cc: New source file.
        * testsuite/copy_test_v1.cc: New source file.
2011-06-07  Cary Coutant  
2011-06-07  Cary Coutant  
        * common.cc (Symbol_table::do_allocate_commons_list): For incremental
        * common.cc (Symbol_table::do_allocate_commons_list): For incremental
        update, allocate common from bss section's free list.
        update, allocate common from bss section's free list.
        * incremental-dump.cc (dump_incremental_inputs): Print flag for
        * incremental-dump.cc (dump_incremental_inputs): Print flag for
        linker-defined symbols.
        linker-defined symbols.
        * incremental.cc (Sized_incremental_binary::do_process_got_plt):
        * incremental.cc (Sized_incremental_binary::do_process_got_plt):
        Skip GOT and PLT entries that are no longer referenced.
        Skip GOT and PLT entries that are no longer referenced.
        (Output_section_incremental_inputs::write_info_blocks): Mark
        (Output_section_incremental_inputs::write_info_blocks): Mark
        linker-defined symbols.
        linker-defined symbols.
        (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
        (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
        * output.cc (Output_section::allocate): New function.
        * output.cc (Output_section::allocate): New function.
        * output.h (Output_section::allocate): New function.
        * output.h (Output_section::allocate): New function.
        * resolve.cc (Symbol_table::report_resolve_problem): Add case for
        * resolve.cc (Symbol_table::report_resolve_problem): Add case for
        linker-defined symbols.
        linker-defined symbols.
        (Symbol::override_base_with_special): Copy is_predefined_ flag.
        (Symbol::override_base_with_special): Copy is_predefined_ flag.
        * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
        * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Symbol_table::do_define_in_output_data): Likewise.
        (Symbol_table::do_define_in_output_data): Likewise.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        * symtab.h (Symbol::is_predefined): New function.
        * symtab.h (Symbol::is_predefined): New function.
        (Symbol::init_base_output_data): Add is_predefined parameter.
        (Symbol::init_base_output_data): Add is_predefined parameter.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::is_predefined_): New data member.
        (Symbol::is_predefined_): New data member.
        (Sized_symbol::init_output_data): Add is_predefined parameter.
        (Sized_symbol::init_output_data): Add is_predefined parameter.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
        (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2011-06-07  Cary Coutant  
2011-06-07  Cary Coutant  
        * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
        * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
        instead of emit_copy_reloc.
        instead of emit_copy_reloc.
        (Copy_relocs::emit_copy_reloc): Refactor.
        (Copy_relocs::emit_copy_reloc): Refactor.
        (Copy_relocs::make_copy_reloc): New function.
        (Copy_relocs::make_copy_reloc): New function.
        (Copy_relocs::add_copy_reloc): Remove.
        (Copy_relocs::add_copy_reloc): Remove.
        * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
        * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
        section.
        section.
        (Copy_relocs::make_copy_reloc): New function.
        (Copy_relocs::make_copy_reloc): New function.
        (Copy_relocs::add_copy_reloc): Remove.
        (Copy_relocs::add_copy_reloc): Remove.
        * gold.cc (queue_middle_tasks): Emit old COPY relocations from
        * gold.cc (queue_middle_tasks): Emit old COPY relocations from
        unchanged input files.
        unchanged input files.
        * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
        * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
        * incremental.cc (Sized_incremental_binary::do_reserve_layout):
        * incremental.cc (Sized_incremental_binary::do_reserve_layout):
        Reserve BSS space for COPY relocations.
        Reserve BSS space for COPY relocations.
        (Sized_incremental_binary::do_emit_copy_relocs): New function.
        (Sized_incremental_binary::do_emit_copy_relocs): New function.
        (Output_section_incremental_inputs::write_info_blocks): Record
        (Output_section_incremental_inputs::write_info_blocks): Record
        whether a symbol is copied from a shared object.
        whether a symbol is copied from a shared object.
        (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
        (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
        * incremental.h (enum Incremental_shlib_symbol_flags): New type.
        * incremental.h (enum Incremental_shlib_symbol_flags): New type.
        (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
        (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
        (Incremental_input_entry_reader::get_output_symbol_index): Add
        (Incremental_input_entry_reader::get_output_symbol_index): Add
        is_copy parameter.
        is_copy parameter.
        (Incremental_binary::emit_copy_relocs): New function.
        (Incremental_binary::emit_copy_relocs): New function.
        (Incremental_binary::do_emit_copy_relocs): New function.
        (Incremental_binary::do_emit_copy_relocs): New function.
        (Sized_incremental_binary::Sized_incremental_binary): Initialize
        (Sized_incremental_binary::Sized_incremental_binary): Initialize
        new data member.
        new data member.
        (Sized_incremental_binary::add_copy_reloc): New function.
        (Sized_incremental_binary::add_copy_reloc): New function.
        (Sized_incremental_binary::do_emit_copy_relocs): New function.
        (Sized_incremental_binary::do_emit_copy_relocs): New function.
        (Sized_incremental_binary::Copy_reloc): New struct.
        (Sized_incremental_binary::Copy_reloc): New struct.
        (Sized_incremental_binary::Copy_relocs): New typedef.
        (Sized_incremental_binary::Copy_relocs): New typedef.
        (Sized_incremental_binary::copy_relocs_): New data member.
        (Sized_incremental_binary::copy_relocs_): New data member.
        * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
        * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
        * symtab.h (Symbol_table::add_from_incrobj): Change return type.
        * symtab.h (Symbol_table::add_from_incrobj): Change return type.
        * target.h (Sized_target::emit_copy_reloc): New function.
        * target.h (Sized_target::emit_copy_reloc): New function.
        * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
        * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2011-06-02  Cary Coutant  
2011-06-02  Cary Coutant  
        PR gold/12163
        PR gold/12163
        * gold/archive.cc (Archive::Archive): Initialize new data member.
        * gold/archive.cc (Archive::Archive): Initialize new data member.
        (Archive::include_all_members): Return if archive has already been
        (Archive::include_all_members): Return if archive has already been
        included.
        included.
        * gold/archive.h (Archive::include_all_members_): New data member.
        * gold/archive.h (Archive::include_all_members_): New data member.
2011-06-02  Nick Clifton  
2011-06-02  Nick Clifton  
        * dynobj.h: Fix spelling mistake in comment.
        * dynobj.h: Fix spelling mistake in comment.
        * output.cc: Likewise.
        * output.cc: Likewise.
2011-05-31  Doug Kwan  
2011-05-31  Doug Kwan  
            Asier Llano
            Asier Llano
        PR gold/12826
        PR gold/12826
        * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
        * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
        arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
        arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
        * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up.  Remove
        * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up.  Remove
        redundant arm_exidx_test.so.
        redundant arm_exidx_test.so.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        (check_SCRIPTS): Add pr12826.sh
        (check_SCRIPTS): Add pr12826.sh
        (check_DATA): Add pr12826.stdout
        (check_DATA): Add pr12826.stdout
        (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
        (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
        * testsuite/pr12826.sh: New file.
        * testsuite/pr12826.sh: New file.
        * testsuite/pr12826_1.s: Ditto.
        * testsuite/pr12826_1.s: Ditto.
        * testsuite/pr12826_1.s: Ditto.
        * testsuite/pr12826_1.s: Ditto.
2011-05-30  Ian Lance Taylor  
2011-05-30  Ian Lance Taylor  
        * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
        * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
        sections.
        sections.
2011-05-29  Ian Lance Taylor  
2011-05-29  Ian Lance Taylor  
        PR gold/12804
        PR gold/12804
        * testsuite/Makefile.am: Use different file name for two_file_test
        * testsuite/Makefile.am: Use different file name for two_file_test
        temporary file for each incremental test.
        temporary file for each incremental test.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-05-29  Ian Lance Taylor  
2011-05-29  Ian Lance Taylor  
        * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
        * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
        binary input file is empty.
        binary input file is empty.
2011-05-27  Ian Lance Taylor  
2011-05-27  Ian Lance Taylor  
        * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
        * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
        (ver_test_9.so): Likewise.
        (ver_test_9.so): Likewise.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2011-05-26 Cary Coutant  
2011-05-26 Cary Coutant  
        * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
        * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
        * incremental.cc (Incremental_inputs::report_input_section): Fix
        * incremental.cc (Incremental_inputs::report_input_section): Fix
        comment, indentation.
        comment, indentation.
        (Incremental_inputs::report_comdat_group): New function.
        (Incremental_inputs::report_comdat_group): New function.
        (Output_section_incremental_inputs::set_final_data_size): Adjust size
        (Output_section_incremental_inputs::set_final_data_size): Adjust size
        of data for incremental input file entry.
        of data for incremental input file entry.
        (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
        (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
        group count, COMDAT group signatures.
        group count, COMDAT group signatures.
        (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
        (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
        an unchanged input file.
        an unchanged input file.
        * incremental.h (Incremental_object_entry::Incremental_object_entry):
        * incremental.h (Incremental_object_entry::Incremental_object_entry):
        Initialize new data member.
        Initialize new data member.
        (Incremental_object_entry::add_comdat_group): New function.
        (Incremental_object_entry::add_comdat_group): New function.
        (Incremental_object_entry::get_comdat_group_count): New function.
        (Incremental_object_entry::get_comdat_group_count): New function.
        (Incremental_object_entry::get_comdat_signature_key): New function.
        (Incremental_object_entry::get_comdat_signature_key): New function.
        (Incremental_object_entry::groups_): New data member.
        (Incremental_object_entry::groups_): New data member.
        (Incremental_inputs::report_comdat_group): New function.
        (Incremental_inputs::report_comdat_group): New function.
        (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
        (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
        data for incremental input file entry.
        data for incremental input file entry.
        (Incremental_input_entry_reader::get_comdat_group_count): New function.
        (Incremental_input_entry_reader::get_comdat_group_count): New function.
        (Incremental_input_entry_reader::get_input_section): Adjust size of
        (Incremental_input_entry_reader::get_input_section): Adjust size of
        data for incremental input file entry.
        data for incremental input file entry.
        (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
        (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
        (Incremental_input_entry_reader::get_comdat_group_signature): New
        (Incremental_input_entry_reader::get_comdat_group_signature): New
        function.
        function.
        * object.cc (Sized_relobj::include_section_group): Report kept
        * object.cc (Sized_relobj::include_section_group): Report kept
        COMDAT groups for incremental links.
        COMDAT groups for incremental links.
2011-05-24  David Meyer  
2011-05-24  David Meyer  
        * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
        * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
        with name parameter.  Add found_name parameter.
        with name parameter.  Add found_name parameter.
        * fileread.cc (Input_file::find_file): Adjust code accordingly.
        * fileread.cc (Input_file::find_file): Adjust code accordingly.
        * dirsearch.h (class Dirsearch): Update declaration.
        * dirsearch.h (class Dirsearch): Update declaration.
2011-05-24  Ian Lance Taylor  
2011-05-24  Ian Lance Taylor  
        * archive.cc (Library_base::should_include_member): Pull in object
        * archive.cc (Library_base::should_include_member): Pull in object
        from archive if it defines the entry symbol.
        from archive if it defines the entry symbol.
        * parameters.cc (Parameters::entry): New function.
        * parameters.cc (Parameters::entry): New function.
        * parameters.h (class Parameters): Declare entry.
        * parameters.h (class Parameters): Declare entry.
        * output.h (class Output_file_header): Remove entry_ field.
        * output.h (class Output_file_header): Remove entry_ field.
        * output.cc (Output_file_header::Output_file_header): Remove entry
        * output.cc (Output_file_header::Output_file_header): Remove entry
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Output_file_header::entry): Use parameters->entry.
        (Output_file_header::entry): Use parameters->entry.
        * gold.cc (queue_middle_tasks): Likewise.
        * gold.cc (queue_middle_tasks): Likewise.
        * plugin.cc (Plugin_hook::run): Likewise.
        * plugin.cc (Plugin_hook::run): Likewise.
2011-05-24 Cary Coutant  
2011-05-24 Cary Coutant  
        * gold.cc (queue_initial_tasks): Pass incremental base filename
        * gold.cc (queue_initial_tasks): Pass incremental base filename
        to Output_file::open_base_file; don't print error message.
        to Output_file::open_base_file; don't print error message.
        * incremental-dump.cc (main): Adjust call to
        * incremental-dump.cc (main): Adjust call to
        Output_file::open_for_modification.
        Output_file::open_for_modification.
        * incremental-dump.cc (main): Likewise.
        * incremental-dump.cc (main): Likewise.
        * incremental.cc (Incremental_inputs::report_command_line):
        * incremental.cc (Incremental_inputs::report_command_line):
        Ignore --incremental-base option when comparing command lines.
        Ignore --incremental-base option when comparing command lines.
        Ignore parameter when given as separate argument.
        Ignore parameter when given as separate argument.
        * options.h (class General_options): Add --incremental-base.
        * options.h (class General_options): Add --incremental-base.
        * output.cc (Output_file::Output_file):
        * output.cc (Output_file::Output_file):
        (Output_file::open_base_file): Add base_name and writable parameters;
        (Output_file::open_base_file): Add base_name and writable parameters;
        read base file into new file; print error message here.
        read base file into new file; print error message here.
        (Output_file::map_no_anonymous): Add writable parameter; adjust all
        (Output_file::map_no_anonymous): Add writable parameter; adjust all
        callers.
        callers.
        * output.h (Output_file::open_for_modification): Rename to...
        * output.h (Output_file::open_for_modification): Rename to...
        (Output_file::open_base_file): ...this; add base_name and
        (Output_file::open_base_file): ...this; add base_name and
        writable parameters; adjust all callers.
        writable parameters; adjust all callers.
        (Output_file::map_no_anonymous): Add writable parameter; adjust all
        (Output_file::map_no_anonymous): Add writable parameter; adjust all
        callers.
        callers.
        * testsuite/Makefile.am (incremental_test_4): Test
        * testsuite/Makefile.am (incremental_test_4): Test
        --incremental-base.
        --incremental-base.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-05-24 Cary Coutant  
2011-05-24 Cary Coutant  
        * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
        * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
        incremental_test_4.
        incremental_test_4.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/two_file_test_1_v1.cc: New test source file.
        * testsuite/two_file_test_1_v1.cc: New test source file.
        * testsuite/two_file_test_1b_v1.cc: New test source file.
        * testsuite/two_file_test_1b_v1.cc: New test source file.
        * testsuite/two_file_test_2_v1.cc: New test source file.
        * testsuite/two_file_test_2_v1.cc: New test source file.
2011-05-24 Cary Coutant  
2011-05-24 Cary Coutant  
        * dynobj.h (Dynobj::do_dynobj): New function.
        * dynobj.h (Dynobj::do_dynobj): New function.
        * incremental-dump.cc (dump_incremental_inputs): Print as_needed
        * incremental-dump.cc (dump_incremental_inputs): Print as_needed
        flag and soname for shared objects.
        flag and soname for shared objects.
        * incremental.cc (Incremental_inputs::report_object): Make
        * incremental.cc (Incremental_inputs::report_object): Make
        either Incremental_object_entry or Incremental_dynobj_entry; add
        either Incremental_object_entry or Incremental_dynobj_entry; add
        soname to string table.
        soname to string table.
        (Incremental_inputs::report_input_section): Add assertion.
        (Incremental_inputs::report_input_section): Add assertion.
        (Output_section_incremental_inputs::set_final_data_size): Adjust
        (Output_section_incremental_inputs::set_final_data_size): Adjust
        type of input file entry for shared libraries; adjust size of
        type of input file entry for shared libraries; adjust size of
        shared library info entry.
        shared library info entry.
        (Output_section_incremental_inputs::write_input_files): Write
        (Output_section_incremental_inputs::write_input_files): Write
        as_needed flag for shared libraries.
        as_needed flag for shared libraries.
        (Output_section_incremental_inputs::write_info_blocks): Adjust type
        (Output_section_incremental_inputs::write_info_blocks): Adjust type
        of input file entry for shared libraries; write soname.
        of input file entry for shared libraries; write soname.
        (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
        (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
        soname from incremental info.
        soname from incremental info.
        * incremental.h (enum Incremental_input_flags): Add
        * incremental.h (enum Incremental_input_flags): Add
        INCREMENTAL_INPUT_AS_NEEDED.
        INCREMENTAL_INPUT_AS_NEEDED.
        (Incremental_input_entry::Incremental_input_entry): Initialize new
        (Incremental_input_entry::Incremental_input_entry): Initialize new
        data member.
        data member.
        (Incremental_input_entry::set_as_needed): New function.
        (Incremental_input_entry::set_as_needed): New function.
        (Incremental_input_entry::as_needed): New function.
        (Incremental_input_entry::as_needed): New function.
        (Incremental_input_entry::do_dynobj_entry): New function.
        (Incremental_input_entry::do_dynobj_entry): New function.
        (Incremental_input_entry::as_needed_): New data member.
        (Incremental_input_entry::as_needed_): New data member.
        (Incremental_object_entry::Incremental_object_entry): Don't check
        (Incremental_object_entry::Incremental_object_entry): Don't check
        for shared library.
        for shared library.
        (Incremental_object_entry::do_type): Likewise.
        (Incremental_object_entry::do_type): Likewise.
        (class Incremental_dynobj_entry): New class.
        (class Incremental_dynobj_entry): New class.
        (Incremental_input_entry_reader::as_needed): New function.
        (Incremental_input_entry_reader::as_needed): New function.
        (Incremental_input_entry_reader::get_soname): New function.
        (Incremental_input_entry_reader::get_soname): New function.
        (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
        (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
        (Incremental_input_entry_reader::get_output_symbol_index): Adjust
        (Incremental_input_entry_reader::get_output_symbol_index): Adjust
        size of shared library info entry.
        size of shared library info entry.
        * layout.cc (Layout::finish_dynamic_section): Don't test for
        * layout.cc (Layout::finish_dynamic_section): Don't test for
        incremental link when adding DT_NEEDED entries.
        incremental link when adding DT_NEEDED entries.
        * object.h (Object::Object): Initialize new data member.
        * object.h (Object::Object): Initialize new data member.
        (Object::dynobj): New function.
        (Object::dynobj): New function.
        (Object::set_as_needed): New function.
        (Object::set_as_needed): New function.
        (Object::as_needed): New function.
        (Object::as_needed): New function.
        (Object::do_dynobj): New function.
        (Object::do_dynobj): New function.
        (Object::as_needed_): New data member.
        (Object::as_needed_): New data member.
2011-05-24 Cary Coutant  
2011-05-24 Cary Coutant  
        * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
        * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
        info; adjust display of GOT entries.
        info; adjust display of GOT entries.
        * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
        * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
        vector of input objects; remove file_status_.
        vector of input objects; remove file_status_.
        (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
        (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
        (Sized_incremental_binary::do_process_got_plt): Adjust calls to
        (Sized_incremental_binary::do_process_got_plt): Adjust calls to
        got_plt reader; call target hooks to reserve GOT entries.
        got_plt reader; call target hooks to reserve GOT entries.
        (Output_section_incremental_inputs::set_final_data_size): Adjust size
        (Output_section_incremental_inputs::set_final_data_size): Adjust size
        of input file info header and GOT info entry.
        of input file info header and GOT info entry.
        (Output_section_incremental_inputs::write_info_blocks): Write dynamic
        (Output_section_incremental_inputs::write_info_blocks): Write dynamic
        relocation info.
        relocation info.
        (Got_plt_view_info::got_descriptor): Remove.
        (Got_plt_view_info::got_descriptor): Remove.
        (Got_plt_view_info::sym_index): New data member.
        (Got_plt_view_info::sym_index): New data member.
        (Got_plt_view_info::input_index): New data member.
        (Got_plt_view_info::input_index): New data member.
        (Local_got_offset_visitor::visit): Write input file index.
        (Local_got_offset_visitor::visit): Write input file index.
        (Global_got_offset_visitor::visit): Write 0 for input file index.
        (Global_got_offset_visitor::visit): Write 0 for input file index.
        (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
        (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
        with sym_index and input_index.
        with sym_index and input_index.
        (Output_section_incremental_inputs::write_got_plt): Adjust size of
        (Output_section_incremental_inputs::write_got_plt): Adjust size of
        incremental info GOT entry; replace got_descriptor with input_index.
        incremental info GOT entry; replace got_descriptor with input_index.
        (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
        (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
        map from input file index to object.
        map from input file index to object.
        (Sized_relobj_incr::do_layout): Replace direct data member reference
        (Sized_relobj_incr::do_layout): Replace direct data member reference
        with accessor function.
        with accessor function.
        (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
        (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
        * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
        * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
        Adjust size of input file info header.
        Adjust size of input file info header.
        (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
        (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
        (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
        (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
        (Incremental_input_entry_reader::get_input_section): Adjust size of
        (Incremental_input_entry_reader::get_input_section): Adjust size of
        input file info header.
        input file info header.
        (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
        (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
        of incremental info GOT entry.
        of incremental info GOT entry.
        (Incremental_got_plt_reader::get_got_desc): Remove.
        (Incremental_got_plt_reader::get_got_desc): Remove.
        (Incremental_got_plt_reader::get_got_symndx): New function.
        (Incremental_got_plt_reader::get_got_symndx): New function.
        (Incremental_got_plt_reader::get_got_input_index): New function.
        (Incremental_got_plt_reader::get_got_input_index): New function.
        (Sized_incremental_binary::Sized_incremental_binary): Remove
        (Sized_incremental_binary::Sized_incremental_binary): Remove
        file_status_; add input_objects_.
        file_status_; add input_objects_.
        (Sized_incremental_binary::~Sized_incremental_binary): Remove.
        (Sized_incremental_binary::~Sized_incremental_binary): Remove.
        (Sized_incremental_binary::set_file_is_unchanged): Remove.
        (Sized_incremental_binary::set_file_is_unchanged): Remove.
        (Sized_incremental_binary::file_is_unchanged): Remove.
        (Sized_incremental_binary::file_is_unchanged): Remove.
        (Sized_incremental_binary::set_input_object): New function.
        (Sized_incremental_binary::set_input_object): New function.
        (Sized_incremental_binary::input_object): New function.
        (Sized_incremental_binary::input_object): New function.
        (Sized_incremental_binary::file_status_): Remove.
        (Sized_incremental_binary::file_status_): Remove.
        (Sized_incremental_binary::input_objects_): New data member.
        (Sized_incremental_binary::input_objects_): New data member.
        (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
        (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
        references.
        references.
        (Sized_relobj_incr::invalid_address): Move to base class.
        (Sized_relobj_incr::invalid_address): Move to base class.
        (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
        (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
        class.
        class.
        (Sized_relobj_incr::do_output_section_offset): Likewise.
        (Sized_relobj_incr::do_output_section_offset): Likewise.
        (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
        (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
        (Sized_relobj_incr::section_offsets_): Likewise.
        (Sized_relobj_incr::section_offsets_): Likewise.
        * object.cc (Sized_relobj::do_for_all_local_got_entries): New
        * object.cc (Sized_relobj::do_for_all_local_got_entries): New
        function.
        function.
        (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
        (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
        (Sized_relobj_file::layout_section): Replace refs to section_offsets_
        (Sized_relobj_file::layout_section): Replace refs to section_offsets_
        with accessor function.
        with accessor function.
        (Sized_relobj_file::do_layout): Likewise.
        (Sized_relobj_file::do_layout): Likewise.
        (Sized_relobj_file::do_layout_deferred_sections): Likewise.
        (Sized_relobj_file::do_layout_deferred_sections): Likewise.
        (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
        (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
        (Sized_relobj_file::compute_final_local_value): Replace refs to
        (Sized_relobj_file::compute_final_local_value): Replace refs to
        section_offsets_ with accessor function.
        section_offsets_ with accessor function.
        (Sized_relobj_file::do_finalize_local_symbols): Likewise.
        (Sized_relobj_file::do_finalize_local_symbols): Likewise.
        * object.h (Relobj::Relobj): Initialize new data members.
        * object.h (Relobj::Relobj): Initialize new data members.
        (Relobj::add_dyn_reloc): New function.
        (Relobj::add_dyn_reloc): New function.
        (Relobj::first_dyn_reloc): New function.
        (Relobj::first_dyn_reloc): New function.
        (Relobj::dyn_reloc_count): New function.
        (Relobj::dyn_reloc_count): New function.
        (Relobj::first_dyn_reloc_): New data member.
        (Relobj::first_dyn_reloc_): New data member.
        (Relobj::dyn_reloc_count_): New data member.
        (Relobj::dyn_reloc_count_): New data member.
        (Sized_relobj): Rename Sized_relobj_base to this; adjust all
        (Sized_relobj): Rename Sized_relobj_base to this; adjust all
        references.
        references.
        (Sized_relobj::Address): New typedef.
        (Sized_relobj::Address): New typedef.
        (Sized_relobj::invalid_address): Move here from child class.
        (Sized_relobj::invalid_address): Move here from child class.
        (Sized_relobj::Sized_relobj): Initialize new data members.
        (Sized_relobj::Sized_relobj): Initialize new data members.
        (Sized_relobj::sized_relobj): New function.
        (Sized_relobj::sized_relobj): New function.
        (Sized_relobj::is_output_section_offset_invalid): Move here from
        (Sized_relobj::is_output_section_offset_invalid): Move here from
        child class.
        child class.
        (Sized_relobj::get_output_section_offset): Likewise.
        (Sized_relobj::get_output_section_offset): Likewise.
        (Sized_relobj::local_has_got_offset): Likewise.
        (Sized_relobj::local_has_got_offset): Likewise.
        (Sized_relobj::local_got_offset): Likewise.
        (Sized_relobj::local_got_offset): Likewise.
        (Sized_relobj::set_local_got_offset): Likewise.
        (Sized_relobj::set_local_got_offset): Likewise.
        (Sized_relobj::do_for_all_local_got_entries): Likewise.
        (Sized_relobj::do_for_all_local_got_entries): Likewise.
        (Sized_relobj::clear_got_offsets): New function.
        (Sized_relobj::clear_got_offsets): New function.
        (Sized_relobj::section_offsets): Move here from child class.
        (Sized_relobj::section_offsets): Move here from child class.
        (Sized_relobj::do_output_section_offset): Likewise.
        (Sized_relobj::do_output_section_offset): Likewise.
        (Sized_relobj::do_set_section_offset): Likewise.
        (Sized_relobj::do_set_section_offset): Likewise.
        (Sized_relobj::Local_got_offsets): Likewise.
        (Sized_relobj::Local_got_offsets): Likewise.
        (Sized_relobj::local_got_offsets_): Likewise.
        (Sized_relobj::local_got_offsets_): Likewise.
        (Sized_relobj::section_offsets_): Likewise.
        (Sized_relobj::section_offsets_): Likewise.
        (Sized_relobj_file): Rename Sized_relobj to this; adjust all
        (Sized_relobj_file): Rename Sized_relobj to this; adjust all
        references.
        references.
        (Sized_relobj_file::is_output_section_offset_invalid): Move to base
        (Sized_relobj_file::is_output_section_offset_invalid): Move to base
        class.
        class.
        (Sized_relobj_file::sized_relobj): New function
        (Sized_relobj_file::sized_relobj): New function
        (Sized_relobj_file::local_has_got_offset): Move to base class.
        (Sized_relobj_file::local_has_got_offset): Move to base class.
        (Sized_relobj_file::local_got_offset): Likewise.
        (Sized_relobj_file::local_got_offset): Likewise.
        (Sized_relobj_file::set_local_got_offset): Likewise.
        (Sized_relobj_file::set_local_got_offset): Likewise.
        (Sized_relobj_file::get_output_section_offset): Likewise.
        (Sized_relobj_file::get_output_section_offset): Likewise.
        (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
        (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
        (Sized_relobj_file::do_output_section_offset): Likewise.
        (Sized_relobj_file::do_output_section_offset): Likewise.
        (Sized_relobj_file::do_set_section_offset): Likewise.
        (Sized_relobj_file::do_set_section_offset): Likewise.
        (Sized_relobj_file::Local_got_offsets): Likewise.
        (Sized_relobj_file::Local_got_offsets): Likewise.
        (Sized_relobj_file::local_got_offsets_): Likewise.
        (Sized_relobj_file::local_got_offsets_): Likewise.
        (Sized_relobj_file::section_offsets_): Likewise.
        (Sized_relobj_file::section_offsets_): Likewise.
        * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
        * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
        (all constructors).
        (all constructors).
        (set_needs_dynsym_index): Convert relobj to derived class pointer.
        (set_needs_dynsym_index): Convert relobj to derived class pointer.
        (Output_reloc::get_symbol_index): Likewise.
        (Output_reloc::get_symbol_index): Likewise.
        (Output_reloc::local_section_offset): Likewise.
        (Output_reloc::local_section_offset): Likewise.
        (Output_reloc::get_address): Likewise.
        (Output_reloc::get_address): Likewise.
        (Output_reloc::symbol_value): Likewise.
        (Output_reloc::symbol_value): Likewise.
        (Output_data_got::reserve_slot): Move to class definition.
        (Output_data_got::reserve_slot): Move to class definition.
        (Output_data_got::reserve_local): New function.
        (Output_data_got::reserve_local): New function.
        (Output_data_got::reserve_slot_for_global): Remove.
        (Output_data_got::reserve_slot_for_global): Remove.
        (Output_data_got::reserve_global): New function.
        (Output_data_got::reserve_global): New function.
        * output.h (Output_reloc::Output_reloc): Adjust type of relobj
        * output.h (Output_reloc::Output_reloc): Adjust type of relobj
        (all constructors, two instantiations).
        (all constructors, two instantiations).
        (Output_reloc::get_relobj): New function (two instantiations).
        (Output_reloc::get_relobj): New function (two instantiations).
        (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
        (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
        (Output_data_reloc_base::add): Convert relobj to derived class pointer.
        (Output_data_reloc_base::add): Convert relobj to derived class pointer.
        (Output_data_reloc::add_global): Adjust type of relobj.
        (Output_data_reloc::add_global): Adjust type of relobj.
        (Output_data_reloc::add_global_relative): Likewise.
        (Output_data_reloc::add_global_relative): Likewise.
        (Output_data_reloc::add_symbolless_global_addend): Likewise.
        (Output_data_reloc::add_symbolless_global_addend): Likewise.
        (Output_data_reloc::add_local): Likewise.
        (Output_data_reloc::add_local): Likewise.
        (Output_data_reloc::add_local_relative): Likewise.
        (Output_data_reloc::add_local_relative): Likewise.
        (Output_data_reloc::add_symbolless_local_addend): Likewise.
        (Output_data_reloc::add_symbolless_local_addend): Likewise.
        (Output_data_reloc::add_local_section): Likewise.
        (Output_data_reloc::add_local_section): Likewise.
        (Output_data_reloc::add_output_section): Likewise.
        (Output_data_reloc::add_output_section): Likewise.
        (Output_data_reloc::add_absolute): Likewise.
        (Output_data_reloc::add_absolute): Likewise.
        (Output_data_reloc::add_target_specific): Likewise.
        (Output_data_reloc::add_target_specific): Likewise.
        (Output_data_got::reserve_slot): Move definition here.
        (Output_data_got::reserve_slot): Move definition here.
        (Output_data_got::reserve_local): New function.
        (Output_data_got::reserve_local): New function.
        (Output_data_got::reserve_global): New function.
        (Output_data_got::reserve_global): New function.
        * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
        * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
        section_offsets_ with accessor function.
        section_offsets_ with accessor function.
        (Sized_relobj_file::write_sections): Likewise.
        (Sized_relobj_file::write_sections): Likewise.
        (Sized_relobj_file::do_relocate_sections): Likewise.
        (Sized_relobj_file::do_relocate_sections): Likewise.
        * target.h (Sized_target::reserve_local_got_entry): New function.
        * target.h (Sized_target::reserve_local_got_entry): New function.
        (Sized_target::reserve_global_got_entry): New function.
        (Sized_target::reserve_global_got_entry): New function.
        * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
        * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
        (Target_x86_64::reserve_global_got_entry): New function.
        (Target_x86_64::reserve_global_got_entry): New function.
        (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
        (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2011-05-23 Cary Coutant  
2011-05-23 Cary Coutant  
        * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
        * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
        * incremental-dump.cc (dump_incremental_inputs): Mask high-order
        * incremental-dump.cc (dump_incremental_inputs): Mask high-order
        bit when checking got_type.
        bit when checking got_type.
        * incremental.cc (Sized_incremental_binary::setup_readers):
        * incremental.cc (Sized_incremental_binary::setup_readers):
        Store symbol table and string table locations; initialize bit vector
        Store symbol table and string table locations; initialize bit vector
        of file status flags.
        of file status flags.
        (Sized_incremental_binary::do_reserve_layout): Set bit flag for
        (Sized_incremental_binary::do_reserve_layout): Set bit flag for
        unchanged files.
        unchanged files.
        (Sized_incremental_binary::do_process_got_plt): New function.
        (Sized_incremental_binary::do_process_got_plt): New function.
        (Sized_incremental_binary::get_symtab_view): Use stored locations.
        (Sized_incremental_binary::get_symtab_view): Use stored locations.
        (Output_section_incremental_inputs::set_final_data_size): Record
        (Output_section_incremental_inputs::set_final_data_size): Record
        file index for each input file.
        file index for each input file.
        (Output_section_incremental_inputs::write_got_plt): Store file index
        (Output_section_incremental_inputs::write_got_plt): Store file index
        instead of input entry offset for each GOT entry.
        instead of input entry offset for each GOT entry.
        * incremental.h
        * incremental.h
        (Incremental_input_entry::Incremental_input_entry): Initialize new
        (Incremental_input_entry::Incremental_input_entry): Initialize new
        data member.
        data member.
        (Incremental_input_entry::set_offset): Store file index.
        (Incremental_input_entry::set_offset): Store file index.
        (Incremental_input_entry::get_file_index): New function.
        (Incremental_input_entry::get_file_index): New function.
        (Incremental_input_entry::file_index_): New data member.
        (Incremental_input_entry::file_index_): New data member.
        (Incremental_binary::process_got_plt): New function.
        (Incremental_binary::process_got_plt): New function.
        (Incremental_binary::do_process_got_plt): New function.
        (Incremental_binary::do_process_got_plt): New function.
        (Sized_incremental_binary::Sized_incremental_binary): Initialize new
        (Sized_incremental_binary::Sized_incremental_binary): Initialize new
        data members.
        data members.
        (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
        (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
        (Sized_incremental_binary::set_file_is_unchanged): New function.
        (Sized_incremental_binary::set_file_is_unchanged): New function.
        (Sized_incremental_binary::file_is_unchanged): New function.
        (Sized_incremental_binary::file_is_unchanged): New function.
        (Sized_incremental_binary::do_process_got_plt): New function.
        (Sized_incremental_binary::do_process_got_plt): New function.
        (Sized_incremental_binary::file_status_): New data member.
        (Sized_incremental_binary::file_status_): New data member.
        (Sized_incremental_binary::main_symtab_loc_): New data member.
        (Sized_incremental_binary::main_symtab_loc_): New data member.
        (Sized_incremental_binary::main_strtab_loc_): New data member.
        (Sized_incremental_binary::main_strtab_loc_): New data member.
        * output.cc (Output_data_got::Got_entry::write): Add case
        * output.cc (Output_data_got::Got_entry::write): Add case
        RESERVED_CODE.
        RESERVED_CODE.
        (Output_data_got::add_global): Call add_got_entry.
        (Output_data_got::add_global): Call add_got_entry.
        (Output_data_got::add_global_plt): Likewise.
        (Output_data_got::add_global_plt): Likewise.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
        (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
        (Output_data_got::add_global_pair_with_rela): Likewise.
        (Output_data_got::add_global_pair_with_rela): Likewise.
        (Output_data_got::add_local): Call add_got_entry.
        (Output_data_got::add_local): Call add_got_entry.
        (Output_data_got::add_local_plt): Likewise.
        (Output_data_got::add_local_plt): Likewise.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
        (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
        (Output_data_got::add_local_pair_with_rela): Likewise.
        (Output_data_got::add_local_pair_with_rela): Likewise.
        (Output_data_got::reserve_slot): New function.
        (Output_data_got::reserve_slot): New function.
        (Output_data_got::reserve_slot_for_global): New function.
        (Output_data_got::reserve_slot_for_global): New function.
        (Output_data_got::add_got_entry): New function.
        (Output_data_got::add_got_entry): New function.
        (Output_data_got::add_got_entry_pair): New function.
        (Output_data_got::add_got_entry_pair): New function.
        (Output_section::add_output_section_data): Edit FIXME.
        (Output_section::add_output_section_data): Edit FIXME.
        * output.h
        * output.h
        (Output_section_data_build::Output_section_data_build): New
        (Output_section_data_build::Output_section_data_build): New
        constructor with size parameter.
        constructor with size parameter.
        (Output_data_space::Output_data_space): Likewise.
        (Output_data_space::Output_data_space): Likewise.
        (Output_data_got::Output_data_got): Initialize new data member; new
        (Output_data_got::Output_data_got): Initialize new data member; new
        constructor with size parameter.
        constructor with size parameter.
        (Output_data_got::add_constant): Call add_got_entry.
        (Output_data_got::add_constant): Call add_got_entry.
        (Output_data_got::reserve_slot): New function.
        (Output_data_got::reserve_slot): New function.
        (Output_data_got::reserve_slot_for_global): New function.
        (Output_data_got::reserve_slot_for_global): New function.
        (class Output_data_got::Got_entry): Add RESERVED_CODE.
        (class Output_data_got::Got_entry): Add RESERVED_CODE.
        (Output_data_got::add_got_entry): New function.
        (Output_data_got::add_got_entry): New function.
        (Output_data_got::add_got_entry_pair): New function.
        (Output_data_got::add_got_entry_pair): New function.
        (Output_data_got::free_list_): New data member.
        (Output_data_got::free_list_): New data member.
        * target.h (Sized_target::init_got_plt_for_update): New function.
        * target.h (Sized_target::init_got_plt_for_update): New function.
        (Sized_target::register_global_plt_entry): New function.
        (Sized_target::register_global_plt_entry): New function.
        * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
        * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
        Initialize new data member; call init; add constructor with PLT count.
        Initialize new data member; call init; add constructor with PLT count.
        (Output_data_plt_x86_64::init): New function.
        (Output_data_plt_x86_64::init): New function.
        (Output_data_plt_x86_64::add_relocation): New function.
        (Output_data_plt_x86_64::add_relocation): New function.
        (Output_data_plt_x86_64::reserve_slot): New function.
        (Output_data_plt_x86_64::reserve_slot): New function.
        (Output_data_plt_x86_64::free_list_): New data member.
        (Output_data_plt_x86_64::free_list_): New data member.
        (Target_x86_64::init_got_plt_for_update): New function.
        (Target_x86_64::init_got_plt_for_update): New function.
        (Target_x86_64::register_global_plt_entry): New function.
        (Target_x86_64::register_global_plt_entry): New function.
        (Output_data_plt_x86_64::add_entry): Allocate from free list for
        (Output_data_plt_x86_64::add_entry): Allocate from free list for
        incremental updates.
        incremental updates.
        (Output_data_plt_x86_64::add_relocation): New function.
        (Output_data_plt_x86_64::add_relocation): New function.
        * testsuite/object_unittest.cc (Object_test): Set default options.
        * testsuite/object_unittest.cc (Object_test): Set default options.
2011-05-16  Ian Lance Taylor  
2011-05-16  Ian Lance Taylor  
        * options.h (class General_options): Make -i a synonym for -r.
        * options.h (class General_options): Make -i a synonym for -r.
2011-05-16  Ian Lance Taylor  
2011-05-16  Ian Lance Taylor  
        * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
        * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2011-05-10 Cary Coutant  
2011-05-10 Cary Coutant  
        * object.cc (Sized_relobj::do_count_local_symbols): Check for
        * object.cc (Sized_relobj::do_count_local_symbols): Check for
        strip_all (-s).
        strip_all (-s).
2011-05-06  Ian Lance Taylor  
2011-05-06  Ian Lance Taylor  
        * layout.cc (Layout::layout): If the output section flags change,
        * layout.cc (Layout::layout): If the output section flags change,
        update the ordering.
        update the ordering.
2011-04-25 Cary Coutant  
2011-04-25 Cary Coutant  
        * incremental-dump.cc (dump_incremental_inputs): Print local
        * incremental-dump.cc (dump_incremental_inputs): Print local
        symbol info for each input file.
        symbol info for each input file.
        * incremental.cc
        * incremental.cc
        (Output_section_incremental_inputs::set_final_data_size): Add local
        (Output_section_incremental_inputs::set_final_data_size): Add local
        symbol info to input file entries in incremental info.
        symbol info to input file entries in incremental info.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
        (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
        (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
        (Sized_incr_relobj::do_add_symbols): Cosmetic change.
        (Sized_incr_relobj::do_add_symbols): Cosmetic change.
        (Sized_incr_relobj::do_count_local_symbols): Replace stub with
        (Sized_incr_relobj::do_count_local_symbols): Replace stub with
        implementation.
        implementation.
        (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
        (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
        (Sized_incr_relobj::do_relocate): Write the local symbols.
        (Sized_incr_relobj::do_relocate): Write the local symbols.
        (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
        (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
        * incremental.h (Incremental_inputs_reader::get_symbol_offset):
        * incremental.h (Incremental_inputs_reader::get_symbol_offset):
        Adjust size of input file header.
        Adjust size of input file header.
        (Incremental_inputs_reader::get_local_symbol_offset): New function.
        (Incremental_inputs_reader::get_local_symbol_offset): New function.
        (Incremental_inputs_reader::get_local_symbol_count): New function.
        (Incremental_inputs_reader::get_local_symbol_count): New function.
        (Incremental_inputs_reader::get_input_section): Adjust size of input
        (Incremental_inputs_reader::get_input_section): Adjust size of input
        file header.
        file header.
        (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
        (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
        (Sized_incr_relobj::This): New typedef.
        (Sized_incr_relobj::This): New typedef.
        (Sized_incr_relobj::sym_size): New const data member.
        (Sized_incr_relobj::sym_size): New const data member.
        (Sized_incr_relobj::Local_symbol): New struct.
        (Sized_incr_relobj::Local_symbol): New struct.
        (Sized_incr_relobj::do_output_local_symbol_count): New function.
        (Sized_incr_relobj::do_output_local_symbol_count): New function.
        (Sized_incr_relobj::do_local_symbol_offset): New function.
        (Sized_incr_relobj::do_local_symbol_offset): New function.
        (Sized_incr_relobj::local_symbol_count_): New data member.
        (Sized_incr_relobj::local_symbol_count_): New data member.
        (Sized_incr_relobj::output_local_dynsym_count_): New data member.
        (Sized_incr_relobj::output_local_dynsym_count_): New data member.
        (Sized_incr_relobj::local_symbol_index_): New data member.
        (Sized_incr_relobj::local_symbol_index_): New data member.
        (Sized_incr_relobj::local_symbol_offset_): New data member.
        (Sized_incr_relobj::local_symbol_offset_): New data member.
        (Sized_incr_relobj::local_dynsym_offset_): New data member.
        (Sized_incr_relobj::local_dynsym_offset_): New data member.
        (Sized_incr_relobj::local_symbols_): New data member.
        (Sized_incr_relobj::local_symbols_): New data member.
        * object.h (Relobj::output_local_symbol_count): New function.
        * object.h (Relobj::output_local_symbol_count): New function.
        (Relobj::local_symbol_offset): New function.
        (Relobj::local_symbol_offset): New function.
        (Relobj::do_output_local_symbol_count): New function.
        (Relobj::do_output_local_symbol_count): New function.
        (Relobj::do_local_symbol_offset): New function.
        (Relobj::do_local_symbol_offset): New function.
        (Sized_relobj::do_output_local_symbol_count): New function.
        (Sized_relobj::do_output_local_symbol_count): New function.
        (Sized_relobj::do_local_symbol_offset): New function.
        (Sized_relobj::do_local_symbol_offset): New function.
2011-04-22  Vladimir Simonov  
2011-04-22  Vladimir Simonov  
        * descriptors.cc (set_close_on_exec): New function.
        * descriptors.cc (set_close_on_exec): New function.
        (Descriptors::open): Use set_close_on_exec.
        (Descriptors::open): Use set_close_on_exec.
        * output.cc (S_ISLNK): Define if not defined.
        * output.cc (S_ISLNK): Define if not defined.
2011-04-22 Cary Coutant  
2011-04-22 Cary Coutant  
        * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
        * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
        global symbol map.
        global symbol map.
        (Sized_incremental_binary::do_apply_incremental_relocs): New function.
        (Sized_incremental_binary::do_apply_incremental_relocs): New function.
        (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
        (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
        (Sized_incr_relobj::do_relocate): Remap section indices in incremental
        (Sized_incr_relobj::do_relocate): Remap section indices in incremental
        relocations.
        relocations.
        (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
        (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
        (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
        (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
        (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
        (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
        * incremental.h
        * incremental.h
        (Incremental_inputs_reader::global_symbol_reader_at_offset): New
        (Incremental_inputs_reader::global_symbol_reader_at_offset): New
        function.
        function.
        (Incremental_binary::apply_incremental_relocs): New function.
        (Incremental_binary::apply_incremental_relocs): New function.
        (Incremental_binary::do_apply_incremental_relocs): New function.
        (Incremental_binary::do_apply_incremental_relocs): New function.
        (Sized_incremental_binary::Sized_incremental_binary): Initialize new
        (Sized_incremental_binary::Sized_incremental_binary): Initialize new
        data member.
        data member.
        (Sized_incremental_binary::add_global_symbol): New function.
        (Sized_incremental_binary::add_global_symbol): New function.
        (Sized_incremental_binary::global_symbol): New function.
        (Sized_incremental_binary::global_symbol): New function.
        (Sized_incremental_binary::do_apply_incremental_relocs): New function.
        (Sized_incremental_binary::do_apply_incremental_relocs): New function.
        (Sized_incremental_binary::symbol_map_): New data member.
        (Sized_incremental_binary::symbol_map_): New data member.
        * layout.cc (Layout_task_runner::run): Apply incremental relocations.
        * layout.cc (Layout_task_runner::run): Apply incremental relocations.
        * target.h (Sized_target::apply_relocation): New function.
        * target.h (Sized_target::apply_relocation): New function.
        * target-reloc.h (apply_relocation): New function.
        * target-reloc.h (apply_relocation): New function.
        * x86_64.cc (Target_x86_64::apply_relocation): New function.
        * x86_64.cc (Target_x86_64::apply_relocation): New function.
2011-04-22  Doug Kwan  
2011-04-22  Doug Kwan  
        * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
        * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
        flag of a SHT_ARM_EXIDX section.
        flag of a SHT_ARM_EXIDX section.
        * testsuite/Makefile.am (arm_exidx_test): New test rules.
        * testsuite/Makefile.am (arm_exidx_test): New test rules.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_exidx_test.s: New file.
        * testsuite/arm_exidx_test.s: New file.
        * testsuite/arm_exidx_test.sh: Same.
        * testsuite/arm_exidx_test.sh: Same.
2011-04-20 Cary Coutant  
2011-04-20 Cary Coutant  
        PR gold/12689
        PR gold/12689
        * archive.h (Incremental_archive_entry::Archive_member):
        * archive.h (Incremental_archive_entry::Archive_member):
        Initialize arg_serial_ (second constructor).
        Initialize arg_serial_ (second constructor).
2011-04-17  Ian Lance Taylor  
2011-04-17  Ian Lance Taylor  
        * object.cc (Relocate_info::location): Simplify location string.
        * object.cc (Relocate_info::location): Simplify location string.
        * errors.cc (Errors::error_at_location): Don't print program
        * errors.cc (Errors::error_at_location): Don't print program
        name.
        name.
        (Errors::warning_at_location): Likewise.
        (Errors::warning_at_location): Likewise.
        (Errors::undefined_symbol): Likewise.
        (Errors::undefined_symbol): Likewise.
        * testsuite/debug_msg.sh: Update accordingly.
        * testsuite/debug_msg.sh: Update accordingly.
2011-04-14 Cary Coutant  
2011-04-14 Cary Coutant  
        * gold/layout.cc (Layout::symtab_section_offset): New function.
        * gold/layout.cc (Layout::symtab_section_offset): New function.
        * gold/layout.h (Layout::symtab_section_offset): New function.
        * gold/layout.h (Layout::symtab_section_offset): New function.
        * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
        * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2011-04-12  Ian Lance Taylor  
2011-04-12  Ian Lance Taylor  
        * configure.ac: Check for sys/mman.h and mmap.  Check for mremap
        * configure.ac: Check for sys/mman.h and mmap.  Check for mremap
        with MREMAP_MAYMOVE.
        with MREMAP_MAYMOVE.
        * output.h (class Output_file): Add map_is_allocated_ field.
        * output.h (class Output_file): Add map_is_allocated_ field.
        * output.cc: Only #include  if it exists.  If mmap is
        * output.cc: Only #include  if it exists.  If mmap is
        not available, provide stubs.  If mremap is not available, #define
        not available, provide stubs.  If mremap is not available, #define
        it to gold_mremap.
        it to gold_mremap.
        (MREMAP_MAYMOVE): Define if not defined.
        (MREMAP_MAYMOVE): Define if not defined.
        (Output_file::Output_file): Initialize map_is_allocated_.
        (Output_file::Output_file): Initialize map_is_allocated_.
        (Output_file::resize): Check map_is_allocated_.
        (Output_file::resize): Check map_is_allocated_.
        (Output_file::map_anonymous): If mmap fails, use malloc.
        (Output_file::map_anonymous): If mmap fails, use malloc.
        (Output_file::unmap): Don't do anything for an anonymous map.
        (Output_file::unmap): Don't do anything for an anonymous map.
        * fileread.cc: Only #include  if it exists.  If mmap
        * fileread.cc: Only #include  if it exists.  If mmap
        is not available, provide stubs.
        is not available, provide stubs.
        (File_read::View::~View): Use free rather than delete[].
        (File_read::View::~View): Use free rather than delete[].
        (File_read::make_view): Use malloc rather than new[].  If mmap
        (File_read::make_view): Use malloc rather than new[].  If mmap
        fails, use malloc.
        fails, use malloc.
        (File_read::find_or_make_view): Use malloc rather than new[].
        (File_read::find_or_make_view): Use malloc rather than new[].
        * gold.h: Remove HAVE_REMAP code.
        * gold.h: Remove HAVE_REMAP code.
        * mremap.c: #include .  Only #include  if it
        * mremap.c: #include .  Only #include  if it
        exists.  Rename mremap to gold_mremap.  If mmap is not available
        exists.  Rename mremap to gold_mremap.  If mmap is not available
        don't do anything.
        don't do anything.
        * configure, config.in: Rebuild.
        * configure, config.in: Rebuild.
2011-04-11  Ian Lance Taylor  
2011-04-11  Ian Lance Taylor  
        * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
        * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
        initialize local variable v.
        initialize local variable v.
2011-04-11  Cary Coutant  
2011-04-11  Cary Coutant  
        * archive.cc (Archive::include_member): Adjust call to
        * archive.cc (Archive::include_member): Adjust call to
        report_object.
        report_object.
        (Add_archive_symbols::run): Track argument serial numbers.
        (Add_archive_symbols::run): Track argument serial numbers.
        (Lib_group::include_member): Likewise.
        (Lib_group::include_member): Likewise.
        (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
        (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
        * archive.h (Incremental_archive_entry::Archive_member):
        * archive.h (Incremental_archive_entry::Archive_member):
        Initialize arg_serial_.
        Initialize arg_serial_.
        (Archive_member::arg_serial_): New data member.
        (Archive_member::arg_serial_): New data member.
        * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
        * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
        (Sized_dynobj::do_add_symbols): Track symbols when doing an
        (Sized_dynobj::do_add_symbols): Track symbols when doing an
        incremental link.
        incremental link.
        (Sized_dynobj::do_for_all_local_got_entries): New function.
        (Sized_dynobj::do_for_all_local_got_entries): New function.
        * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
        * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
        function.
        function.
        * fileread.cc (get_mtime): New function.
        * fileread.cc (get_mtime): New function.
        * fileread.h (get_mtime): New function.
        * fileread.h (get_mtime): New function.
        * gold.cc (queue_initial_tasks): Check for incremental update.
        * gold.cc (queue_initial_tasks): Check for incremental update.
        (process_incremental_input): New function.
        (process_incremental_input): New function.
        (queue_middle_tasks): Don't force valid target for incremental
        (queue_middle_tasks): Don't force valid target for incremental
        update.
        update.
        * incremental-dump.cc (find_input_containing_global): Adjust
        * incremental-dump.cc (find_input_containing_global): Adjust
        size of symbol info entry.
        size of symbol info entry.
        (dump_incremental_inputs): Dump argument serial number and
        (dump_incremental_inputs): Dump argument serial number and
        in_system_directory flag; bias shndx by 1; print symbol names
        in_system_directory flag; bias shndx by 1; print symbol names
        when dumping per-file symbol lists; use new symbol info readers.
        when dumping per-file symbol lists; use new symbol info readers.
        * incremental.cc
        * incremental.cc
        (Output_section_incremental_inputs:update_data_size): New function.
        (Output_section_incremental_inputs:update_data_size): New function.
        (Sized_incremental_binary::setup_readers): Setup input readers
        (Sized_incremental_binary::setup_readers): Setup input readers
        for each input file; build maps for files added from libraries
        for each input file; build maps for files added from libraries
        and scripts.
        and scripts.
        (Sized_incremental_binary::check_input_args): New function.
        (Sized_incremental_binary::check_input_args): New function.
        (Sized_incremental_binary::do_check_inputs): Build map of argument
        (Sized_incremental_binary::do_check_inputs): Build map of argument
        serial numbers to input arguments.
        serial numbers to input arguments.
        (Sized_incremental_binary::do_file_has_changed): Rename
        (Sized_incremental_binary::do_file_has_changed): Rename
        do_file_is_unchanged to this; compare file modification times.
        do_file_is_unchanged to this; compare file modification times.
        (Sized_incremental_binary::do_init_layout): New function.
        (Sized_incremental_binary::do_init_layout): New function.
        (Sized_incremental_binary::do_reserve_layout): New function.
        (Sized_incremental_binary::do_reserve_layout): New function.
        (Sized_incremental_binary::do_get_input_reader): Remove.
        (Sized_incremental_binary::do_get_input_reader): Remove.
        (Sized_incremental_binary::get_symtab_view): New function.
        (Sized_incremental_binary::get_symtab_view): New function.
        (Incremental_checker::can_incrementally_link_output_file): Remove.
        (Incremental_checker::can_incrementally_link_output_file): Remove.
        (Incremental_inputs::report_command_line): Exclude --debug options.
        (Incremental_inputs::report_command_line): Exclude --debug options.
        (Incremental_inputs::report_archive_begin): Add parameter; track
        (Incremental_inputs::report_archive_begin): Add parameter; track
        argument serial numbers; don't put input file entry for archive
        argument serial numbers; don't put input file entry for archive
        before archive members.
        before archive members.
        (Incremental_inputs::report_archive_end): Put input file entry
        (Incremental_inputs::report_archive_end): Put input file entry
        for archive after archive members.
        for archive after archive members.
        (Incremental_inputs::report_object): Add parameter; track argument
        (Incremental_inputs::report_object): Add parameter; track argument
        serial numbers and in_system_directory flag.
        serial numbers and in_system_directory flag.
        (Incremental_inputs::report_script): Add parameter; track argument
        (Incremental_inputs::report_script): Add parameter; track argument
        serial numbers.
        serial numbers.
        (Output_section_incremental_inputs::set_final_data_size): Adjust
        (Output_section_incremental_inputs::set_final_data_size): Adjust
        size of symbol info entry; check for forwarding symbols.
        size of symbol info entry; check for forwarding symbols.
        (Output_section_incremental_inputs::write_input_files): Write
        (Output_section_incremental_inputs::write_input_files): Write
        in_system_directory flag and argument serial number.
        in_system_directory flag and argument serial number.
        (Output_section_incremental_inputs::write_info_blocks): Map section
        (Output_section_incremental_inputs::write_info_blocks): Map section
        indices between incremental info and original input file; store
        indices between incremental info and original input file; store
        input section index for each symbol.
        input section index for each symbol.
        (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
        (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
        change operator() to visit().
        change operator() to visit().
        (class Global_got_offset_visitor): Likewise.
        (class Global_got_offset_visitor): Likewise.
        (class Global_symbol_visitor_got_plt):
        (class Global_symbol_visitor_got_plt):
        (Output_section_incremental_inputs::write_got_plt): Use new visitor
        (Output_section_incremental_inputs::write_got_plt): Use new visitor
        classes.
        classes.
        (Sized_incr_relobj::Sized_incr_relobj): New constructor.
        (Sized_incr_relobj::Sized_incr_relobj): New constructor.
        (Sized_incr_relobj::do_read_symbols): New function.
        (Sized_incr_relobj::do_read_symbols): New function.
        (Sized_incr_relobj::do_layout): New function.
        (Sized_incr_relobj::do_layout): New function.
        (Sized_incr_relobj::do_layout_deferred_sections): New function.
        (Sized_incr_relobj::do_layout_deferred_sections): New function.
        (Sized_incr_relobj::do_add_symbols): New function.
        (Sized_incr_relobj::do_add_symbols): New function.
        (Sized_incr_relobj::do_should_include_member): New function.
        (Sized_incr_relobj::do_should_include_member): New function.
        (Sized_incr_relobj::do_for_all_global_symbols): New function.
        (Sized_incr_relobj::do_for_all_global_symbols): New function.
        (Sized_incr_relobj::do_for_all_local_got_entries): New function.
        (Sized_incr_relobj::do_for_all_local_got_entries): New function.
        (Sized_incr_relobj::do_section_size): New function.
        (Sized_incr_relobj::do_section_size): New function.
        (Sized_incr_relobj::do_section_name): New function.
        (Sized_incr_relobj::do_section_name): New function.
        (Sized_incr_relobj::do_section_contents): New function.
        (Sized_incr_relobj::do_section_contents): New function.
        (Sized_incr_relobj::do_section_flags): New function.
        (Sized_incr_relobj::do_section_flags): New function.
        (Sized_incr_relobj::do_section_entsize): New function.
        (Sized_incr_relobj::do_section_entsize): New function.
        (Sized_incr_relobj::do_section_address): New function.
        (Sized_incr_relobj::do_section_address): New function.
        (Sized_incr_relobj::do_section_type): New function.
        (Sized_incr_relobj::do_section_type): New function.
        (Sized_incr_relobj::do_section_link): New function.
        (Sized_incr_relobj::do_section_link): New function.
        (Sized_incr_relobj::do_section_info): New function.
        (Sized_incr_relobj::do_section_info): New function.
        (Sized_incr_relobj::do_section_addralign): New function.
        (Sized_incr_relobj::do_section_addralign): New function.
        (Sized_incr_relobj::do_initialize_xindex): New function.
        (Sized_incr_relobj::do_initialize_xindex): New function.
        (Sized_incr_relobj::do_get_global_symbol_counts): New function.
        (Sized_incr_relobj::do_get_global_symbol_counts): New function.
        (Sized_incr_relobj::do_read_relocs): New function.
        (Sized_incr_relobj::do_read_relocs): New function.
        (Sized_incr_relobj::do_gc_process_relocs): New function.
        (Sized_incr_relobj::do_gc_process_relocs): New function.
        (Sized_incr_relobj::do_scan_relocs): New function.
        (Sized_incr_relobj::do_scan_relocs): New function.
        (Sized_incr_relobj::do_count_local_symbols): New function.
        (Sized_incr_relobj::do_count_local_symbols): New function.
        (Sized_incr_relobj::do_finalize_local_symbols): New function.
        (Sized_incr_relobj::do_finalize_local_symbols): New function.
        (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
        (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
        (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
        (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
        (Sized_incr_relobj::do_relocate): New function.
        (Sized_incr_relobj::do_relocate): New function.
        (Sized_incr_relobj::do_set_section_offset): New function.
        (Sized_incr_relobj::do_set_section_offset): New function.
        (Sized_incr_dynobj::Sized_incr_dynobj): New function.
        (Sized_incr_dynobj::Sized_incr_dynobj): New function.
        (Sized_incr_dynobj::do_read_symbols): New function.
        (Sized_incr_dynobj::do_read_symbols): New function.
        (Sized_incr_dynobj::do_layout): New function.
        (Sized_incr_dynobj::do_layout): New function.
        (Sized_incr_dynobj::do_add_symbols): New function.
        (Sized_incr_dynobj::do_add_symbols): New function.
        (Sized_incr_dynobj::do_should_include_member): New function.
        (Sized_incr_dynobj::do_should_include_member): New function.
        (Sized_incr_dynobj::do_for_all_global_symbols): New function.
        (Sized_incr_dynobj::do_for_all_global_symbols): New function.
        (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
        (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
        (Sized_incr_dynobj::do_section_size): New function.
        (Sized_incr_dynobj::do_section_size): New function.
        (Sized_incr_dynobj::do_section_name): New function.
        (Sized_incr_dynobj::do_section_name): New function.
        (Sized_incr_dynobj::do_section_contents): New function.
        (Sized_incr_dynobj::do_section_contents): New function.
        (Sized_incr_dynobj::do_section_flags): New function.
        (Sized_incr_dynobj::do_section_flags): New function.
        (Sized_incr_dynobj::do_section_entsize): New function.
        (Sized_incr_dynobj::do_section_entsize): New function.
        (Sized_incr_dynobj::do_section_address): New function.
        (Sized_incr_dynobj::do_section_address): New function.
        (Sized_incr_dynobj::do_section_type): New function.
        (Sized_incr_dynobj::do_section_type): New function.
        (Sized_incr_dynobj::do_section_link): New function.
        (Sized_incr_dynobj::do_section_link): New function.
        (Sized_incr_dynobj::do_section_info): New function.
        (Sized_incr_dynobj::do_section_info): New function.
        (Sized_incr_dynobj::do_section_addralign): New function.
        (Sized_incr_dynobj::do_section_addralign): New function.
        (Sized_incr_dynobj::do_initialize_xindex): New function.
        (Sized_incr_dynobj::do_initialize_xindex): New function.
        (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
        (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
        (make_sized_incremental_object): New function.
        (make_sized_incremental_object): New function.
        (Incremental_library::copy_unused_symbols): New function.
        (Incremental_library::copy_unused_symbols): New function.
        (Incremental_library::do_for_all_unused_symbols): New function.
        (Incremental_library::do_for_all_unused_symbols): New function.
        * incremental.h (enum Incremental_input_flags): New type.
        * incremental.h (enum Incremental_input_flags): New type.
        (class Incremental_checker): Remove.
        (class Incremental_checker): Remove.
        (Incremental_input_entry::Incremental_input_entry): Add argument
        (Incremental_input_entry::Incremental_input_entry): Add argument
        serial number.
        serial number.
        (Incremental_input_entry::arg_serial): New function.
        (Incremental_input_entry::arg_serial): New function.
        (Incremental_input_entry::set_is_in_system_directory): New function.
        (Incremental_input_entry::set_is_in_system_directory): New function.
        (Incremental_input_entry::is_in_system_directory): New function.
        (Incremental_input_entry::is_in_system_directory): New function.
        (Incremental_input_entry::arg_serial_): New data member.
        (Incremental_input_entry::arg_serial_): New data member.
        (Incremental_input_entry::is_in_system_directory_): New data member.
        (Incremental_input_entry::is_in_system_directory_): New data member.
        (class Script_info): Move here from script.h.
        (class Script_info): Move here from script.h.
        (Script_info::Script_info): Add filename parameter.
        (Script_info::Script_info): Add filename parameter.
        (Script_info::filename): New function.
        (Script_info::filename): New function.
        (Script_info::filename_): New data member.
        (Script_info::filename_): New data member.
        (Incremental_script_entry::Incremental_script_entry): Add argument
        (Incremental_script_entry::Incremental_script_entry): Add argument
        serial number.
        serial number.
        (Incremental_object_entry::Incremental_object_entry): Likewise.
        (Incremental_object_entry::Incremental_object_entry): Likewise.
        (Incremental_object_entry::add_input_section): Build list of input
        (Incremental_object_entry::add_input_section): Build list of input
        sections with map to original shndx.
        sections with map to original shndx.
        (Incremental_object_entry::get_input_section_index): New function.
        (Incremental_object_entry::get_input_section_index): New function.
        (Incremental_object_entry::shndx_): New data member.
        (Incremental_object_entry::shndx_): New data member.
        (Incremental_object_entry::name_key_): Rename; adjust all refs.
        (Incremental_object_entry::name_key_): Rename; adjust all refs.
        (Incremental_object_entry::sh_size_): Rename; adjust all refs.
        (Incremental_object_entry::sh_size_): Rename; adjust all refs.
        (Incremental_archive_entry::Incremental_archive_entry): Add argument
        (Incremental_archive_entry::Incremental_archive_entry): Add argument
        serial number.
        serial number.
        (Incremental_inputs::report_archive_begin): Likewise.
        (Incremental_inputs::report_archive_begin): Likewise.
        (Incremental_inputs::report_object): Likewise.
        (Incremental_inputs::report_object): Likewise.
        (Incremental_inputs::report_script): Likewise.
        (Incremental_inputs::report_script): Likewise.
        (class Incremental_global_symbol_reader): New class.
        (class Incremental_global_symbol_reader): New class.
        (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
        (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
        and store flags and input file type.
        and store flags and input file type.
        (Incremental_input_entry_reader::arg_serial): New function.
        (Incremental_input_entry_reader::arg_serial): New function.
        (Incremental_input_entry_reader::type): Extract type from flags.
        (Incremental_input_entry_reader::type): Extract type from flags.
        (Incremental_input_entry_reader::is_in_system_directory): New function.
        (Incremental_input_entry_reader::is_in_system_directory): New function.
        (Incremental_input_entry_reader::get_input_section_count): Call
        (Incremental_input_entry_reader::get_input_section_count): Call
        accessor function for type.
        accessor function for type.
        (Incremental_input_entry_reader::get_symbol_offset): Call accessor
        (Incremental_input_entry_reader::get_symbol_offset): Call accessor
        function for type; adjust size of global symbol entry.
        function for type; adjust size of global symbol entry.
        (Incremental_input_entry_reader::get_global_symbol_count): Call
        (Incremental_input_entry_reader::get_global_symbol_count): Call
        accessor function for type.
        accessor function for type.
        (Incremental_input_entry_reader::get_object_count): Likewise.
        (Incremental_input_entry_reader::get_object_count): Likewise.
        (Incremental_input_entry_reader::get_object_offset): Likewise.
        (Incremental_input_entry_reader::get_object_offset): Likewise.
        (Incremental_input_entry_reader::get_member_count): Likewise.
        (Incremental_input_entry_reader::get_member_count): Likewise.
        (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
        (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
        (Incremental_input_entry_reader::get_member_offset): Likewise.
        (Incremental_input_entry_reader::get_member_offset): Likewise.
        (Incremental_input_entry_reader::get_unused_symbol): Likewise.
        (Incremental_input_entry_reader::get_unused_symbol): Likewise.
        (Incremental_input_entry_reader::Global_symbol_info): Remove.
        (Incremental_input_entry_reader::Global_symbol_info): Remove.
        (Incremental_input_entry_reader::get_global_symbol_info): Remove.
        (Incremental_input_entry_reader::get_global_symbol_info): Remove.
        (Incremental_input_entry_reader::get_global_symbol_reader): New
        (Incremental_input_entry_reader::get_global_symbol_reader): New
        function.
        function.
        (Incremental_input_entry_reader::get_output_symbol_index): New
        (Incremental_input_entry_reader::get_output_symbol_index): New
        function.
        function.
        (Incremental_input_entry_reader::type_): Remove.
        (Incremental_input_entry_reader::type_): Remove.
        (Incremental_input_entry_reader::flags_): New data member.
        (Incremental_input_entry_reader::flags_): New data member.
        (Incremental_inputs_reader::input_file_offset): New function.
        (Incremental_inputs_reader::input_file_offset): New function.
        (Incremental_inputs_reader::input_file_index): New function.
        (Incremental_inputs_reader::input_file_index): New function.
        (Incremental_inputs_reader::input_file): Call input_file_offset.
        (Incremental_inputs_reader::input_file): Call input_file_offset.
        (Incremental_inputs_reader::input_file_at_offset): New function.
        (Incremental_inputs_reader::input_file_at_offset): New function.
        (Incremental_relocs_reader::get_r_type): Reformat.
        (Incremental_relocs_reader::get_r_type): Reformat.
        (Incremental_relocs_reader::get_r_shndx): Reformat.
        (Incremental_relocs_reader::get_r_shndx): Reformat.
        (Incremental_relocs_reader::get_r_offset): Reformat.
        (Incremental_relocs_reader::get_r_offset): Reformat.
        (Incremental_relocs_reader::data): New function.
        (Incremental_relocs_reader::data): New function.
        (Incremental_binary::Incremental_binary): Initialize new data members.
        (Incremental_binary::Incremental_binary): Initialize new data members.
        (Incremental_binary::check_inputs): Add cmdline parameter.
        (Incremental_binary::check_inputs): Add cmdline parameter.
        (Incremental_binary::file_is_unchanged): Remove.
        (Incremental_binary::file_is_unchanged): Remove.
        (Input_reader::arg_serial): New function.
        (Input_reader::arg_serial): New function.
        (Input_reader::get_unused_symbol_count): New function.
        (Input_reader::get_unused_symbol_count): New function.
        (Input_reader::get_unused_symbol): New function.
        (Input_reader::get_unused_symbol): New function.
        (Input_reader::do_arg_serial): New function.
        (Input_reader::do_arg_serial): New function.
        (Input_reader::do_get_unused_symbol_count): New function.
        (Input_reader::do_get_unused_symbol_count): New function.
        (Input_reader::do_get_unused_symbol): New function.
        (Input_reader::do_get_unused_symbol): New function.
        (Incremental_binary::input_file_count): New function.
        (Incremental_binary::input_file_count): New function.
        (Incremental_binary::get_input_reader): Change signature to use
        (Incremental_binary::get_input_reader): Change signature to use
        index instead of filename.
        index instead of filename.
        (Incremental_binary::file_has_changed): New function.
        (Incremental_binary::file_has_changed): New function.
        (Incremental_binary::get_input_argument): New function.
        (Incremental_binary::get_input_argument): New function.
        (Incremental_binary::get_library): New function.
        (Incremental_binary::get_library): New function.
        (Incremental_binary::get_script_info): New function.
        (Incremental_binary::get_script_info): New function.
        (Incremental_binary::init_layout): New function.
        (Incremental_binary::init_layout): New function.
        (Incremental_binary::reserve_layout): New function.
        (Incremental_binary::reserve_layout): New function.
        (Incremental_binary::output_file): New function.
        (Incremental_binary::output_file): New function.
        (Incremental_binary::do_check_inputs): New function.
        (Incremental_binary::do_check_inputs): New function.
        (Incremental_binary::do_file_is_unchanged): Remove.
        (Incremental_binary::do_file_is_unchanged): Remove.
        (Incremental_binary::do_file_has_changed): New function.
        (Incremental_binary::do_file_has_changed): New function.
        (Incremental_binary::do_init_layout): New function.
        (Incremental_binary::do_init_layout): New function.
        (Incremental_binary::do_reserve_layout): New function.
        (Incremental_binary::do_reserve_layout): New function.
        (Incremental_binary::do_input_file_count): New function.
        (Incremental_binary::do_input_file_count): New function.
        (Incremental_binary::do_get_input_reader): Change signature.
        (Incremental_binary::do_get_input_reader): Change signature.
        (Incremental_binary::input_args_map_): New data member.
        (Incremental_binary::input_args_map_): New data member.
        (Incremental_binary::library_map_): New data member.
        (Incremental_binary::library_map_): New data member.
        (Incremental_binary::script_map_): New data member.
        (Incremental_binary::script_map_): New data member.
        (Sized_incremental_binary::Sized_incremental_binary): Initialize
        (Sized_incremental_binary::Sized_incremental_binary): Initialize
        new data members.
        new data members.
        (Sized_incremental_binary::output_section): New function.
        (Sized_incremental_binary::output_section): New function.
        (Sized_incremental_binary::inputs_reader): Add const.
        (Sized_incremental_binary::inputs_reader): Add const.
        (Sized_incremental_binary::symtab_reader): Add const.
        (Sized_incremental_binary::symtab_reader): Add const.
        (Sized_incremental_binary::relocs_reader): Add const.
        (Sized_incremental_binary::relocs_reader): Add const.
        (Sized_incremental_binary::got_plt_reader): Add const.
        (Sized_incremental_binary::got_plt_reader): Add const.
        (Sized_incremental_binary::get_symtab_view): New function.
        (Sized_incremental_binary::get_symtab_view): New function.
        (Sized_incremental_binary::Inputs_reader): New typedef.
        (Sized_incremental_binary::Inputs_reader): New typedef.
        (Sized_incremental_binary::Input_entry_reader): New typedef.
        (Sized_incremental_binary::Input_entry_reader): New typedef.
        (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
        (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
        (Sized_incremental_binary::do_file_is_unchanged): Remove.
        (Sized_incremental_binary::do_file_is_unchanged): Remove.
        (Sized_incremental_binary::do_file_has_changed): New function.
        (Sized_incremental_binary::do_file_has_changed): New function.
        (Sized_incremental_binary::do_init_layout): New function.
        (Sized_incremental_binary::do_init_layout): New function.
        (Sized_incremental_binary::do_reserve_layout): New function.
        (Sized_incremental_binary::do_reserve_layout): New function.
        (Sized_input_reader::Inputs_reader): Remove.
        (Sized_input_reader::Inputs_reader): Remove.
        (Sized_input_reader::Input_entry_reader): Remove.
        (Sized_input_reader::Input_entry_reader): Remove.
        (Sized_input_reader::do_arg_serial): New function.
        (Sized_input_reader::do_arg_serial): New function.
        (Sized_input_reader::do_get_unused_symbol_count): New function.
        (Sized_input_reader::do_get_unused_symbol_count): New function.
        (Sized_input_reader::do_get_unused_symbol): New function.
        (Sized_input_reader::do_get_unused_symbol): New function.
        (Sized_incremental_binary::do_input_file_count): New function.
        (Sized_incremental_binary::do_input_file_count): New function.
        (Sized_incremental_binary::do_get_input_reader): Change signature;
        (Sized_incremental_binary::do_get_input_reader): Change signature;
        use index instead of filename.
        use index instead of filename.
        (Sized_incremental_binary::section_map_): New data member.
        (Sized_incremental_binary::section_map_): New data member.
        (Sized_incremental_binary::input_entry_readers_): New data member.
        (Sized_incremental_binary::input_entry_readers_): New data member.
        (class Sized_incr_relobj): New class.
        (class Sized_incr_relobj): New class.
        (class Sized_incr_dynobj): New class.
        (class Sized_incr_dynobj): New class.
        (make_sized_incremental_object): New function.
        (make_sized_incremental_object): New function.
        (class Incremental_library): New class.
        (class Incremental_library): New class.
        * layout.cc (Free_list::num_lists): New static data member.
        * layout.cc (Free_list::num_lists): New static data member.
        (Free_list::num_nodes): New static data member.
        (Free_list::num_nodes): New static data member.
        (Free_list::num_removes): New static data member.
        (Free_list::num_removes): New static data member.
        (Free_list::num_remove_visits): New static data member.
        (Free_list::num_remove_visits): New static data member.
        (Free_list::num_allocates): New static data member.
        (Free_list::num_allocates): New static data member.
        (Free_list::num_allocate_visits): New static data member.
        (Free_list::num_allocate_visits): New static data member.
        (Free_list::init): New function.
        (Free_list::init): New function.
        (Free_list::remove): New function.
        (Free_list::remove): New function.
        (Free_list::allocate): New function.
        (Free_list::allocate): New function.
        (Free_list::dump): New function.
        (Free_list::dump): New function.
        (Free_list::print_stats): New function.
        (Free_list::print_stats): New function.
        (Layout_task_runner::run): Resize output file for incremental updates.
        (Layout_task_runner::run): Resize output file for incremental updates.
        (Layout::Layout): Initialize new data members.
        (Layout::Layout): Initialize new data members.
        (Layout::set_incremental_base): New function.
        (Layout::set_incremental_base): New function.
        (Layout::init_fixed_output_section): New function.
        (Layout::init_fixed_output_section): New function.
        (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
        (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
        incremental updates.
        incremental updates.
        (Layout::create_gold_note): Do not create gold note section for
        (Layout::create_gold_note): Do not create gold note section for
        incremental updates.
        incremental updates.
        (Layout::set_segment_offsets): Do not recalculate RELRO alignment
        (Layout::set_segment_offsets): Do not recalculate RELRO alignment
        for incremental updates.
        for incremental updates.
        (Layout::set_section_offsets): For incremental updates, allocate space
        (Layout::set_section_offsets): For incremental updates, allocate space
        from free list.
        from free list.
        (Layout::create_symtab_sections): Layout with offsets relative to
        (Layout::create_symtab_sections): Layout with offsets relative to
        start of section; for incremental updates, allocate space from free
        start of section; for incremental updates, allocate space from free
        list.
        list.
        (Layout::create_shdrs): For incremental updates, allocate space from
        (Layout::create_shdrs): For incremental updates, allocate space from
        free list.
        free list.
        (Layout::finish_dynamic_section): For incremental updates, do not
        (Layout::finish_dynamic_section): For incremental updates, do not
        check --as-needed (fixed in subsequent patch).
        check --as-needed (fixed in subsequent patch).
        * layout.h (class Free_list): New class.
        * layout.h (class Free_list): New class.
        (Layout::set_incremental_base): New function.
        (Layout::set_incremental_base): New function.
        (Layout::incremental_base): New function.
        (Layout::incremental_base): New function.
        (Layout::init_fixed_output_section): New function.
        (Layout::init_fixed_output_section): New function.
        (Layout::allocate): New function.
        (Layout::allocate): New function.
        (Layout::incremental_base_): New data member.
        (Layout::incremental_base_): New data member.
        (Layout::free_list_): New data member.
        (Layout::free_list_): New data member.
        * main.cc (main): Print Free_list statistics.
        * main.cc (main): Print Free_list statistics.
        * object.cc (Relobj::finalize_incremental_relocs): Add
        * object.cc (Relobj::finalize_incremental_relocs): Add
        clear_counts parameter; clear counts only when clear_counts is set.
        clear_counts parameter; clear counts only when clear_counts is set.
        (Sized_relobj::Sized_relobj): Initialize new base class.
        (Sized_relobj::Sized_relobj): Initialize new base class.
        (Sized_relobj::do_layout): Don't report special sections.
        (Sized_relobj::do_layout): Don't report special sections.
        (Sized_relobj::do_for_all_local_got_entries): New function.
        (Sized_relobj::do_for_all_local_got_entries): New function.
        (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
        (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
        symtab_off to all symbol table offsets.
        symtab_off to all symbol table offsets.
        (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
        (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
        * object.h (class Got_offset_list): Move to top of file.
        * object.h (class Got_offset_list): Move to top of file.
        (Object::Object): Allow case where input_file == NULL.
        (Object::Object): Allow case where input_file == NULL.
        (Object::~Object): Likewise.
        (Object::~Object): Likewise.
        (Object::input_file): Assert that input_file != NULL.
        (Object::input_file): Assert that input_file != NULL.
        (Object::lock): Allow case where input_file == NULL.
        (Object::lock): Allow case where input_file == NULL.
        (Object::unlock): Likewise.
        (Object::unlock): Likewise.
        (Object::is_locked): Likewise.
        (Object::is_locked): Likewise.
        (Object::token): Likewise.
        (Object::token): Likewise.
        (Object::release): Likewise.
        (Object::release): Likewise.
        (Object::is_incremental): New function.
        (Object::is_incremental): New function.
        (Object::get_mtime): New function.
        (Object::get_mtime): New function.
        (Object::for_all_local_got_entries): New function.
        (Object::for_all_local_got_entries): New function.
        (Object::clear_view_cache_marks): Allow case where input_file == NULL.
        (Object::clear_view_cache_marks): Allow case where input_file == NULL.
        (Object::set_is_in_system_directory): New function.
        (Object::set_is_in_system_directory): New function.
        (Object::is_in_system_directory): New function.
        (Object::is_in_system_directory): New function.
        (Object::do_is_incremental): New function.
        (Object::do_is_incremental): New function.
        (Object::do_get_mtime): New function.
        (Object::do_get_mtime): New function.
        (Object::do_for_all_local_got_entries): New function.
        (Object::do_for_all_local_got_entries): New function.
        (Object::is_in_system_directory_): New data member.
        (Object::is_in_system_directory_): New data member.
        (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
        (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
        (class Sized_relobj_base): New class.
        (class Sized_relobj_base): New class.
        (class Sized_relobj): Derive from Sized_relobj_base.
        (class Sized_relobj): Derive from Sized_relobj_base.
        (class Sized_relobj::Symbols): Redeclare from base class.
        (class Sized_relobj::Symbols): Redeclare from base class.
        (class Sized_relobj::local_got_offset_list): Remove.
        (class Sized_relobj::local_got_offset_list): Remove.
        (class Sized_relobj::Output_sections): Redeclare from base class.
        (class Sized_relobj::Output_sections): Redeclare from base class.
        (class Sized_relobj::do_for_all_local_got_entries): New function.
        (class Sized_relobj::do_for_all_local_got_entries): New function.
        (class Sized_relobj::write_local_symbols): Add offset parameter.
        (class Sized_relobj::write_local_symbols): Add offset parameter.
        (class Sized_relobj::local_symbol_offset_): Update comment.
        (class Sized_relobj::local_symbol_offset_): Update comment.
        (class Sized_relobj::local_dynsym_offset_): Update comment.
        (class Sized_relobj::local_dynsym_offset_): Update comment.
        * options.cc (Input_arguments::add_file): Remove const.
        * options.cc (Input_arguments::add_file): Remove const.
        * options.h (Input_file_argument::Input_file_argument):
        * options.h (Input_file_argument::Input_file_argument):
        Initialize arg_serial_ (all constructors).
        Initialize arg_serial_ (all constructors).
        (Input_file_argument::set_arg_serial): New function.
        (Input_file_argument::set_arg_serial): New function.
        (Input_file_argument::arg_serial): New function.
        (Input_file_argument::arg_serial): New function.
        (Input_file_argument::arg_serial_): New data member.
        (Input_file_argument::arg_serial_): New data member.
        (Input_arguments::Input_arguments): Initialize file_count_.
        (Input_arguments::Input_arguments): Initialize file_count_.
        (Input_arguments::add_file): Remove const.
        (Input_arguments::add_file): Remove const.
        (Input_arguments::number_of_input_files): New function.
        (Input_arguments::number_of_input_files): New function.
        (Input_arguments::file_count_): New data member.
        (Input_arguments::file_count_): New data member.
        (Command_line::number_of_input_files): Call
        (Command_line::number_of_input_files): Call
        Input_arguments::number_of_input_files.
        Input_arguments::number_of_input_files.
        * output.cc (Output_segment_headers::Output_segment_headers):
        * output.cc (Output_segment_headers::Output_segment_headers):
        Set current size.
        Set current size.
        (Output_section::Input_section::current_data_size): New function.
        (Output_section::Input_section::current_data_size): New function.
        (Output_section::Output_section): Initialize new data members.
        (Output_section::Output_section): Initialize new data members.
        (Output_section::add_input_section): Don't do merge sections for
        (Output_section::add_input_section): Don't do merge sections for
        an incremental link; allocate space from free list for an
        an incremental link; allocate space from free list for an
        incremental update.
        incremental update.
        (Output_section::add_output_section_data): Allocate space from
        (Output_section::add_output_section_data): Allocate space from
        free list for an incremental update.
        free list for an incremental update.
        (Output_section::update_data_size): New function.
        (Output_section::update_data_size): New function.
        (Output_section::set_fixed_layout): New function.
        (Output_section::set_fixed_layout): New function.
        (Output_section::reserve): New function.
        (Output_section::reserve): New function.
        (Output_segment::set_section_addresses): Remove const.
        (Output_segment::set_section_addresses): Remove const.
        (Output_segment::set_section_list_addresses): Remove const; allocate
        (Output_segment::set_section_list_addresses): Remove const; allocate
        space from free list for an incremental update.
        space from free list for an incremental update.
        (Output_segment::set_offset): Adjust size of RELRO segment for an
        (Output_segment::set_offset): Adjust size of RELRO segment for an
        incremental update.
        incremental update.
        * output.h (Output_data::current_data_size): Move here from
        * output.h (Output_data::current_data_size): Move here from
        child classes.
        child classes.
        (Output_data::pre_finalize_data_size): New function.
        (Output_data::pre_finalize_data_size): New function.
        (Output_data::update_data_size): New function.
        (Output_data::update_data_size): New function.
        (Output_section_headers::update_data_size): new function.
        (Output_section_headers::update_data_size): new function.
        (Output_section_data_build::current_data_size): Move to Output_data.
        (Output_section_data_build::current_data_size): Move to Output_data.
        (Output_data_strtab::update_data_size): New function.
        (Output_data_strtab::update_data_size): New function.
        (Output_section::current_data_size): Move to Output_data.
        (Output_section::current_data_size): Move to Output_data.
        (Output_section::set_fixed_layout): New function.
        (Output_section::set_fixed_layout): New function.
        (Output_section::has_fixed_layout): New function.
        (Output_section::has_fixed_layout): New function.
        (Output_section::reserve): New function.
        (Output_section::reserve): New function.
        (Output_section::update_data_size): New function.
        (Output_section::update_data_size): New function.
        (Output_section::has_fixed_layout_): New data member.
        (Output_section::has_fixed_layout_): New data member.
        (Output_section::free_list_): New data member.
        (Output_section::free_list_): New data member.
        (Output_segment::set_section_addresses): Remove const.
        (Output_segment::set_section_addresses): Remove const.
        (Output_segment::set_section_list_addresses): Remove const.
        (Output_segment::set_section_list_addresses): Remove const.
        * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
        * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
        New function.
        New function.
        * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
        * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
        New function.
        New function.
        * readsyms.cc (Read_symbols::do_read_symbols): Add library
        * readsyms.cc (Read_symbols::do_read_symbols): Add library
        parameter when calling Add_symbols constructor; store argument
        parameter when calling Add_symbols constructor; store argument
        serial number for members of a lib group.
        serial number for members of a lib group.
        (Add_symbols::locks): Allow case where token == NULL.
        (Add_symbols::locks): Allow case where token == NULL.
        (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
        (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
        (Read_member::~Read_member): New function.
        (Read_member::~Read_member): New function.
        (Read_member::is_runnable): New function.
        (Read_member::is_runnable): New function.
        (Read_member::locks): New function.
        (Read_member::locks): New function.
        (Read_member::run): New function.
        (Read_member::run): New function.
        (Check_script::~Check_script): New function.
        (Check_script::~Check_script): New function.
        (Check_script::is_runnable): New function.
        (Check_script::is_runnable): New function.
        (Check_script::locks): New function.
        (Check_script::locks): New function.
        (Check_script::run): New function.
        (Check_script::run): New function.
        (Check_library::~Check_library): New function.
        (Check_library::~Check_library): New function.
        (Check_library::is_runnable): New function.
        (Check_library::is_runnable): New function.
        (Check_library::locks): New function.
        (Check_library::locks): New function.
        (Check_library::run): New function.
        (Check_library::run): New function.
        * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
        * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
        (Add_symbols::library_): New data member.
        (Add_symbols::library_): New data member.
        (class Read_member): New class.
        (class Read_member): New class.
        (class Check_script): New class.
        (class Check_script): New class.
        (class Check_library): New class.
        (class Check_library): New class.
        * reloc.cc (Read_relocs::is_runnable): Allow case where
        * reloc.cc (Read_relocs::is_runnable): Allow case where
        token == NULL.
        token == NULL.
        (Read_relocs::locks): Likewise.
        (Read_relocs::locks): Likewise.
        (Scan_relocs::locks): Likewise.
        (Scan_relocs::locks): Likewise.
        (Relocate_task::locks): Likewise.
        (Relocate_task::locks): Likewise.
        (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
        (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
        to clear counters.
        to clear counters.
        (Sized_relobj::incremental_relocs_scan): Fix comment.
        (Sized_relobj::incremental_relocs_scan): Fix comment.
        (Sized_relobj::do_relocate): Pass output file offset to
        (Sized_relobj::do_relocate): Pass output file offset to
        write_local_symbols.
        write_local_symbols.
        (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
        (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
        from class declaration.
        from class declaration.
        * script.cc (read_input_script): Allocate Script_info; pass
        * script.cc (read_input_script): Allocate Script_info; pass
        argument serial number to report_script.
        argument serial number to report_script.
        * script.h (class Script_info): Move to incremental.h.
        * script.h (class Script_info): Move to incremental.h.
        * symtab.cc (Symbol_table::add_from_incrobj): New function.
        * symtab.cc (Symbol_table::add_from_incrobj): New function.
        * symtab.h (Symbol_table::add_from_incrobj): New function.
        * symtab.h (Symbol_table::add_from_incrobj): New function.
        (Symbol_table::set_file_offset): New function.
        (Symbol_table::set_file_offset): New function.
2011-04-05  Cary Coutant  
2011-04-05  Cary Coutant  
        * incremental-dump.cc (dump_incremental_inputs): Change signature
        * incremental-dump.cc (dump_incremental_inputs): Change signature
        to take a Sized_incremental_binary; change caller.  Use readers
        to take a Sized_incremental_binary; change caller.  Use readers
        in Sized_incremental_binary.
        in Sized_incremental_binary.
        * incremental.cc
        * incremental.cc
        (Sized_incremental_binary::find_incremental_inputs_sections):
        (Sized_incremental_binary::find_incremental_inputs_sections):
        Rename do_find_incremental_inputs_sections to this.
        Rename do_find_incremental_inputs_sections to this.
        (Sized_incremental_binary::setup_readers): New function.
        (Sized_incremental_binary::setup_readers): New function.
        (Sized_incremental_binary::do_check_inputs): Check
        (Sized_incremental_binary::do_check_inputs): Check
        has_incremental_info_ flag; move setup code to setup_readers;
        has_incremental_info_ flag; move setup code to setup_readers;
        use input readers.
        use input readers.
        (Sized_incremental_binary::do_file_is_unchanged): New function.
        (Sized_incremental_binary::do_file_is_unchanged): New function.
        (Sized_incremental_binary::do_get_input_reader): New function.
        (Sized_incremental_binary::do_get_input_reader): New function.
        * incremental.h (class Incremental_binary): Move to end of file.
        * incremental.h (class Incremental_binary): Move to end of file.
        (Incremental_binary::file_is_unchanged): New function.
        (Incremental_binary::file_is_unchanged): New function.
        (Incremental_binary::do_file_is_unchanged): New function.
        (Incremental_binary::do_file_is_unchanged): New function.
        (Incremental_binary::Input_reader): New class.
        (Incremental_binary::Input_reader): New class.
        (Incremental_binary::get_input_reader): New function.
        (Incremental_binary::get_input_reader): New function.
        (class Sized_incremental_binary): Move to end of file.
        (class Sized_incremental_binary): Move to end of file.
        (Sized_incremental_binary::Sized_incremental_binary): Setup the
        (Sized_incremental_binary::Sized_incremental_binary): Setup the
        input section reader classes.
        input section reader classes.
        (Sized_incremental_binary::has_incremental_info): New function.
        (Sized_incremental_binary::has_incremental_info): New function.
        (Sized_incremental_binary::inputs_reader): New function.
        (Sized_incremental_binary::inputs_reader): New function.
        (Sized_incremental_binary::symtab_reader): New function.
        (Sized_incremental_binary::symtab_reader): New function.
        (Sized_incremental_binary::relocs_reader): New function.
        (Sized_incremental_binary::relocs_reader): New function.
        (Sized_incremental_binary::got_plt_reader): New function.
        (Sized_incremental_binary::got_plt_reader): New function.
        (Sized_incremental_binary::do_file_is_unchanged): New function.
        (Sized_incremental_binary::do_file_is_unchanged): New function.
        (Sized_incremental_binary::Sized_input_reader): New class.
        (Sized_incremental_binary::Sized_input_reader): New class.
        (Sized_incremental_binary::get_input_reader): New function.
        (Sized_incremental_binary::get_input_reader): New function.
        (Sized_incremental_binary::find_incremental_inputs_sections):
        (Sized_incremental_binary::find_incremental_inputs_sections):
        Rename do_find_incremental_inputs_sections to this.
        Rename do_find_incremental_inputs_sections to this.
        (Sized_incremental_binary::setup_readers): New function.
        (Sized_incremental_binary::setup_readers): New function.
        (Sized_incremental_binary::has_incremental_info_): New data member.
        (Sized_incremental_binary::has_incremental_info_): New data member.
        (Sized_incremental_binary::inputs_reader_): New data member.
        (Sized_incremental_binary::inputs_reader_): New data member.
        (Sized_incremental_binary::symtab_reader_): New data member.
        (Sized_incremental_binary::symtab_reader_): New data member.
        (Sized_incremental_binary::relocs_reader_): New data member.
        (Sized_incremental_binary::relocs_reader_): New data member.
        (Sized_incremental_binary::got_plt_reader_): New data member.
        (Sized_incremental_binary::got_plt_reader_): New data member.
        (Sized_incremental_binary::current_input_file_): New data member.
        (Sized_incremental_binary::current_input_file_): New data member.
2011-04-05  Paul Pluzhnikov  
2011-04-05  Paul Pluzhnikov  
        PR gold/12640
        PR gold/12640
        * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
        * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
        violation.
        violation.
2011-03-30  Cary Coutant  
2011-03-30  Cary Coutant  
        * archive.cc (Archive::include_member): Adjust call to report_object.
        * archive.cc (Archive::include_member): Adjust call to report_object.
        (Add_archive_symbols::run): Add script_info to call to
        (Add_archive_symbols::run): Add script_info to call to
        report_archive_begin.
        report_archive_begin.
        (Lib_group::include_member): Adjust call to report_object.
        (Lib_group::include_member): Adjust call to report_object.
        (Add_lib_group_symbols::run): Adjust call to report_object.
        (Add_lib_group_symbols::run): Adjust call to report_object.
        * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
        * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
        blocks.  Add object count for script input files.
        blocks.  Add object count for script input files.
        * incremental.cc (Incremental_inputs::report_archive_begin): Add
        * incremental.cc (Incremental_inputs::report_archive_begin): Add
        script_info parameter; change all callers.
        script_info parameter; change all callers.
        (Incremental_inputs::report_object): Add script_info parameter;
        (Incremental_inputs::report_object): Add script_info parameter;
        change all callers.
        change all callers.
        (Incremental_inputs::report_script): Store backpointer to
        (Incremental_inputs::report_script): Store backpointer to
        incremental info entry.
        incremental info entry.
        (Output_section_incremental_inputs::set_final_data_size): Record
        (Output_section_incremental_inputs::set_final_data_size): Record
        additional information for scripts.
        additional information for scripts.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
        * incremental.h (Incremental_script_entry::add_object): New function.
        * incremental.h (Incremental_script_entry::add_object): New function.
        (Incremental_script_entry::get_object_count): New function.
        (Incremental_script_entry::get_object_count): New function.
        (Incremental_script_entry::get_object): New function.
        (Incremental_script_entry::get_object): New function.
        (Incremental_script_entry::objects_): New data member; adjust
        (Incremental_script_entry::objects_): New data member; adjust
        constructor.
        constructor.
        (Incremental_inputs::report_archive_begin): Add script_info parameter.
        (Incremental_inputs::report_archive_begin): Add script_info parameter.
        (Incremental_inputs::report_object): Add script_info parameter.
        (Incremental_inputs::report_object): Add script_info parameter.
        (Incremental_inputs_reader::get_object_count): New function.
        (Incremental_inputs_reader::get_object_count): New function.
        (Incremental_inputs_reader::get_object_offset): New function.
        (Incremental_inputs_reader::get_object_offset): New function.
        * options.cc (Input_arguments::add_file): Return reference to
        * options.cc (Input_arguments::add_file): Return reference to
        new input argument.
        new input argument.
        * options.h (Input_argument::set_script_info): New function.
        * options.h (Input_argument::set_script_info): New function.
        (Input_argument::script_info): New function.
        (Input_argument::script_info): New function.
        (Input_argument::script_info_): New data member; adjust all
        (Input_argument::script_info_): New data member; adjust all
        constructors.
        constructors.
        (Input_file_group::add_file): Return reference to new input argument.
        (Input_file_group::add_file): Return reference to new input argument.
        (Input_file_lib::add_file): Likewise.
        (Input_file_lib::add_file): Likewise.
        (Input_arguments::add_file): Likewise.
        (Input_arguments::add_file): Likewise.
        * readsyms.cc (Add_symbols::run): Adjust call to report_object.
        * readsyms.cc (Add_symbols::run): Adjust call to report_object.
        * script.cc (Parser_closure::Parser_closure): Add script_info
        * script.cc (Parser_closure::Parser_closure): Add script_info
        parameter; adjust all callers.
        parameter; adjust all callers.
        (Parser_closure::script_info): New function.
        (Parser_closure::script_info): New function.
        (Parser_closure::script_info_): New data member.
        (Parser_closure::script_info_): New data member.
        (read_input_script): Report scripts earlier to incremental info.
        (read_input_script): Report scripts earlier to incremental info.
        (script_add_file): Set script_info in Input_argument.
        (script_add_file): Set script_info in Input_argument.
        (script_add_library): Likewise.
        (script_add_library): Likewise.
        * script.h (Script_options::Script_info): Rewrite class.
        * script.h (Script_options::Script_info): Rewrite class.
2011-03-29  Cary Coutant  
2011-03-29  Cary Coutant  
        * archive.cc (Library_base::should_include_member): Move
        * archive.cc (Library_base::should_include_member): Move
        method here from class Archive.
        method here from class Archive.
        (Archive::Archive): Initialize base class.
        (Archive::Archive): Initialize base class.
        (Archive::should_include_member): Move to base class.
        (Archive::should_include_member): Move to base class.
        (Archive::do_for_all_unused_symbols): New function.
        (Archive::do_for_all_unused_symbols): New function.
        (Add_archive_symbols::run): Remove redundant access to
        (Add_archive_symbols::run): Remove redundant access to
        incremental_inputs.
        incremental_inputs.
        (Lib_group::Lib_group): Initialize base class.
        (Lib_group::Lib_group): Initialize base class.
        (Lib_group::do_filename): New function.
        (Lib_group::do_filename): New function.
        (Lib_group::include_member): Pass pointer to Lib_group to
        (Lib_group::include_member): Pass pointer to Lib_group to
        report_object.
        report_object.
        (Lib_group::do_for_all_unused_symbols): New function.
        (Lib_group::do_for_all_unused_symbols): New function.
        (Add_lib_group_symbols::run): Report archive information for
        (Add_lib_group_symbols::run): Report archive information for
        incremental links.
        incremental links.
        * archive.h (class Library_base): New base class.
        * archive.h (class Library_base): New base class.
        (class Archive): Derive from Library_base.
        (class Archive): Derive from Library_base.
        (Archive::filename): Move to base class.
        (Archive::filename): Move to base class.
        (Archive::set_incremental_info): Likewise.
        (Archive::set_incremental_info): Likewise.
        (Archive::incremental_info): Likewise.
        (Archive::incremental_info): Likewise.
        (Archive::Should_include): Likewise.
        (Archive::Should_include): Likewise.
        (Archive::should_include_member): Likewise.
        (Archive::should_include_member): Likewise.
        (Archive::Armap_entry): Remove.
        (Archive::Armap_entry): Remove.
        (Archive::Unused_symbol_iterator): Remove.
        (Archive::Unused_symbol_iterator): Remove.
        (Archive::unused_symbols_begin): Remove.
        (Archive::unused_symbols_begin): Remove.
        (Archive::unused_symbols_end): Remove.
        (Archive::unused_symbols_end): Remove.
        (Archive::do_filename): New function.
        (Archive::do_filename): New function.
        (Archive::do_get_mtime): New function.
        (Archive::do_get_mtime): New function.
        (Archive::do_for_all_unused_symbols): New function.
        (Archive::do_for_all_unused_symbols): New function.
        (Archive::task_): Move to base class.
        (Archive::task_): Move to base class.
        (Archive::incremental_info_): Likewise.
        (Archive::incremental_info_): Likewise.
        (class Lib_group): Derive from Library_base.
        (class Lib_group): Derive from Library_base.
        (Lib_group::do_filename): New function.
        (Lib_group::do_filename): New function.
        (Lib_group::do_get_mtime): New function.
        (Lib_group::do_get_mtime): New function.
        (Lib_group::do_for_all_unused_symbols): New function.
        (Lib_group::do_for_all_unused_symbols): New function.
        (Lib_group::task_): Move to base class.
        (Lib_group::task_): Move to base class.
        * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
        * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
        function.
        function.
        * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
        * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
        function.
        function.
        * incremental.cc (Incremental_inputs::report_archive_begin):
        * incremental.cc (Incremental_inputs::report_archive_begin):
        Use Library_base; call library's get_mtime; add incremental inputs
        Use Library_base; call library's get_mtime; add incremental inputs
        entry before members.
        entry before members.
        (class Unused_symbol_visitor): New class.
        (class Unused_symbol_visitor): New class.
        (Incremental_inputs::report_archive_end): Use Library_base; use
        (Incremental_inputs::report_archive_end): Use Library_base; use
        visitor class to record unused symbols; don't add incremental inputs
        visitor class to record unused symbols; don't add incremental inputs
        entry after members.
        entry after members.
        (Incremental_inputs::report_object): Use Library_base.
        (Incremental_inputs::report_object): Use Library_base.
        * incremental.h
        * incremental.h
        (Incremental_archive_entry::Incremental_archive_entry): Remove
        (Incremental_archive_entry::Incremental_archive_entry): Remove
        unused Archive parameter.
        unused Archive parameter.
        (Incremental_inputs::report_archive_begin): Use Library_base.
        (Incremental_inputs::report_archive_begin): Use Library_base.
        (Incremental_inputs::report_archive_end): Likewise.
        (Incremental_inputs::report_archive_end): Likewise.
        (Incremental_inputs::report_object): Likewise.
        (Incremental_inputs::report_object): Likewise.
        * object.cc (Sized_relobj::do_for_all_global_symbols): New
        * object.cc (Sized_relobj::do_for_all_global_symbols): New
        function.
        function.
        * object.h (Object::for_all_global_symbols): New function.
        * object.h (Object::for_all_global_symbols): New function.
        (Object::do_for_all_global_symbols): New function.
        (Object::do_for_all_global_symbols): New function.
        (Sized_relobj::do_for_all_global_symbols): New function.
        (Sized_relobj::do_for_all_global_symbols): New function.
        * plugin.cc (Sized_pluginobj::do_for_all_global_symbols):  New
        * plugin.cc (Sized_pluginobj::do_for_all_global_symbols):  New
        function.
        function.
        * plugin.h (Sized_pluginobj::do_for_all_global_symbols):  New
        * plugin.h (Sized_pluginobj::do_for_all_global_symbols):  New
        function.
        function.
2011-03-27  Ian Lance Taylor  
2011-03-27  Ian Lance Taylor  
        * archive.cc (Archive::interpret_header): Return -1 if something
        * archive.cc (Archive::interpret_header): Return -1 if something
        goes wrong.  Change callers accordingly.
        goes wrong.  Change callers accordingly.
2011-03-25  Cary Coutant  
2011-03-25  Cary Coutant  
        * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
        * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2011-03-23  Rafael Ávila de Espíndola 
2011-03-23  Rafael Ávila de Espíndola 
        * plugin.cc (get_view): New.
        * plugin.cc (get_view): New.
        (Plugin::load): Pass get_view to the plugin.
        (Plugin::load): Pass get_view to the plugin.
        (Plugin_manager::get_view): New.
        (Plugin_manager::get_view): New.
2011-03-21  Ian Lance Taylor  
2011-03-21  Ian Lance Taylor  
        * testsuite/final_layout.sh: Rewrite to not use dc.
        * testsuite/final_layout.sh: Rewrite to not use dc.
        * testsuite/relro_test.sh: Fail if dc is not present.
        * testsuite/relro_test.sh: Fail if dc is not present.
2011-03-21  Sriraman Tallam  
2011-03-21  Sriraman Tallam  
        * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
        Change == to -eq.
        Change == to -eq.
        * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
        Change == to -eq.
        Change == to -eq.
        * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
        * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2011-03-14  Ian Lance Taylor  
2011-03-14  Ian Lance Taylor  
        * script-sections.cc (Sort_output_sections::script_compare):
        * script-sections.cc (Sort_output_sections::script_compare):
        Rename from is_before, change return type.
        Rename from is_before, change return type.
        (Sort_output_sections::operator()): Adjust accordingly.
        (Sort_output_sections::operator()): Adjust accordingly.
2011-03-11  Jeffrey Yasskin  
2011-03-11  Jeffrey Yasskin  
        PR gold/12572
        PR gold/12572
        * testsuite/odr_violation2.cc: Add comment to make all error line
        * testsuite/odr_violation2.cc: Add comment to make all error line
        numbers double digits.
        numbers double digits.
        * testsuite/debug_msg.sh: Adjust expected errors.
        * testsuite/debug_msg.sh: Adjust expected errors.
2011-03-09  Jeffrey Yasskin  
2011-03-09  Jeffrey Yasskin  
        * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
        * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
        but mark earlier ones as non-canonical
        but mark earlier ones as non-canonical
        (offset_to_iterator): Update search target and example
        (offset_to_iterator): Update search target and example
        (do_addr2line): Return extra lines in a vector*
        (do_addr2line): Return extra lines in a vector*
        (format_file_lineno): Extract from do_addr2line
        (format_file_lineno): Extract from do_addr2line
        (one_addr2line): Add vector* out-param
        (one_addr2line): Add vector* out-param
        * dwarf_reader.h (Offset_to_lineno_entry): New field recording
        * dwarf_reader.h (Offset_to_lineno_entry): New field recording
        when a lineno entry appeared last for its instruction
        when a lineno entry appeared last for its instruction
        (Dwarf_line_info): Add vector* out-param
        (Dwarf_line_info): Add vector* out-param
        * object.cc (Relocate_info): Pass NULL for the vector* out-param
        * object.cc (Relocate_info): Pass NULL for the vector* out-param
        * symtab.cc (Odr_violation_compare): Include the lineno in the
        * symtab.cc (Odr_violation_compare): Include the lineno in the
        comparison again.
        comparison again.
        (linenos_from_loc): New. Combine the canonical line for an
        (linenos_from_loc): New. Combine the canonical line for an
        address with its other lines.
        address with its other lines.
        (True_if_intersect): New. Helper functor to make
        (True_if_intersect): New. Helper functor to make
        std::set_intersection a query.
        std::set_intersection a query.
        (detect_odr_violations): Compare sets of lines instead of just
        (detect_odr_violations): Compare sets of lines instead of just
        one line for each function. This became less deterministic, but
        one line for each function. This became less deterministic, but
        has fewer false positives.
        has fewer false positives.
        * symtab.h: Declarations.
        * symtab.h: Declarations.
        * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
        * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
        mix an optimized and non-optimized object in the same binary
        mix an optimized and non-optimized object in the same binary
        (odr_violation2.so): Same.
        (odr_violation2.so): Same.
        * testsuite/Makefile.in: Regenerate from Makefile.am.
        * testsuite/Makefile.in: Regenerate from Makefile.am.
        * testsuite/debug_msg.cc (main): Make OdrDerived classes.
        * testsuite/debug_msg.cc (main): Make OdrDerived classes.
        * testsuite/debug_msg.sh: Update line numbers and add
        * testsuite/debug_msg.sh: Update line numbers and add
        assertions.
        assertions.
        * testsuite/odr_violation1.cc: Use OdrDerived, in a
        * testsuite/odr_violation1.cc: Use OdrDerived, in a
        non-optimized context.
        non-optimized context.
        * testsuite/odr_violation2.cc: Make sure Ordering::operator()
        * testsuite/odr_violation2.cc: Make sure Ordering::operator()
        isn't inlined, and use OdrDerived in an optimized context.
        isn't inlined, and use OdrDerived in an optimized context.
        * testsuite/odr_header1.h: Defines OdrDerived, where
        * testsuite/odr_header1.h: Defines OdrDerived, where
        optimization will change the
        optimization will change the
        first-instruction-in-the-destructor's file and line number.
        first-instruction-in-the-destructor's file and line number.
        * testsuite/odr_header2.h: Defines OdrBase.
        * testsuite/odr_header2.h: Defines OdrBase.
2011-03-09  Ian Lance Taylor  
2011-03-09  Ian Lance Taylor  
        * fileread.cc (File_read::clear_views): Don't delete the whole
        * fileread.cc (File_read::clear_views): Don't delete the whole
        file view.
        file view.
2011-03-08  Ian Lance Taylor  
2011-03-08  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        * fileread.cc: #include .
        * fileread.cc: #include .
        (GOLD_IOV_MAX): Define.
        (GOLD_IOV_MAX): Define.
        (File_read::read_multiple): Limit number of entries by iov_max.
        (File_read::read_multiple): Limit number of entries by iov_max.
        * fileread.h (class File_read): Always set max_readv_entries to
        * fileread.h (class File_read): Always set max_readv_entries to
        128.
        128.
2011-03-07  Ian Lance Taylor  
2011-03-07  Ian Lance Taylor  
        PR gold/12525
        PR gold/12525
        * options.h (class General_options): Add -dy and -dn.
        * options.h (class General_options): Add -dy and -dn.
2011-03-02  Cary Coutant  
2011-03-02  Cary Coutant  
        * testsuite/script_test_9.t: Add TLS segment.
        * testsuite/script_test_9.t: Add TLS segment.
2011-03-02  Simon Baldwin  
2011-03-02  Simon Baldwin  
        * configure.ac: Add check for gnu_indirect_function support in
        * configure.ac: Add check for gnu_indirect_function support in
        the toolchain building binutils.
        the toolchain building binutils.
        * configure: Rebuild.
        * configure: Rebuild.
2011-02-18  Rafael Ávila de Espíndola 
2011-02-18  Rafael Ávila de Espíndola 
        * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
        * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
        plugin only symbols.
        plugin only symbols.
        (Symbol_table::sized_finalize_symbol) Mark symbol only present
        (Symbol_table::sized_finalize_symbol) Mark symbol only present
        in plugin files as not needed in the symbol table.
        in plugin files as not needed in the symbol table.
2011-02-11  Sriraman Tallam  
2011-02-11  Sriraman Tallam  
        * output.cc (Output_section::add_input_section): Delay fill
        * output.cc (Output_section::add_input_section): Delay fill
        generation for section ordering.
        generation for section ordering.
2011-02-09  Ian Lance Taylor  
2011-02-09  Ian Lance Taylor  
        PR gold/12316
        PR gold/12316
        * object.h (class Sized_relobj): Remove clear_local_symbols.
        * object.h (class Sized_relobj): Remove clear_local_symbols.
        * reloc.cc (Sized_relobj::do_relocate): Don't call
        * reloc.cc (Sized_relobj::do_relocate): Don't call
        clear_local_symbols.
        clear_local_symbols.
2011-02-08  Rafael Ávila de Espíndola 
2011-02-08  Rafael Ávila de Espíndola 
        * plugin.cc (is_visible_from_outside): Return true for symbols
        * plugin.cc (is_visible_from_outside): Return true for symbols
        in the -u option.
        in the -u option.
2011-02-04  Jeffrey Yasskin  
2011-02-04  Jeffrey Yasskin  
        * symtab.cc (Odr_violation_compare::operator()): Sort by just the
        * symtab.cc (Odr_violation_compare::operator()): Sort by just the
        filename.
        filename.
2011-02-02  Sriraman Tallam  
2011-02-02  Sriraman Tallam  
        * icf.h (is_section_foldable_candidate): Change type of parameter
        * icf.h (is_section_foldable_candidate): Change type of parameter
        to std::string.
        to std::string.
        * icf.cc (Icf::find_identical_sections): Change type of local variable
        * icf.cc (Icf::find_identical_sections): Change type of local variable
        section_name to be std::string.
        section_name to be std::string.
        (is_function_ctor_or_dtor): Change type of parameter to std::string.
        (is_function_ctor_or_dtor): Change type of parameter to std::string.
2011-01-25  Ian Lance Taylor  
2011-01-25  Ian Lance Taylor  
        * script.cc (script_add_extern): Rewrite to use
        * script.cc (script_add_extern): Rewrite to use
        add_symbol_reference.
        add_symbol_reference.
2011-01-25  Doug Kwan  
2011-01-25  Doug Kwan  
        * icf.cc (get_section_contents): Always lock section's object.
        * icf.cc (get_section_contents): Always lock section's object.
2011-01-24  Ian Lance Taylor  
2011-01-24  Ian Lance Taylor  
        * options.h (class General_options): Accept
        * options.h (class General_options): Accept
        --no-detect-odr-violations.
        --no-detect-odr-violations.
2011-01-24  Ian Lance Taylor  
2011-01-24  Ian Lance Taylor  
        * version.cc (version_string): Bump to 1.11.
        * version.cc (version_string): Bump to 1.11.
2011-01-24  Ian Lance Taylor  
2011-01-24  Ian Lance Taylor  
        * plugin.cc (class Plugin_rescan): Define new class.
        * plugin.cc (class Plugin_rescan): Define new class.
        (Plugin_manager::claim_file): Set any_claimed_.
        (Plugin_manager::claim_file): Set any_claimed_.
        (Plugin_manager::save_archive): New function.
        (Plugin_manager::save_archive): New function.
        (Plugin_manager::save_input_group): New function.
        (Plugin_manager::save_input_group): New function.
        (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
        (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
        necessary.
        necessary.
        (Plugin_manager::new_undefined_symbol): New function.
        (Plugin_manager::new_undefined_symbol): New function.
        (Plugin_manager::rescan): New function.
        (Plugin_manager::rescan): New function.
        (Plugin_manager::rescannable_defines): New function.
        (Plugin_manager::rescannable_defines): New function.
        (Plugin_manager::add_input_file): Set any_added_.
        (Plugin_manager::add_input_file): Set any_added_.
        * plugin.h (class Plugin_manager): define new fields rescannable_,
        * plugin.h (class Plugin_manager): define new fields rescannable_,
        undefined_symbols_, any_claimed_, and any_added_.  Declare
        undefined_symbols_, any_claimed_, and any_added_.  Declare
        Plugin_rescan as friend.  Declare new functions.
        Plugin_rescan as friend.  Declare new functions.
        (Plugin_manager::Rescannable): Define type.
        (Plugin_manager::Rescannable): Define type.
        (Plugin_manager::Rescannable_list): Define type.
        (Plugin_manager::Rescannable_list): Define type.
        (Plugin_manager::Undefined_symbol_list): Define type.
        (Plugin_manager::Undefined_symbol_list): Define type.
        (Plugin_manager::Plugin_manager): Initialize new fields.
        (Plugin_manager::Plugin_manager): Initialize new fields.
        * archive.cc (Archive::defines_symbol): New function.
        * archive.cc (Archive::defines_symbol): New function.
        (Add_archive_symbols::run): Pass archive to plugins if any.
        (Add_archive_symbols::run): Pass archive to plugins if any.
        * archive.h (class Archive): Declare defines_symbol.
        * archive.h (class Archive): Declare defines_symbol.
        * readsyms.cc (Input_group::~Input_group): New function.
        * readsyms.cc (Input_group::~Input_group): New function.
        (Finish_group::run): Pass input_group to plugins if any.
        (Finish_group::run): Pass input_group to plugins if any.
        * readsyms.h (class Input_group): Declare destructor.
        * readsyms.h (class Input_group): Declare destructor.
        * symtab.cc (add_from_object): Pass undefined symbol to plugins if
        * symtab.cc (add_from_object): Pass undefined symbol to plugins if
        any.
        any.
2011-01-10  Ian Lance Taylor  
2011-01-10  Ian Lance Taylor  
        * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
        * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
        section as relro.
        section as relro.
        (Layout::set_segment_offsets): Reset increase_relro before calling
        (Layout::set_segment_offsets): Reset increase_relro before calling
        set_section_addresses a second time.
        set_section_addresses a second time.
2011-01-04  Cary Coutant  
2011-01-04  Cary Coutant  
        * script-sections.cc (Sort_output_sections::operator()): Sort TLS
        * script-sections.cc (Sort_output_sections::operator()): Sort TLS
        sections before NOBITS sections.
        sections before NOBITS sections.
2011-01-01  H.J. Lu  
2011-01-01  H.J. Lu  
        * version.cc (print_version): Update copyright to 2011.
        * version.cc (print_version): Update copyright to 2011.
2010-12-23  Cary Coutant  
2010-12-23  Cary Coutant  
        * output.h (Output_data_reloc::add_output_section): Pass OD instead
        * output.h (Output_data_reloc::add_output_section): Pass OD instead
        of OS to this->add.  Add OD parameter to second form of the function.
        of OS to this->add.  Add OD parameter to second form of the function.
2010-12-20  Ian Lance Taylor  
2010-12-20  Ian Lance Taylor  
        * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
        * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
        second of two consecutive entries with same offset.
        second of two consecutive entries with same offset.
2010-12-16  Ralf Wildenhues  
2010-12-16  Ralf Wildenhues  
        * testsuite/Makefile.am (ifuncmain2static_LDADD)
        * testsuite/Makefile.am (ifuncmain2static_LDADD)
        (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
        (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
        (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
        (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
        to avoid unneeded links against $(LDADD).
        to avoid unneeded links against $(LDADD).
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-12-15  Ian Lance Taylor  
2010-12-15  Ian Lance Taylor  
        PR gold/12324
        PR gold/12324
        * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
        * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
        for R_X86_64_32 and R_X86_64_PC32.
        for R_X86_64_32 and R_X86_64_PC32.
        * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
        * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
        ver_matching_def_pic.o.
        ver_matching_def_pic.o.
        (ver_matching_def_pic.o): New target.
        (ver_matching_def_pic.o): New target.
2010-12-14  Ralf Wildenhues  
2010-12-14  Ralf Wildenhues  
        * fileread.cc (file_counts_lock, file_counts_initialize_lock)
        * fileread.cc (file_counts_lock, file_counts_initialize_lock)
        (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
        (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
        Move definition before File_read::View member definitions.
        Move definition before File_read::View member definitions.
        (File_read::View::~View): Initialize and hold lock before
        (File_read::View::~View): Initialize and hold lock before
        updating current_mapped_bytes.
        updating current_mapped_bytes.
2010-12-14  Ralf Wildenhues  
2010-12-14  Ralf Wildenhues  
        * dwarf_reader.cc: Remove outdated comment.
        * dwarf_reader.cc: Remove outdated comment.
        * gold-threads.cc: Fix typo in error message.
        * gold-threads.cc: Fix typo in error message.
        * archive.cc: Fix typos in comments.
        * archive.cc: Fix typos in comments.
        * archive.h: Likewise.
        * archive.h: Likewise.
        * arm-reloc-property.cc: Likewise.
        * arm-reloc-property.cc: Likewise.
        * arm-reloc-property.h: Likewise.
        * arm-reloc-property.h: Likewise.
        * arm-reloc.def: Likewise.
        * arm-reloc.def: Likewise.
        * arm.cc: Likewise.
        * arm.cc: Likewise.
        * attributes.h: Likewise.
        * attributes.h: Likewise.
        * cref.cc: Likewise.
        * cref.cc: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.cc: Likewise.
        * fileread.h: Likewise.
        * fileread.h: Likewise.
        * gold.h: Likewise.
        * gold.h: Likewise.
        * i386.cc: Likewise.
        * i386.cc: Likewise.
        * icf.cc: Likewise.
        * icf.cc: Likewise.
        * incremental.h: Likewise.
        * incremental.h: Likewise.
        * int_encoding.cc: Likewise.
        * int_encoding.cc: Likewise.
        * layout.h: Likewise.
        * layout.h: Likewise.
        * main.cc: Likewise.
        * main.cc: Likewise.
        * merge.h: Likewise.
        * merge.h: Likewise.
        * object.cc: Likewise.
        * object.cc: Likewise.
        * object.h: Likewise.
        * object.h: Likewise.
        * options.cc: Likewise.
        * options.cc: Likewise.
        * readsyms.cc: Likewise.
        * readsyms.cc: Likewise.
        * reduced_debug_output.cc: Likewise.
        * reduced_debug_output.cc: Likewise.
        * reloc.cc: Likewise.
        * reloc.cc: Likewise.
        * script-sections.cc: Likewise.
        * script-sections.cc: Likewise.
        * sparc.cc: Likewise.
        * sparc.cc: Likewise.
        * symtab.h: Likewise.
        * symtab.h: Likewise.
        * target-reloc.h: Likewise.
        * target-reloc.h: Likewise.
        * target.cc: Likewise.
        * target.cc: Likewise.
        * target.h: Likewise.
        * target.h: Likewise.
        * timer.cc: Likewise.
        * timer.cc: Likewise.
        * timer.h: Likewise.
        * timer.h: Likewise.
        * x86_64.cc: Likewise.
        * x86_64.cc: Likewise.
2010-12-09  Cary Coutant  
2010-12-09  Cary Coutant  
        * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
        * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
        stack.
        stack.
        * layout.h (Layout::layout_gnu_stack): Add pointer to Object
        * layout.h (Layout::layout_gnu_stack): Add pointer to Object
        parameter; change all callers.
        parameter; change all callers.
        * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
        * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
        * options.h (warn_execstack): New option.
        * options.h (warn_execstack): New option.
2010-12-07  Doug Kwan  
2010-12-07  Doug Kwan  
        * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
        * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
        like function call relocations.
        like function call relocations.
2010-12-07  Ian Lance Taylor  
2010-12-07  Ian Lance Taylor  
        * archive.cc (Archive::get_elf_object_for_member): Permit
        * archive.cc (Archive::get_elf_object_for_member): Permit
        punconfigured to be NULL.
        punconfigured to be NULL.
        (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
        (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
        (Archive::include_member): Pass NULL to get_elf_object_for_member
        (Archive::include_member): Pass NULL to get_elf_object_for_member
        if we searched for the archive and this is the first included
        if we searched for the archive and this is the first included
        object.
        object.
2010-12-01  Ian Lance Taylor  
2010-12-01  Ian Lance Taylor  
        * dwarf_reader.h (class Sized_dwarf_line_info): Add
        * dwarf_reader.h (class Sized_dwarf_line_info): Add
        track_relocs_type_ field.
        track_relocs_type_ field.
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        Set track_relocs_type_.
        Set track_relocs_type_.
        (Sized_dwarf_line_info::process_one_opcode): Ignore the section
        (Sized_dwarf_line_info::process_one_opcode): Ignore the section
        contents when using RELA relocs.
        contents when using RELA relocs.
        (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
        (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
        reloc_map_.
        reloc_map_.
        * reloc.cc (Track_relocs::next_addend): New function.
        * reloc.cc (Track_relocs::next_addend): New function.
        * reloc.h (class Track_relocs): Declare next_addend.
        * reloc.h (class Track_relocs): Declare next_addend.
2010-12-01  Ian Lance Taylor  
2010-12-01  Ian Lance Taylor  
        * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
        * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
        virtual destructor.
        virtual destructor.
2010-12-01  Ian Lance Taylor  
2010-12-01  Ian Lance Taylor  
        * README: Update compilers known to work and fail.
        * README: Update compilers known to work and fail.
2010-11-23  Matthias Klose  
2010-11-23  Matthias Klose  
        * configure.in: For --enable-gold, handle value `default' instead of
        * configure.in: For --enable-gold, handle value `default' instead of
        `both*'.  Always install ld as ld.bfd, install as ld if gold is
        `both*'.  Always install ld as ld.bfd, install as ld if gold is
        not the default.
        not the default.
        * configure: Regenerate.
        * configure: Regenerate.
2010-11-18  Doug Kwan  
2010-11-18  Doug Kwan  
        * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
        * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
        and right_alignment to be zero.  Store result alignment only if it is
        and right_alignment to be zero.  Store result alignment only if it is
        greater than existing alignment.
        greater than existing alignment.
2010-11-16  Cary Coutant  
2010-11-16  Cary Coutant  
        PR gold/12220
        PR gold/12220
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        Check for ".zdebug_line".
        Check for ".zdebug_line".
2010-11-16  Doug Kwan  
2010-11-16  Doug Kwan  
            Cary Coutant  
            Cary Coutant  
        * output.h (Output_segment::set_section_addresses): Pass increase_relro
        * output.h (Output_segment::set_section_addresses): Pass increase_relro
        by reference; adjust all callers.
        by reference; adjust all callers.
        * output.cc (Output_segment::set_section_addresses): Adjust references
        * output.cc (Output_segment::set_section_addresses): Adjust references
        to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
        to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
        list is empty.
        list is empty.
        (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
        (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
        end at page boundary.
        end at page boundary.
2010-11-16  Cary Coutant  
2010-11-16  Cary Coutant  
        PR gold/12220
        PR gold/12220
        * layout.cc (Layout::choose_output_section): Transform names of
        * layout.cc (Layout::choose_output_section): Transform names of
        compressed sections even when using a script with a SECTIONS clause.
        compressed sections even when using a script with a SECTIONS clause.
        (Layout::output_section_name): Remove code to transform
        (Layout::output_section_name): Remove code to transform
        compressed debug section names.
        compressed debug section names.
        * output.cc (Output_section::add_input_section): Use uncompressed
        * output.cc (Output_section::add_input_section): Use uncompressed
        section size when tracking input sections.
        section size when tracking input sections.
2010-11-11  Richard Sandiford  
2010-11-11  Richard Sandiford  
        * symtab.h (Symbol::NON_PIC_REF): Remove.
        * symtab.h (Symbol::NON_PIC_REF): Remove.
        (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
        (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
        (Symbol::FUNCTION_CALL): Renumber.  Reword comment.
        (Symbol::FUNCTION_CALL): Renumber.  Reword comment.
        (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
        (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
        (Symbol::use_plt_offset): Take a flags argument and pass it
        (Symbol::use_plt_offset): Take a flags argument and pass it
        directly to needs_dynamic_reloc.  Restrict check for undefined
        directly to needs_dynamic_reloc.  Restrict check for undefined
        weak symbols to function calls.
        weak symbols to function calls.
        * arm.cc (Target_arm::Scan::get_reference_flags): New function.
        * arm.cc (Target_arm::Scan::get_reference_flags): New function.
        (Target_arm::Scan::global): Use it.
        (Target_arm::Scan::global): Use it.
        (Target_arm::Scan::scan_reloc_for_stub): Likewise.
        (Target_arm::Scan::scan_reloc_for_stub): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::should_apply_static_reloc): Replace flags
        (Target_arm::Relocate::should_apply_static_reloc): Replace flags
        parameter with an r_type parameter.  Use get_reference_flags
        parameter with an r_type parameter.  Use get_reference_flags
        to get the flags.
        to get the flags.
        (Target_arm::Relocate::relocate): Update accordingly.
        (Target_arm::Relocate::relocate): Update accordingly.
        * i386.cc (Target_i386::Scan::get_reference_flags): New function.
        * i386.cc (Target_i386::Scan::get_reference_flags): New function.
        (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
        (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::should_apply_static_reloc): Replace flags
        (Target_i386::Relocate::should_apply_static_reloc): Replace flags
        parameter with an r_type parameter.  Use get_reference_flags
        parameter with an r_type parameter.  Use get_reference_flags
        to get the flags.
        to get the flags.
        (Target_i386::Relocate::relocate): Update accordingly.
        (Target_i386::Relocate::relocate): Update accordingly.
        * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
        * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
        (Target_powerpc::Scan::global): Use it.
        (Target_powerpc::Scan::global): Use it.
        (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
        (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
        (Target_powerpc::Relocate::relocate): Likewise.
        (Target_powerpc::Relocate::relocate): Likewise.
        * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
        * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
        (Target_sparc::Scan::global): Use it.
        (Target_sparc::Scan::global): Use it.
        (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
        (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
        (Target_sparc::Relocate::relocate): Likewise.
        (Target_sparc::Relocate::relocate): Likewise.
        * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
        * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
        (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
        (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
2010-11-08  Doug Kwan  
2010-11-08  Doug Kwan  
            Cary Coutant  
            Cary Coutant  
        * arm.cc (Arm_exidx_merge_section::build_contents): New method.
        * arm.cc (Arm_exidx_merge_section::build_contents): New method.
        (Arm_exidx_merge_section::section_contents_): New data member.
        (Arm_exidx_merge_section::section_contents_): New data member.
        (Arm_input_section::Arm_input_section): Initialize original_contents_.
        (Arm_input_section::Arm_input_section): Initialize original_contents_.
        (Arm_input_section::~Arm_input_section): De-allocate memory.
        (Arm_input_section::~Arm_input_section): De-allocate memory.
        (Arm_input_section::original_contents_): New data member.
        (Arm_input_section::original_contents_): New data member.
        (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
        (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
        in parameters instead of calling Object::section_contents without
        in parameters instead of calling Object::section_contents without
        locking.
        locking.
        (Arm_output_section::group_section): New parameter TASK.  Pass it
        (Arm_output_section::group_section): New parameter TASK.  Pass it
        to callees that need locking objects.
        to callees that need locking objects.
        (Arm_output_section::fix_exidx_coverage): New parameter TASK.  Use it
        (Arm_output_section::fix_exidx_coverage): New parameter TASK.  Use it
        to lock EXIDX input sections.  Fix a formatting issue.  Call
        to lock EXIDX input sections.  Fix a formatting issue.  Call
        Arm_exidx_merged_section::build_contents to create merged section
        Arm_exidx_merged_section::build_contents to create merged section
        contents.
        contents.
        (Arm_output_section::create_stub_group): New parameter TASK.  Use it
        (Arm_output_section::create_stub_group): New parameter TASK.  Use it
        to lock object of stub table owner.
        to lock object of stub table owner.
        (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
        (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
        TEXT_SIZE to initialize data member TEXT_SIZE_.
        TEXT_SIZE to initialize data member TEXT_SIZE_.
        (Arm_exidx_input_section::addralign): Fix typo in comment.
        (Arm_exidx_input_section::addralign): Fix typo in comment.
        (Arm_exidx_input_section::text_size): New method.
        (Arm_exidx_input_section::text_size): New method.
        (Target_arm::do_relax): New parameter TASK.  Pass it to callees
        (Target_arm::do_relax): New parameter TASK.  Pass it to callees
        that require locking objects.  Lock objects before scanning for stubs
        that require locking objects.  Lock objects before scanning for stubs
        and updating local symbols.
        and updating local symbols.
        (Arm_input_section::init): Copy contents of original
        (Arm_input_section::init): Copy contents of original
        input section.
        input section.
        (Arm_input_section::do_write): Use saved contents of
        (Arm_input_section::do_write): Use saved contents of
        original input section instead of calling Object::section_contents
        original input section instead of calling Object::section_contents
        without locking.
        without locking.
        (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
        (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
        size without calling Object::section_size().
        size without calling Object::section_size().
        (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
        (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
        for size.  Allocate a buffer for merged EXIDX entries.
        for size.  Allocate a buffer for merged EXIDX entries.
        (Arm_exidx_merged_section::build_contents): New method.
        (Arm_exidx_merged_section::build_contents): New method.
        (Arm_exidx_merged_section::do_write): Move merge section contents
        (Arm_exidx_merged_section::do_write): Move merge section contents
        building code to Arm_exidx_merged_section::build_contetns.  Write
        building code to Arm_exidx_merged_section::build_contetns.  Write
        out contetns in buffer instead of building it on the fly.
        out contetns in buffer instead of building it on the fly.
        (Arm_relobj::make_exidx_input_section): Also pass text section size
        (Arm_relobj::make_exidx_input_section): Also pass text section size
        to Arm_exidx_input_section constructor.
        to Arm_exidx_input_section constructor.
        (Arm_relobj::do_read_symbols): Fix memory leak.  Fix a formatting issue.
        (Arm_relobj::do_read_symbols): Fix memory leak.  Fix a formatting issue.
        (Arm_dynobj::do_read_symbols): Fix memory leak.
        (Arm_dynobj::do_read_symbols): Fix memory leak.
        * layout.cc (Layout::finalize): Pass TASK to Target::relax().
        * layout.cc (Layout::finalize): Pass TASK to Target::relax().
        * target.h: (class Task): Add forward declaration.
        * target.h: (class Task): Add forward declaration.
        (Target::relax): Add new parameter TASK and pass it to
        (Target::relax): Add new parameter TASK and pass it to
        Target::do_relax().
        Target::do_relax().
        (Target::do_relax):: New parameter TASK.  Fix a formatting issue.
        (Target::do_relax):: New parameter TASK.  Fix a formatting issue.
2010-11-05  Cary Coutant  
2010-11-05  Cary Coutant  
        PR gold/10708
        PR gold/10708
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
        object when reading from the file.
        object when reading from the file.
        * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
        * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
        second layout pass.
        second layout pass.
        * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
        * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
        when reading section contents.
        when reading section contents.
        (get_section_contents): Likewise.
        (get_section_contents): Likewise.
        (icf::find_identical_sections): Likewise.
        (icf::find_identical_sections): Likewise.
        * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
        * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
        object when reading from the file.
        object when reading from the file.
        * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
        * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
        the object when doing deferred section layout.
        the object when doing deferred section layout.
2010-11-03  Nick Clifton  
2010-11-03  Nick Clifton  
        PR gold/12001
        PR gold/12001
        * script.h (class Symbol_assignment: name): New member.  Returns
        * script.h (class Symbol_assignment: name): New member.  Returns
        the name of the symbol.
        the name of the symbol.
        * scrfipt.cc (Script_options::is_pending_assignment): New member.
        * scrfipt.cc (Script_options::is_pending_assignment): New member.
        Returns true if the given symbol name is on the list of
        Returns true if the given symbol name is on the list of
        assignments wating to be processed.
        assignments wating to be processed.
        * archive.cc (should_incldue_member): If the symbol is undefined,
        * archive.cc (should_incldue_member): If the symbol is undefined,
        check to see if it is on the list of symbols pending assignment.
        check to see if it is on the list of symbols pending assignment.
2010-11-03  Ryan Mansfield  
2010-11-03  Ryan Mansfield  
        * script-sections.cc (Script_sections::find_memory_region): Check
        * script-sections.cc (Script_sections::find_memory_region): Check
        for a NULL output section pointer.
        for a NULL output section pointer.
2010-10-29  Doug Kwan  
2010-10-29  Doug Kwan  
        * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
        * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
        Output_section::add_relaxed_input_section.
        Output_section::add_relaxed_input_section.
        * output.cc (Output_section::add_relaxed_input_section): Add new
        * output.cc (Output_section::add_relaxed_input_section): Add new
        arguments LAYOUT and NAME.  Set section order index.
        arguments LAYOUT and NAME.  Set section order index.
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        Copy section order index.
        Copy section order index.
        * output.h (Output_section::add_relaxed_input_section): Add new
        * output.h (Output_section::add_relaxed_input_section): Add new
        arguments LAYOUT and NAME.
        arguments LAYOUT and NAME.
2010-10-29  Viktor Kutuzov  
2010-10-29  Viktor Kutuzov  
        * testsuite/Makefile.am: Move gcctestdir/ld rule to
        * testsuite/Makefile.am: Move gcctestdir/ld rule to
        NATIVE_OR_CROSS_LINKER.
        NATIVE_OR_CROSS_LINKER.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-10-20  Doug Kwan  
2010-10-20  Doug Kwan  
        * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
        * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
        without SHF_LINK_ORDER flags.
        without SHF_LINK_ORDER flags.
        * layout.cc (Layout::choose_output_section): Do not filter
        * layout.cc (Layout::choose_output_section): Do not filter
        SHF_LINK_ORDER flag in a relocatable link.
        SHF_LINK_ORDER flag in a relocatable link.
2010-10-17  Cary Coutant  
2010-10-17  Cary Coutant  
        * output.h (Output_segment::set_section_addresses): Change function
        * output.h (Output_segment::set_section_addresses): Change function
        signature.  Update all callers.
        signature.  Update all callers.
        * output.cc (Output_segment::is_first_section_relro): Ignore TLS
        * output.cc (Output_segment::is_first_section_relro): Ignore TLS
        sections.
        sections.
        (Output_segment::set_section_addresses): Align after last TLS
        (Output_segment::set_section_addresses): Align after last TLS
        section.  Add padding before last relro section instead of after.
        section.  Add padding before last relro section instead of after.
2010-10-17  Doug Kwan  
2010-10-17  Doug Kwan  
        * gold/arm.cc (Target_arm::got_section): Use correct order and set
        * gold/arm.cc (Target_arm::got_section): Use correct order and set
        GOT output section to be writable.
        GOT output section to be writable.
2010-10-14  Cary Coutant  
2010-10-14  Cary Coutant  
        * debug.h (DEBUG_INCREMENTAL): New flag.
        * debug.h (DEBUG_INCREMENTAL): New flag.
        (debug_string_to_enum): Add DEBUG_INCREMENTAL).
        (debug_string_to_enum): Add DEBUG_INCREMENTAL).
        * gold.cc (queue_initial_tasks): Check parameters for incremental link
        * gold.cc (queue_initial_tasks): Check parameters for incremental link
        mode.
        mode.
        * incremental.cc (report_command_line): Ignore all forms of
        * incremental.cc (report_command_line): Ignore all forms of
        --incremental.
        --incremental.
        * layout.cc (Layout::Layout): Check parameters for incremental link
        * layout.cc (Layout::Layout): Check parameters for incremental link
        mode.
        mode.
        * options.cc (General_options::parse_incremental): New function.
        * options.cc (General_options::parse_incremental): New function.
        (General_options::parse_no_incremental): New function.
        (General_options::parse_no_incremental): New function.
        (General_options::parse_incremental_full): New function.
        (General_options::parse_incremental_full): New function.
        (General_options::parse_incremental_update): New function.
        (General_options::parse_incremental_update): New function.
        (General_options::incremental_mode_): New data member.
        (General_options::incremental_mode_): New data member.
        (General_options::finalize): Check incremental_mode_.
        (General_options::finalize): Check incremental_mode_.
        * options.h (General_options): Update help text for --incremental.
        * options.h (General_options): Update help text for --incremental.
        Add --no-incremental, --incremental-full, --incremental-update.
        Add --no-incremental, --incremental-full, --incremental-update.
        (General_options::Incremental_mode): New enum type.
        (General_options::Incremental_mode): New enum type.
        (General_options::incremental_mode): New function.
        (General_options::incremental_mode): New function.
        (General_options::incremental_mode_): New data member.
        (General_options::incremental_mode_): New data member.
        * parameters.cc (Parameters::incremental_mode_): New data member.
        * parameters.cc (Parameters::incremental_mode_): New data member.
        (Parameters::set_options): Set incremental_mode_.
        (Parameters::set_options): Set incremental_mode_.
        (Parameters::set_incremental_full): New function.
        (Parameters::set_incremental_full): New function.
        (Parameters::incremental): New function.
        (Parameters::incremental): New function.
        (Parameters::incremental_update): New function.
        (Parameters::incremental_update): New function.
        (set_parameters_incremental_full): New function.
        (set_parameters_incremental_full): New function.
        * parameters.h (Parameters::set_incremental_full): New function.
        * parameters.h (Parameters::set_incremental_full): New function.
        (Parameters::incremental): New function.
        (Parameters::incremental): New function.
        (Parameters::incremental_update): New function.
        (Parameters::incremental_update): New function.
        (Parameters::incremental_mode_): New data member.
        (Parameters::incremental_mode_): New data member.
        (set_parameters_incremental_full): New function.
        (set_parameters_incremental_full): New function.
        * plugin.cc (Plugin_manager::add_input_file): Check parameters for
        * plugin.cc (Plugin_manager::add_input_file): Check parameters for
        incremental link mode.
        incremental link mode.
        * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
        * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
        (Sized_relobj::do_relocate_sections): Likewise.
        (Sized_relobj::do_relocate_sections): Likewise.
        * testsuite/Makefile.am (incremental_test): Use --incremental-full
        * testsuite/Makefile.am (incremental_test): Use --incremental-full
        option.
        option.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/incremental_test.sh: Filter all forms of --incremental.
        * testsuite/incremental_test.sh: Filter all forms of --incremental.
2010-10-12  Viktor Kutuzov  
2010-10-12  Viktor Kutuzov  
        * script-sections.h (class Script_sections): Make
        * script-sections.h (class Script_sections): Make
        Sections_elements typedef public.
        Sections_elements typedef public.
        * script-sections.cc (class Sort_output_sections): Add elements_
        * script-sections.cc (class Sort_output_sections): Add elements_
        field.  Add constructor which sets it; change all callers.
        field.  Add constructor which sets it; change all callers.
        (Sort_output_sections::is_before): New function.
        (Sort_output_sections::is_before): New function.
        (Sort_output_sections::operator()): Call is_before.
        (Sort_output_sections::operator()): Call is_before.
        * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
        * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
        conditional.
        conditional.
        * testsuite/script_test_10.sh: New test. Test script section
        * testsuite/script_test_10.sh: New test. Test script section
        order.
        order.
        * testsuite/script_test_10.t: Likewise.
        * testsuite/script_test_10.t: Likewise.
        * testsuite/script_test_10.s: Likewise.
        * testsuite/script_test_10.s: Likewise.
        * testsuite/Makefile.am: Wrap the cross linker tests and the
        * testsuite/Makefile.am: Wrap the cross linker tests and the
        common tests into NATIVE_OR_CROSS_LINKER.
        common tests into NATIVE_OR_CROSS_LINKER.
        (check_SCRIPTS): Add script_test_10.sh.
        (check_SCRIPTS): Add script_test_10.sh.
        (check_DATA): Add script_test_10.stdout.
        (check_DATA): Add script_test_10.stdout.
        (script_test_10.o, script_test_10): New targets.
        (script_test_10.o, script_test_10): New targets.
        (script_test_10.stdout): New target.
        (script_test_10.stdout): New target.
        * configure, testsuite/Makefile.in: Regenerate.
        * configure, testsuite/Makefile.in: Regenerate.
2010-10-12  Viktor Kutuzov  
2010-10-12  Viktor Kutuzov  
        * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
        * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
        error for the deprecated relocations.
        error for the deprecated relocations.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
2010-10-12  Richard Sandiford  
2010-10-12  Richard Sandiford  
        * fileread.cc (Input_file::find_file): Initialize *found_name
        * fileread.cc (Input_file::find_file): Initialize *found_name
        and *namep when using the fallback search for case 4.
        and *namep when using the fallback search for case 4.
2010-10-11  Cary Coutant  
2010-10-11  Cary Coutant  
        * options.h (class General_options): Redefine -z lazy as an alias for
        * options.h (class General_options): Redefine -z lazy as an alias for
        the negation of -z now.
        the negation of -z now.
2010-10-11  Ian Lance Taylor  
2010-10-11  Ian Lance Taylor  
        * resolve.cc (symbol_to_bits): Report the value of the unsupported
        * resolve.cc (symbol_to_bits): Report the value of the unsupported
        binding.
        binding.
2010-10-06  Nick Clifton  
2010-10-06  Nick Clifton  
        * script-sections.cc(class Memory_region): Remove
        * script-sections.cc(class Memory_region): Remove
        current_lma_offset_ field.  Rename current_vma_offset_ to
        current_lma_offset_ field.  Rename current_vma_offset_ to
        current_offset_.  Add last_section_ field.
        current_offset_.  Add last_section_ field.
        (Memory_region::get_current_vma_address): Rename to
        (Memory_region::get_current_vma_address): Rename to
        get_current_address.
        get_current_address.
        (Memory_region::get_current_lma_address): Delete.
        (Memory_region::get_current_lma_address): Delete.
        (Memory_region::increment_vma_offset): Rename to
        (Memory_region::increment_vma_offset): Rename to
        increment_offset.
        increment_offset.
        (Memory_region::increment_lma_offset): Delete.
        (Memory_region::increment_lma_offset): Delete.
        (Memory_region::attributes_compatible): New method.  Returns
        (Memory_region::attributes_compatible): New method.  Returns
        true if the provided section is compatible with the region.
        true if the provided section is compatible with the region.
        (Memory_region::get_last_section): New method.  Returns the last
        (Memory_region::get_last_section): New method.  Returns the last
        section to use the region.
        section to use the region.
        (Memory_region::set_last_section): New method.  Stores the last
        (Memory_region::set_last_section): New method.  Stores the last
        section to use the region.
        section to use the region.
        (Script_sections::block_in_region): New method.  Returns true if
        (Script_sections::block_in_region): New method.  Returns true if
        a block of memory is contained within a region.
        a block of memory is contained within a region.
        (Script_sections::find_memory_region): New method.  Locates a
        (Script_sections::find_memory_region): New method.  Locates a
        memory region to be used to set a VMA or LMA address.
        memory region to be used to set a VMA or LMA address.
        (Output_section_definition::set_section_addresses): Add code to
        (Output_section_definition::set_section_addresses): Add code to
        check for addresses set by memory regions.
        check for addresses set by memory regions.
        (Output_segment::set_section_addresses): Remove memory region
        (Output_segment::set_section_addresses): Remove memory region
        walking code.
        walking code.
        (Script_sections::create_segment): Add a warning if a header
        (Script_sections::create_segment): Add a warning if a header
        segment is created outside of any region.
        segment is created outside of any region.
        * script-sections.h (class Script_sections): Add prototypes for
        * script-sections.h (class Script_sections): Add prototypes for
        find_memory_region and block_in_region methods.
        find_memory_region and block_in_region methods.
        * testsuite/memory_test.s: Use .long instead of .word.
        * testsuite/memory_test.s: Use .long instead of .word.
        * testsuite/memory_test.t: Add some more output sections.
        * testsuite/memory_test.t: Add some more output sections.
        * testsuite/memory_test.sh: Update expected output.
        * testsuite/memory_test.sh: Update expected output.
2010-10-02  Doug Kwan  
2010-10-02  Doug Kwan  
        * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
        * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
        defintion to symtab.h
        defintion to symtab.h
        * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
        * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
        declaration to defintion.
        declaration to defintion.
2010-10-01  Nick Clifton  
2010-10-01  Nick Clifton  
        * expression.cc (eval): Replace dummy argument with NULL.
        * expression.cc (eval): Replace dummy argument with NULL.
        (eval_maybe_dot): Check for a NULL result section pointer.
        (eval_maybe_dot): Check for a NULL result section pointer.
        (Symbol_expression::value): Likewise.
        (Symbol_expression::value): Likewise.
        (Dot_expression::value): Likewise.
        (Dot_expression::value): Likewise.
        (BINARY_EXPRESSION): Likewise.
        (BINARY_EXPRESSION): Likewise.
        (Max_expression::value): Likewise.
        (Max_expression::value): Likewise.
        (Min_expression::value): Likewise.
        (Min_expression::value): Likewise.
        (Absolute_expression::value): Likewise.
        (Absolute_expression::value): Likewise.
        (Addr_expression::value_from_output_section): Likewise.
        (Addr_expression::value_from_output_section): Likewise.
        (Loaddddr_expression::value_from_output_section): Likewise.
        (Loaddddr_expression::value_from_output_section): Likewise.
        (Segment_start_expression::value): Likewise.
        (Segment_start_expression::value): Likewise.
        * script-sections.cc
        * script-sections.cc
        (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
        (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
        argument with NULL.
        argument with NULL.
        (Sections_elememt_dot_assignment::set_section_addresses):
        (Sections_elememt_dot_assignment::set_section_addresses):
        Likewise.
        Likewise.
        (Output_data_expression::do_write_to_buffer): Likewise.
        (Output_data_expression::do_write_to_buffer): Likewise.
        (Output_section_definition::finalize_symbols): Likewise.
        (Output_section_definition::finalize_symbols): Likewise.
        (Output_section_definition::set_section_addresses): Likewise.
        (Output_section_definition::set_section_addresses): Likewise.
2010-09-30  Doug Kwan  
2010-09-30  Doug Kwan  
        * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
        * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2010-09-28  Sriraman Tallam  
2010-09-28  Sriraman Tallam  
        * target.h (Target::can_icf_inline_merge_sections): New virtual
        * target.h (Target::can_icf_inline_merge_sections): New virtual
        function.
        function.
        * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
        * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
        virtual function.
        virtual function.
        * i386.cc (Target_i386::can_icf_inline_merge_sections): New
        * i386.cc (Target_i386::can_icf_inline_merge_sections): New
        virtual function.
        virtual function.
        * icf.cc (get_section_contents): Inline merge sections only when
        * icf.cc (get_section_contents): Inline merge sections only when
        target allows it.
        target allows it.
2010-09-27  Ralf Wildenhues  
2010-09-27  Ralf Wildenhues  
        * configure: Regenerate.
        * configure: Regenerate.
2010-09-17  Ian Lance Taylor  
2010-09-17  Ian Lance Taylor  
        * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
        * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
        * testsuite/Makefile.am (memory_test.o): New target.
        * testsuite/Makefile.am (memory_test.o): New target.
        (memory_test): Depend on memory_test.o, gcctestdir/ld, and
        (memory_test): Depend on memory_test.o, gcctestdir/ld, and
        memory_test.t.
        memory_test.t.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2010-09-17  Doug Kwan  
2010-09-17  Doug Kwan  
        * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
        * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
        defintion if relocation uses GOT entries of the symbol.
        defintion if relocation uses GOT entries of the symbol.
        * testsuite/icf_safe_test.sh: Fix test.
        * testsuite/icf_safe_test.sh: Fix test.
        * testsuite/icf_safe_so_test.sh: Fix test.
        * testsuite/icf_safe_so_test.sh: Fix test.
2010-09-16  Cary Coutant  
2010-09-16  Cary Coutant  
        * script_sections.cc (class Memory_region): Remove "NULL" from
        * script_sections.cc (class Memory_region): Remove "NULL" from
        vector initializations.
        vector initializations.
2010-09-15  Cary Coutant  
2010-09-15  Cary Coutant  
        * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
        * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
        Resolve forwarding symbols.
        Resolve forwarding symbols.
2010-09-15  Doug Kwan  
2010-09-15  Doug Kwan  
        * gold/testsuite/script_test_3.t: Add ARM special sections.
        * gold/testsuite/script_test_3.t: Add ARM special sections.
        * gold/testsuite/script_test_4.t: Same.
        * gold/testsuite/script_test_4.t: Same.
        * gold/testsuite/script_test_5.t: Same.
        * gold/testsuite/script_test_5.t: Same.
        * gold/testsuite/script_test_6.t: Same.
        * gold/testsuite/script_test_6.t: Same.
        * gold/testsuite/script_test_7.t: Same.
        * gold/testsuite/script_test_7.t: Same.
        * gold/testsuite/script_test_7.t: Same.
        * gold/testsuite/script_test_7.t: Same.
        * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
        * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2010-09-14  Cary Coutant  
2010-09-14  Cary Coutant  
        * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
        * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
        (Target_x86_64::Relocate::relocate_tls): Replace check for
        (Target_x86_64::Relocate::relocate_tls): Replace check for
        saw_tls_block_reloc_ with test for executable section.
        saw_tls_block_reloc_ with test for executable section.
2010-09-12  Cary Coutant  
2010-09-12  Cary Coutant  
        * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
        * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
        position-independent executables to shared libraries need dynamic
        position-independent executables to shared libraries need dynamic
        relocations.
        relocations.
        (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
        (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
        position-independent executables.
        position-independent executables.
        * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
        * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-09-10  Nick Clifton  
2010-09-10  Nick Clifton  
        PR gold/11997
        PR gold/11997
        * testsuite/memory_test.t: Discard any sections that are not
        * testsuite/memory_test.t: Discard any sections that are not
        needed.
        needed.
2010-09-09  H.J. Lu  
2010-09-09  H.J. Lu  
        PR gold/11996
        PR gold/11996
        * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
        * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
        "This::" to work around a bug in gcc 4.2.
        "This::" to work around a bug in gcc 4.2.
        * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
        * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2010-09-09  Rafael Espindola  
2010-09-09  Rafael Espindola  
        * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
        * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
        sections with different PF_X flags in the same segment.
        sections with different PF_X flags in the same segment.
        (Layout::find_first_load_seg): Search all segments to find the first
        (Layout::find_first_load_seg): Search all segments to find the first
        one.
        one.
        * options.h (rosegment): New.
        * options.h (rosegment): New.
2010-09-08  Rafael Espindola  
2010-09-08  Rafael Espindola  
        * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
        * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
2010-09-08  Doug Kwan  
2010-09-08  Doug Kwan  
        * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
        * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
        (Arm_relobj::do_relocate_sections): Add new parameter for output
        (Arm_relobj::do_relocate_sections): Add new parameter for output
        file to match the parent.
        file to match the parent.
        (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
        (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
        of local symbols instead of input values.  Update code to track
        of local symbols instead of input values.  Update code to track
        changes in gold::relocate_section.
        changes in gold::relocate_section.
        * object.cc (Sized_relobj::compute_final_local_value): New methods.
        * object.cc (Sized_relobj::compute_final_local_value): New methods.
        (Sized_relobj::compute_final_local_value_internal): New methods.
        (Sized_relobj::compute_final_local_value_internal): New methods.
        (Sized_relobj::do_finalize_local_symbols): Move code from loop
        (Sized_relobj::do_finalize_local_symbols): Move code from loop
        body into private version of Sized_relobj::compute_final_local_value.
        body into private version of Sized_relobj::compute_final_local_value.
        Call the inline method.
        Call the inline method.
        * object.h (Symbol_value::Symbol_value): Define destructor.  Free
        * object.h (Symbol_value::Symbol_value): Define destructor.  Free
        merged symbol value if there is one.
        merged symbol value if there is one.
        (Symbol_value::has_output_value): New method defintiion.
        (Symbol_value::has_output_value): New method defintiion.
        (Sized_relobj::Compute_final_local_value_status): New enum type.
        (Sized_relobj::Compute_final_local_value_status): New enum type.
        (Sized_relobj::compute_final_local_value): New methods.
        (Sized_relobj::compute_final_local_value): New methods.
        (Sized_relobj::compute_final_local_value_internal): New methods.
        (Sized_relobj::compute_final_local_value_internal): New methods.
        * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
        * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
        and arm_cortex_a8.sh.
        and arm_cortex_a8.sh.
        (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
        (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
        arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
        arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
        New tests.
        New tests.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/arm_bl_out_of_range.s: Update test.
        * testsuite/arm_bl_out_of_range.s: Update test.
        * testsuite/thumb_bl_out_of_range.s: Ditto.
        * testsuite/thumb_bl_out_of_range.s: Ditto.
        * testsuite/thumb_blx_out_of_range.s: Ditto.
        * testsuite/thumb_blx_out_of_range.s: Ditto.
        * testsuite/arm_branch_out_of_range.sh: New file.
        * testsuite/arm_branch_out_of_range.sh: New file.
        * testsuite/arm_cortex_a8.sh: Ditto.
        * testsuite/arm_cortex_a8.sh: Ditto.
        * testsuite/arm_cortex_a8_b.s: Ditto.
        * testsuite/arm_cortex_a8_b.s: Ditto.
        * testsuite/arm_cortex_a8_b_cond.s: Ditto.
        * testsuite/arm_cortex_a8_b_cond.s: Ditto.
        * testsuite/arm_cortex_a8_b_local.s: Ditto.
        * testsuite/arm_cortex_a8_b_local.s: Ditto.
        * testsuite/arm_cortex_a8_bl.s: Ditto.
        * testsuite/arm_cortex_a8_bl.s: Ditto.
        * testsuite/arm_cortex_a8_blx.s: Ditto.
        * testsuite/arm_cortex_a8_blx.s: Ditto.
        * testsuite/arm_cortex_a8_local.s: Ditto.
        * testsuite/arm_cortex_a8_local.s: Ditto.
        * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
        * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
        * testsuite/thumb_bl_out_of_range_local.s: Ditto.
        * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2010-09-08  Rafael Espindola  
2010-09-08  Rafael Espindola  
        * Makefile.am (memory_test.stdout): Run readelf with -W.
        * Makefile.am (memory_test.stdout): Run readelf with -W.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/memory_test.sh: Make the regexps accept both 32 and
        * testsuite/memory_test.sh: Make the regexps accept both 32 and
        64 bit output.
        64 bit output.
2010-09-08  Rafael Espindola  
2010-09-08  Rafael Espindola  
        * script-sections.cc (Script_sections::add_memory_region): Convert
        * script-sections.cc (Script_sections::add_memory_region): Convert
        field precision to int.
        field precision to int.
        * script.cc (script_set_section_region, script_set_section_region):
        * script.cc (script_set_section_region, script_set_section_region):
        Convert field precision to int.
        Convert field precision to int.
2010-09-08  Rafael Espindola  
2010-09-08  Rafael Espindola  
        * arm.cc (do_finalize_sections): Create the __exidx_start and
        * arm.cc (do_finalize_sections): Create the __exidx_start and
        __exdix_end symbols even when the section is missing.
        __exdix_end symbols even when the section is missing.
2010-09-08  Nick Clifton  
2010-09-08  Nick Clifton  
        * README: Remove claim that MEMORY is not supported.
        * README: Remove claim that MEMORY is not supported.
        * expression.cc (script_exp_function_origin)
        * expression.cc (script_exp_function_origin)
        (script_exp_function_length): Move from here to ...
        (script_exp_function_length): Move from here to ...
        * script.cc: ... here.
        * script.cc: ... here.
        (script_set_section_region, script_add_memory)
        (script_set_section_region, script_add_memory)
        (script_parse_memory_attr, script_include_directive): New
        (script_parse_memory_attr, script_include_directive): New
        functions.
        functions.
        * script-sections.cc
        * script-sections.cc
        (class Memory_region): New class.
        (class Memory_region): New class.
        (class Output_section_definition): Add set_memory_region,
        (class Output_section_definition): Add set_memory_region,
        set_section_vma, set_section_lma and get_section_name methods.
        set_section_vma, set_section_lma and get_section_name methods.
        (class Script_Sections): Add add_memory_region,
        (class Script_Sections): Add add_memory_region,
        find_memory_region, find_memory_region_origin,
        find_memory_region, find_memory_region_origin,
        find_memory_region_length and set_memory_region methods.
        find_memory_region_length and set_memory_region methods.
        Have set_section_addresses method walk the list of set memory
        Have set_section_addresses method walk the list of set memory
        regions.
        regions.
        Extend the print methos to display memory regions.
        Extend the print methos to display memory regions.
        * script-sections.h: Add prototypes for new methods.
        * script-sections.h: Add prototypes for new methods.
        Add enum for MEMORY region attributes.
        Add enum for MEMORY region attributes.
        * yyscript.y: Add support for parsing MEMORY regions.
        * yyscript.y: Add support for parsing MEMORY regions.
        * script-c.h: Add prototypes for new functions.
        * script-c.h: Add prototypes for new functions.
        * testsuite/Makefile.am: Add test of MEMORY region functionality.
        * testsuite/Makefile.am: Add test of MEMORY region functionality.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/memory_test.sh: New script.
        * testsuite/memory_test.sh: New script.
        * testsuite/memory_test.s: New assembler source file.
        * testsuite/memory_test.s: New assembler source file.
        * testsuite/memory_test.t: New linker script.
        * testsuite/memory_test.t: New linker script.
2010-08-27  Doug Kwan  
2010-08-27  Doug Kwan  
        * gold/resolve.cc (Symbol_table::should_override): Let a weak
        * gold/resolve.cc (Symbol_table::should_override): Let a weak
        reference override an existing dynamic weak reference.
        reference override an existing dynamic weak reference.
        * testsuite/Makefile.am: Add new test dyn_weak_ref.
        * testsuite/Makefile.am: Add new test dyn_weak_ref.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/dyn_weak_ref.sh: New file.
        * testsuite/dyn_weak_ref.sh: New file.
        * testsuite/dyn_weak_ref_1.c: Ditto.
        * testsuite/dyn_weak_ref_1.c: Ditto.
        * testsuite/dyn_weak_ref_2.c: Ditto.
        * testsuite/dyn_weak_ref_2.c: Ditto.
2010-08-27  Ian Lance Taylor  
2010-08-27  Ian Lance Taylor  
        * incremental.h (class Incremental_input_entry): Add virtual
        * incremental.h (class Incremental_input_entry): Add virtual
        destructor.
        destructor.
2010-08-27  Ian Lance Taylor  
2010-08-27  Ian Lance Taylor  
        * testsuite/start_lib_test_3.c: Mark t3 as used.
        * testsuite/start_lib_test_3.c: Mark t3 as used.
2010-08-27  Nick Clifton  
2010-08-27  Nick Clifton  
        * options.cc (version_script): Fix small typo in previous
        * options.cc (version_script): Fix small typo in previous
        whitespace tidyup.
        whitespace tidyup.
2010-08-25  Nick Clifton  
2010-08-25  Nick Clifton  
        * archive.cc: Formatting fixes: Remove whitespace between
        * archive.cc: Formatting fixes: Remove whitespace between
        typename and following asterisk.  Remove whitespace between
        typename and following asterisk.  Remove whitespace between
        function name and opening parenthesis.
        function name and opening parenthesis.
        * archive.h: Likewise.
        * archive.h: Likewise.
        * arm.cc: Likewise.
        * arm.cc: Likewise.
        * attributes.cc: Likewise.
        * attributes.cc: Likewise.
        * attributes.h: Likewise.
        * attributes.h: Likewise.
        * common.cc: Likewise.
        * common.cc: Likewise.
        * copy-relocs.cc: Likewise.
        * copy-relocs.cc: Likewise.
        * dirsearch.h: Likewise.
        * dirsearch.h: Likewise.
        * dynobj.cc: Likewise.
        * dynobj.cc: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.h: Likewise.
        * ehframe.h: Likewise.
        * expression.cc: Likewise.
        * expression.cc: Likewise.
        * fileread.cc: Likewise.
        * fileread.cc: Likewise.
        * fileread.h: Likewise.
        * fileread.h: Likewise.
        * gc.h: Likewise.
        * gc.h: Likewise.
        * gold-threads.cc: Likewise.
        * gold-threads.cc: Likewise.
        * gold.cc: Likewise.
        * gold.cc: Likewise.
        * i386.cc: Likewise.
        * i386.cc: Likewise.
        * icf.h: Likewise.
        * icf.h: Likewise.
        * incremental-dump.cc: Likewise.
        * incremental-dump.cc: Likewise.
        * incremental.cc: Likewise.
        * incremental.cc: Likewise.
        * layout.cc: Likewise.
        * layout.cc: Likewise.
        * layout.h: Likewise.
        * layout.h: Likewise.
        * main.cc: Likewise.
        * main.cc: Likewise.
        * merge.cc: Likewise.
        * merge.cc: Likewise.
        * merge.h: Likewise.
        * merge.h: Likewise.
        * object.cc: Likewise.
        * object.cc: Likewise.
        * object.h: Likewise.
        * object.h: Likewise.
        * options.cc: Likewise.
        * options.cc: Likewise.
        * options.h: Likewise.
        * options.h: Likewise.
        * output.cc: Likewise.
        * output.cc: Likewise.
        * output.h: Likewise.
        * output.h: Likewise.
        * plugin.cc: Likewise.
        * plugin.cc: Likewise.
        * plugin.h: Likewise.
        * plugin.h: Likewise.
        * powerpc.cc: Likewise.
        * powerpc.cc: Likewise.
        * reloc.cc: Likewise.
        * reloc.cc: Likewise.
        * script-c.h: Likewise.
        * script-c.h: Likewise.
        * script-sections.cc: Likewise.
        * script-sections.cc: Likewise.
        * script.cc: Likewise.
        * script.cc: Likewise.
        * stringpool.cc: Likewise.
        * stringpool.cc: Likewise.
        * symtab.cc: Likewise.
        * symtab.cc: Likewise.
        * symtab.h: Likewise.
        * symtab.h: Likewise.
        * target.cc: Likewise.
        * target.cc: Likewise.
        * timer.cc: Likewise.
        * timer.cc: Likewise.
        * timer.h: Likewise.
        * timer.h: Likewise.
        * version.cc: Likewise.
        * version.cc: Likewise.
        * x86_64.cc: Likewise.
        * x86_64.cc: Likewise.
2010-08-24  Nick Clifton  
2010-08-24  Nick Clifton  
        PR 11899
        PR 11899
        * layout.cc (segment_precedes): Sort segments by their physical
        * layout.cc (segment_precedes): Sort segments by their physical
        addresses, if they have been set.
        addresses, if they have been set.
2010-08-23  Cary Coutant  
2010-08-23  Cary Coutant  
        * archive.cc (Lib_group::add_symbols): Lock object before deleting its
        * archive.cc (Lib_group::add_symbols): Lock object before deleting its
        symbols data.
        symbols data.
        (Lib_group::include_member): Unlock object after deleting its
        (Lib_group::include_member): Unlock object after deleting its
        symbols data.
        symbols data.
        * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
        * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
        the bug fixed here.
        the bug fixed here.
2010-08-19  Neil Vachharajani  
2010-08-19  Neil Vachharajani  
            Cary Coutant  
            Cary Coutant  
        * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
        * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
        constructor, and set_blocker.
        constructor, and set_blocker.
        * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
        * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
        readsyms_blocker_.
        readsyms_blocker_.
        * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
        * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
        this->this_blocker_ to Add_lib_group_symbols::set_blocker.
        this->this_blocker_ to Add_lib_group_symbols::set_blocker.
        * testsuite/Makefile.am (start_lib_test): New test case.
        * testsuite/Makefile.am (start_lib_test): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/start_lib_test_main.c: New file.
        * testsuite/start_lib_test_main.c: New file.
        * testsuite/start_lib_test_1.c: New file.
        * testsuite/start_lib_test_1.c: New file.
        * testsuite/start_lib_test_2.c: New file.
        * testsuite/start_lib_test_2.c: New file.
        * testsuite/start_lib_test_3.c: New file.
        * testsuite/start_lib_test_3.c: New file.
2010-08-19  Ian Lance Taylor  
2010-08-19  Ian Lance Taylor  
        * Makefile.in: Rebuild with automake 1.11.1.
        * Makefile.in: Rebuild with automake 1.11.1.
        * aclocal.m4: Likewise.
        * aclocal.m4: Likewise.
        * testsuite/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.
2010-08-19  Ian Lance Taylor  
2010-08-19  Ian Lance Taylor  
        PR 10893
        PR 10893
        * i386.cc (class Output_data_plt_i386): Update declarations.
        * i386.cc (class Output_data_plt_i386): Update declarations.
        Define Global_ifunc and Local_ifunc types.  Add global_ifuncs_ and
        Define Global_ifunc and Local_ifunc types.  Add global_ifuncs_ and
        local_ifuncs_ fields.
        local_ifuncs_ fields.
        (Target_i386::do_plt_section_for_global): New function.
        (Target_i386::do_plt_section_for_global): New function.
        (Target_i386::do_plt_section_for_local): New function.
        (Target_i386::do_plt_section_for_local): New function.
        (Output_data_plt_i386::Output_data_plt_i386): Add symtab
        (Output_data_plt_i386::Output_data_plt_i386): Add symtab
        parameter; change all callers.  Initialize global_ifuncs_ and
        parameter; change all callers.  Initialize global_ifuncs_ and
        local_ifuncs_.  If doing a static link define __rel_iplt_start and
        local_ifuncs_.  If doing a static link define __rel_iplt_start and
        __rel_iplt_end.
        __rel_iplt_end.
        (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
        (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
        (Output_data_plt_i386::add_local_ifunc_entry): New function.
        (Output_data_plt_i386::add_local_ifunc_entry): New function.
        (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
        (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
        symbols.
        symbols.
        (Target_i386::make_plt_section): New function, broken out of
        (Target_i386::make_plt_section): New function, broken out of
        make_plt_entry.  Set sh_info field of .rel.plt to point to .plt.
        make_plt_entry.  Set sh_info field of .rel.plt to point to .plt.
        (Target_i386::make_plt_entry): Call make_plt_section.
        (Target_i386::make_plt_entry): Call make_plt_section.
        (Target_i386::make_local_ifunc_plt_entry): New function.
        (Target_i386::make_local_ifunc_plt_entry): New function.
        (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
        (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
        (Target_i386::Scan::local): Handle IFUNC symbols.  Add
        (Target_i386::Scan::local): Handle IFUNC symbols.  Add
        R_386_IRELATIVE to switch.
        R_386_IRELATIVE to switch.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
        (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
        switch.
        switch.
        * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
        * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
        (Target_x86_64::do_plt_section_for_global): New function.
        (Target_x86_64::do_plt_section_for_global): New function.
        (Target_x86_64::do_plt_section_for_local): New function.
        (Target_x86_64::do_plt_section_for_local): New function.
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
        parameter; change all callers.  If doing a static link define
        parameter; change all callers.  If doing a static link define
        __rela_iplt_start and __rela_iplt_end.
        __rela_iplt_start and __rela_iplt_end.
        (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
        (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
        (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
        (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
        (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
        (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
        to point to .plt.
        to point to .plt.
        (Target_x86_64::make_local_ifunc_plt_entry): New function.
        (Target_x86_64::make_local_ifunc_plt_entry): New function.
        (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
        (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
        switch.
        switch.
        (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
        (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
        (Target_x86_64::Scan::local): Handle IFUNC symbols.  Add
        (Target_x86_64::Scan::local): Handle IFUNC symbols.  Add
        R_X86_64_IRELATIVE to switch.
        R_X86_64_IRELATIVE to switch.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
        (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
        switch.
        switch.
        * target.h (class Target): Add plt_section_for_global and
        * target.h (class Target): Add plt_section_for_global and
        plt_section_for_local functions.  Add do_plt_section_for_global
        plt_section_for_local functions.  Add do_plt_section_for_global
        and do_plt_section_for_local virtual functions.
        and do_plt_section_for_local virtual functions.
        * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol.  Add
        * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol.  Add
        clarifying comments.
        clarifying comments.
        (Symbol::use_plt_offset): Handle IFUNC symbol.
        (Symbol::use_plt_offset): Handle IFUNC symbol.
        * object.cc (Sized_relobj::Sized_relobj): Initialize
        * object.cc (Sized_relobj::Sized_relobj): Initialize
        local_plt_offsets_.
        local_plt_offsets_.
        (Sized_relobj::local_has_plt_offset): New function.
        (Sized_relobj::local_has_plt_offset): New function.
        (Sized_relobj::local_plt_offset): New function.
        (Sized_relobj::local_plt_offset): New function.
        (Sized_relobj::set_local_plt_offset): New function.
        (Sized_relobj::set_local_plt_offset): New function.
        (Sized_relobj::do_count): Handle IFUNC symbol.
        (Sized_relobj::do_count): Handle IFUNC symbol.
        * object.h (class Symbol_value): Add is_ifunc_symbol_ field.  Take
        * object.h (class Symbol_value): Add is_ifunc_symbol_ field.  Take
        a bit away from input_shndx_ field.  Add set_is_func_symbol and
        a bit away from input_shndx_ field.  Add set_is_func_symbol and
        is_ifunc_symbol functions.
        is_ifunc_symbol functions.
        (class Sized_relobj): Update declarations.  Remove Tls_got_entry
        (class Sized_relobj): Update declarations.  Remove Tls_got_entry
        and Local_tls_got_offsets.  Define Local_plt_offsets.  Add
        and Local_tls_got_offsets.  Define Local_plt_offsets.  Add
        local_plt_offsets_ field.
        local_plt_offsets_ field.
        (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
        (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
        * output.h (class Output_section_data): Add non-const
        * output.h (class Output_section_data): Add non-const
        output_section function.
        output_section function.
        (class Output_data_got): Update declarations.
        (class Output_data_got): Update declarations.
        (class Output_data_got::Got_entry): Add use_plt_offset_ field.
        (class Output_data_got::Got_entry): Add use_plt_offset_ field.
        Add use_plt_offset parameter to global and local constructors.
        Add use_plt_offset parameter to global and local constructors.
        Change all callers.  Change local_sym_index_ field to 31 bits.
        Change all callers.  Change local_sym_index_ field to 31 bits.
        Change GSYM_CODE and CONSTANT_CODE accordingly.
        Change GSYM_CODE and CONSTANT_CODE accordingly.
        * output.cc (Output_data_reloc_base::do_adjust_output_section): If
        * output.cc (Output_data_reloc_base::do_adjust_output_section): If
        doing a static link don't set sh_link field.
        doing a static link don't set sh_link field.
        (Output_data_got::Got_entry::write): Use PLT offset if
        (Output_data_got::Got_entry::write): Use PLT offset if
        appropriate.
        appropriate.
        (Output_data_got::add_global_plt): New function.
        (Output_data_got::add_global_plt): New function.
        (Output_data_got::add_local_plt): New function.
        (Output_data_got::add_local_plt): New function.
        * target-reloc.h (relocate_section): Handle IFUNC symbol.
        * target-reloc.h (relocate_section): Handle IFUNC symbol.
        * defstd.cc (in_section): Remove entries for __rel_iplt_start,
        * defstd.cc (in_section): Remove entries for __rel_iplt_start,
        __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
        __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
        * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
        * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
        * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
        * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
        IFUNC conditional.
        IFUNC conditional.
        * testsuite/ifunc-sel.h: New file.
        * testsuite/ifunc-sel.h: New file.
        * testsuite/ifuncmain1.c: New file.
        * testsuite/ifuncmain1.c: New file.
        * testsuite/ifuncmain1vis.c: New file.
        * testsuite/ifuncmain1vis.c: New file.
        * testsuite/ifuncmod1.c: New file.
        * testsuite/ifuncmod1.c: New file.
        * testsuite/ifuncdep2.c: New file.
        * testsuite/ifuncdep2.c: New file.
        * testsuite/ifuncmain2.c: New file.
        * testsuite/ifuncmain2.c: New file.
        * testsuite/ifuncmain3.c: New file.
        * testsuite/ifuncmain3.c: New file.
        * testsuite/ifuncmod3.c: New file.
        * testsuite/ifuncmod3.c: New file.
        * testsuite/ifuncmain4.c: New file.
        * testsuite/ifuncmain4.c: New file.
        * testsuite/ifuncmain5.c: New file.
        * testsuite/ifuncmain5.c: New file.
        * testsuite/ifuncmod5.c: New file.
        * testsuite/ifuncmod5.c: New file.
        * testsuite/ifuncmain6pie.c: New file.
        * testsuite/ifuncmain6pie.c: New file.
        * testsuite/ifuncmod6.c: New file.
        * testsuite/ifuncmod6.c: New file.
        * testsuite/ifuncmain7.c: New file.
        * testsuite/ifuncmain7.c: New file.
        * configure, testsuite/Makefile.in: Rebuild.
        * configure, testsuite/Makefile.in: Rebuild.
2010-08-18  Ian Lance Taylor  
2010-08-18  Ian Lance Taylor  
        * incremental.cc
        * incremental.cc
        (Output_section_incremental_inputs::write_input_files): Add cast
        (Output_section_incremental_inputs::write_input_files): Add cast
        to avoid signed/unsigned comparison warning.
        to avoid signed/unsigned comparison warning.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
        (Output_section_incremental_inputs::write_info_blocks): Likewise.
2010-08-12  Cary Coutant  
2010-08-12  Cary Coutant  
        * common.cc (Sort_commons::operator()): Remove unnecessary code.
        * common.cc (Sort_commons::operator()): Remove unnecessary code.
2010-08-13  Ian Lance Taylor  
2010-08-13  Ian Lance Taylor  
        * testsuite/incremental_test_1.c: Add prototype to avoid warning.
        * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2010-08-12  Cary Coutant  
2010-08-12  Cary Coutant  
            Doug Kwan  
            Doug Kwan  
        * resolve.cc (Symbol_table::should_override): When a weak dynamic
        * resolve.cc (Symbol_table::should_override): When a weak dynamic
        defintion overrides non-weak undef, remember that the original undef
        defintion overrides non-weak undef, remember that the original undef
        is not weak.
        is not weak.
        * symtab.cc (Symbol_table::sized_write_global): For undef without
        * symtab.cc (Symbol_table::sized_write_global): For undef without
        an original weak binding, set binding to global in output.
        an original weak binding, set binding to global in output.
        * testsuite/Makefile.am: Add new test strong_ref_weak_def.
        * testsuite/Makefile.am: Add new test strong_ref_weak_def.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/strong_ref_weak_def.sh: New file.
        * testsuite/strong_ref_weak_def.sh: New file.
        * testsuite/strong_ref_weak_def_1.c: Ditto.
        * testsuite/strong_ref_weak_def_1.c: Ditto.
        * testsuite/strong_ref_weak_def_2.c: Ditto.
        * testsuite/strong_ref_weak_def_2.c: Ditto.
2010-08-12  Cary Coutant  
2010-08-12  Cary Coutant  
        * testsuite/incremental_test.sh: Rewrite.
        * testsuite/incremental_test.sh: Rewrite.
        * testsuite/incremental_test_1.c: Rewrite.
        * testsuite/incremental_test_1.c: Rewrite.
        * testsuite/incremental_test_2.c: Rewrite.
        * testsuite/incremental_test_2.c: Rewrite.
2010-08-12  Cary Coutant  
2010-08-12  Cary Coutant  
        * arm.cc (Target_arm::got_size): Add const.
        * arm.cc (Target_arm::got_size): Add const.
        (Target_arm::got_entry_count): New function.
        (Target_arm::got_entry_count): New function.
        (Target_arm::plt_entry_count): New function.
        (Target_arm::plt_entry_count): New function.
        (Target_arm::first_plt_entry_offset): New function.
        (Target_arm::first_plt_entry_offset): New function.
        (Target_arm::plt_entry_size): New function.
        (Target_arm::plt_entry_size): New function.
        (Output_data_plt_arm::entry_count): New function.
        (Output_data_plt_arm::entry_count): New function.
        (Output_data_plt_arm::first_plt_entry_offset): New function.
        (Output_data_plt_arm::first_plt_entry_offset): New function.
        (Output_data_plt_arm::get_plt_entry_size): New function.
        (Output_data_plt_arm::get_plt_entry_size): New function.
        * i386.cc (Target_i386::got_size): Add const.
        * i386.cc (Target_i386::got_size): Add const.
        (Target_i386::got_entry_count): New function.
        (Target_i386::got_entry_count): New function.
        (Target_i386::plt_entry_count): New function.
        (Target_i386::plt_entry_count): New function.
        (Target_i386::first_plt_entry_offset): New function.
        (Target_i386::first_plt_entry_offset): New function.
        (Target_i386::plt_entry_size): New function.
        (Target_i386::plt_entry_size): New function.
        (Output_data_plt_i386::entry_count): New function.
        (Output_data_plt_i386::entry_count): New function.
        (Output_data_plt_i386::first_plt_entry_offset): New function.
        (Output_data_plt_i386::first_plt_entry_offset): New function.
        (Output_data_plt_i386::get_plt_entry_size): New function.
        (Output_data_plt_i386::get_plt_entry_size): New function.
        * incremental-dump.cc (dump_incremental_inputs): Adjust call to
        * incremental-dump.cc (dump_incremental_inputs): Adjust call to
        find_incremental_inputs_sections.  Dump incremental_got_plt section.
        find_incremental_inputs_sections.  Dump incremental_got_plt section.
        * incremental.cc: Include target.h.
        * incremental.cc: Include target.h.
        (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
        (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
        parameter.  Adjust all callers.  Find incremental_got_plt section.
        parameter.  Adjust all callers.  Find incremental_got_plt section.
        (Incremental_inputs::create_data_sections): Create incremental_got_plt
        (Incremental_inputs::create_data_sections): Create incremental_got_plt
        section.
        section.
        (Output_section_incremental_inputs::set_final_data_size): Calculate
        (Output_section_incremental_inputs::set_final_data_size): Calculate
        size of incremental_got_plt section.
        size of incremental_got_plt section.
        (Output_section_incremental_inputs::do_write): Write the
        (Output_section_incremental_inputs::do_write): Write the
        incremental_got_plt section.
        incremental_got_plt section.
        (Got_plt_view_info): New struct.
        (Got_plt_view_info): New struct.
        (Local_got_offset_visitor): New class.
        (Local_got_offset_visitor): New class.
        (Global_got_offset_visitor): New class.
        (Global_got_offset_visitor): New class.
        (Global_symbol_visitor_got_plt): New class.
        (Global_symbol_visitor_got_plt): New class.
        (Output_section_incremental_inputs::write_got_plt): New function.
        (Output_section_incremental_inputs::write_got_plt): New function.
        * incremental.h (Incremental_binary::find_incremental_inputs_sections):
        * incremental.h (Incremental_binary::find_incremental_inputs_sections):
        Add parameter.  Adjust all callers.
        Add parameter.  Adjust all callers.
        (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
        (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
        (Incremental_inputs::got_plt_section): New function.
        (Incremental_inputs::got_plt_section): New function.
        (Incremental_inputs::got_plt_section_): New data member.
        (Incremental_inputs::got_plt_section_): New data member.
        (Incremental_got_plt_reader): New class.
        (Incremental_got_plt_reader): New class.
        * layout.cc (Layout::create_incremental_info_sections): Add the
        * layout.cc (Layout::create_incremental_info_sections): Add the
        incremental_got_plt section.
        incremental_got_plt section.
        * object.h (Got_offset_list::get_list): New function.
        * object.h (Got_offset_list::get_list): New function.
        (Got offset_list::for_all_got_offsets): New function.
        (Got offset_list::for_all_got_offsets): New function.
        (Sized_relobj::local_got_offset_list): New function.
        (Sized_relobj::local_got_offset_list): New function.
        * powerpc.cc (Target_powerpc::got_size): Add const.
        * powerpc.cc (Target_powerpc::got_size): Add const.
        (Target_powerpc::got_entry_count): New function.
        (Target_powerpc::got_entry_count): New function.
        (Target_powerpc::plt_entry_count): New function.
        (Target_powerpc::plt_entry_count): New function.
        (Target_powerpc::first_plt_entry_offset): New function.
        (Target_powerpc::first_plt_entry_offset): New function.
        (Target_powerpc::plt_entry_size): New function.
        (Target_powerpc::plt_entry_size): New function.
        (Output_data_plt_powerpc::entry_count): New function.
        (Output_data_plt_powerpc::entry_count): New function.
        (Output_data_plt_powerpc::first_plt_entry_offset): New function.
        (Output_data_plt_powerpc::first_plt_entry_offset): New function.
        (Output_data_plt_powerpc::get_plt_entry_size): New function.
        (Output_data_plt_powerpc::get_plt_entry_size): New function.
        * sparc.cc (Target_sparc::got_size): Add const.
        * sparc.cc (Target_sparc::got_size): Add const.
        (Target_sparc::got_entry_count): New function.
        (Target_sparc::got_entry_count): New function.
        (Target_sparc::plt_entry_count): New function.
        (Target_sparc::plt_entry_count): New function.
        (Target_sparc::first_plt_entry_offset): New function.
        (Target_sparc::first_plt_entry_offset): New function.
        (Target_sparc::plt_entry_size): New function.
        (Target_sparc::plt_entry_size): New function.
        (Output_data_plt_sparc::entry_count): New function.
        (Output_data_plt_sparc::entry_count): New function.
        (Output_data_plt_sparc::first_plt_entry_offset): New function.
        (Output_data_plt_sparc::first_plt_entry_offset): New function.
        (Output_data_plt_sparc::get_plt_entry_size): New function.
        (Output_data_plt_sparc::get_plt_entry_size): New function.
        * symtab.h (Symbol::got_offset_list): New function.
        * symtab.h (Symbol::got_offset_list): New function.
        (Symbol_table::for_all_symbols): New function.
        (Symbol_table::for_all_symbols): New function.
        * target.h (Sized_target::got_entry_count): New function.
        * target.h (Sized_target::got_entry_count): New function.
        (Sized_target::plt_entry_count): New function.
        (Sized_target::plt_entry_count): New function.
        (Sized_target::plt_entry_size): New function.
        (Sized_target::plt_entry_size): New function.
        * x86_64.cc (Target_x86_64::got_size): Add const.
        * x86_64.cc (Target_x86_64::got_size): Add const.
        (Target_x86_64::got_entry_count): New function.
        (Target_x86_64::got_entry_count): New function.
        (Target_x86_64::plt_entry_count): New function.
        (Target_x86_64::plt_entry_count): New function.
        (Target_x86_64::first_plt_entry_offset): New function.
        (Target_x86_64::first_plt_entry_offset): New function.
        (Target_x86_64::plt_entry_size): New function.
        (Target_x86_64::plt_entry_size): New function.
        (Output_data_plt_x86_64::entry_count): New function.
        (Output_data_plt_x86_64::entry_count): New function.
        (Output_data_plt_x86_64::first_plt_entry_offset): New function.
        (Output_data_plt_x86_64::first_plt_entry_offset): New function.
        (Output_data_plt_x86_64::get_plt_entry_size): New function.
        (Output_data_plt_x86_64::get_plt_entry_size): New function.
2010-08-12  Cary Coutant  
2010-08-12  Cary Coutant  
        * archive.cc: Include incremental.h.
        * archive.cc: Include incremental.h.
        (Archive::Archive): Initialize incremental_info_.
        (Archive::Archive): Initialize incremental_info_.
        (Archive::include_member): Record archive members in incremental info.
        (Archive::include_member): Record archive members in incremental info.
        (Add_archive_symbols::run): Record begin and end of an archive in
        (Add_archive_symbols::run): Record begin and end of an archive in
        incremental info.
        incremental info.
        (Lib_group::include_member): Record objects in incremental info.
        (Lib_group::include_member): Record objects in incremental info.
        * archive.h (Incremental_archive_entry): Forward declaration.
        * archive.h (Incremental_archive_entry): Forward declaration.
        (Archive::set_incremental_info): New member function.
        (Archive::set_incremental_info): New member function.
        (Archive::incremental_info): New member function.
        (Archive::incremental_info): New member function.
        (Archive::Unused_symbol_iterator): New class.
        (Archive::Unused_symbol_iterator): New class.
        (Archive::unused_symbols_begin): New member function.
        (Archive::unused_symbols_begin): New member function.
        (Archive::unused_symbols_end): New member function.
        (Archive::unused_symbols_end): New member function.
        (Archive::incremental_info_): New data member.
        (Archive::incremental_info_): New data member.
        * incremental-dump.cc (find_input_containing_global): New function.
        * incremental-dump.cc (find_input_containing_global): New function.
        (dump_incremental_inputs): Dump new incremental info sections.
        (dump_incremental_inputs): Dump new incremental info sections.
        * incremental.cc: Include symtab.h.
        * incremental.cc: Include symtab.h.
        (Output_section_incremental_inputs): New class.
        (Output_section_incremental_inputs): New class.
        (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
        (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
        new incremental info sections.
        new incremental info sections.
        (Sized_incremental_binary::do_check_inputs): Likewise.
        (Sized_incremental_binary::do_check_inputs): Likewise.
        (Incremental_inputs::report_archive): Remove.
        (Incremental_inputs::report_archive): Remove.
        (Incremental_inputs::report_archive_begin): New function.
        (Incremental_inputs::report_archive_begin): New function.
        (Incremental_inputs::report_archive_end): New function.
        (Incremental_inputs::report_archive_end): New function.
        (Incremental_inputs::report_object): New function.
        (Incremental_inputs::report_object): New function.
        (Incremental_inputs::finalize_inputs): Remove.
        (Incremental_inputs::finalize_inputs): Remove.
        (Incremental_inputs::report_input_section): New function.
        (Incremental_inputs::report_input_section): New function.
        (Incremental_inputs::report_script): Rewrite.
        (Incremental_inputs::report_script): Rewrite.
        (Incremental_inputs::finalize): Do nothing but finalize string table.
        (Incremental_inputs::finalize): Do nothing but finalize string table.
        (Incremental_inputs::create_incremental_inputs_section_data): Remove.
        (Incremental_inputs::create_incremental_inputs_section_data): Remove.
        (Incremental_inputs::sized_create_inputs_section_data): Remove.
        (Incremental_inputs::sized_create_inputs_section_data): Remove.
        (Incremental_inputs::create_data_sections): New function.
        (Incremental_inputs::create_data_sections): New function.
        (Incremental_inputs::relocs_entsize): New function.
        (Incremental_inputs::relocs_entsize): New function.
        (Output_section_incremental_inputs::set_final_data_size): New function.
        (Output_section_incremental_inputs::set_final_data_size): New function.
        (Output_section_incremental_inputs::do_write): New function.
        (Output_section_incremental_inputs::do_write): New function.
        (Output_section_incremental_inputs::write_header): New function.
        (Output_section_incremental_inputs::write_header): New function.
        (Output_section_incremental_inputs::write_input_files): New function.
        (Output_section_incremental_inputs::write_input_files): New function.
        (Output_section_incremental_inputs::write_info_blocks): New function.
        (Output_section_incremental_inputs::write_info_blocks): New function.
        (Output_section_incremental_inputs::write_symtab): New function.
        (Output_section_incremental_inputs::write_symtab): New function.
        * incremental.h (Incremental_script_entry): Forward declaration.
        * incremental.h (Incremental_script_entry): Forward declaration.
        (Incremental_object_entry): Forward declaration.
        (Incremental_object_entry): Forward declaration.
        (Incremental_archive_entry): Forward declaration.
        (Incremental_archive_entry): Forward declaration.
        (Incremental_inputs): Forward declaration.
        (Incremental_inputs): Forward declaration.
        (Incremental_inputs_header_data): Remove.
        (Incremental_inputs_header_data): Remove.
        (Incremental_inputs_header): Remove.
        (Incremental_inputs_header): Remove.
        (Incremental_inputs_header_write): Remove.
        (Incremental_inputs_header_write): Remove.
        (Incremental_inputs_entry_data): Remove.
        (Incremental_inputs_entry_data): Remove.
        (Incremental_inputs_entry): Remove.
        (Incremental_inputs_entry): Remove.
        (Incremental_inputs_entry_write): Remove.
        (Incremental_inputs_entry_write): Remove.
        (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
        (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
        (Incremental_binary::find_incremental_inputs_sections): Add parameters.
        (Incremental_binary::find_incremental_inputs_sections): Add parameters.
        (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
        (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
        (Sized_ncremental_binary::do_find_incremental_inputs_sections):
        (Sized_ncremental_binary::do_find_incremental_inputs_sections):
        Likewise.
        Likewise.
        (Incremental_input_entry): New class.
        (Incremental_input_entry): New class.
        (Incremental_script_entry): New class.
        (Incremental_script_entry): New class.
        (Incremental_object_entry): New class.
        (Incremental_object_entry): New class.
        (Incremental_archive_entry): New class.
        (Incremental_archive_entry): New class.
        (Incremental_inputs::Incremental_inputs): Initialize new data members.
        (Incremental_inputs::Incremental_inputs): Initialize new data members.
        (Incremental_inputs::report_inputs): Remove.
        (Incremental_inputs::report_inputs): Remove.
        (Incremental_inputs::report_archive): Remove.
        (Incremental_inputs::report_archive): Remove.
        (Incremental_inputs::report_archive_begin): New function.
        (Incremental_inputs::report_archive_begin): New function.
        (Incremental_inputs::report_archive_end): New function.
        (Incremental_inputs::report_archive_end): New function.
        (Incremental_inputs::report_object): Change prototype.
        (Incremental_inputs::report_object): Change prototype.
        (Incremental_inputs::report_input_section): New function.
        (Incremental_inputs::report_input_section): New function.
        (Incremental_inputs::report_script): Change prototype.
        (Incremental_inputs::report_script): Change prototype.
        (Incremental_inputs::get_reloc_count): New function.
        (Incremental_inputs::get_reloc_count): New function.
        (Incremental_inputs::set_reloc_count): New function.
        (Incremental_inputs::set_reloc_count): New function.
        (Incremental_inputs::create_data_sections): New function.
        (Incremental_inputs::create_data_sections): New function.
        (Incremental_inputs::create_incremental_inputs_section_data): Remove.
        (Incremental_inputs::create_incremental_inputs_section_data): Remove.
        (Incremental_inputs::inputs_section): New function.
        (Incremental_inputs::inputs_section): New function.
        (Incremental_inputs::symtab_section): New function.
        (Incremental_inputs::symtab_section): New function.
        (Incremental_inputs::relocs_section): New function.
        (Incremental_inputs::relocs_section): New function.
        (Incremental_inputs::get_stringpool): Add const.
        (Incremental_inputs::get_stringpool): Add const.
        (Incremental_inputs::command_line): Add const.
        (Incremental_inputs::command_line): Add const.
        (Incremental_inputs::inputs): Remove.
        (Incremental_inputs::inputs): Remove.
        (Incremental_inputs::command_line_key): New function.
        (Incremental_inputs::command_line_key): New function.
        (Incremental_inputs::input_file_count): New function.
        (Incremental_inputs::input_file_count): New function.
        (Incremental_inputs::input_files): New function.
        (Incremental_inputs::input_files): New function.
        (Incremental_inputs::relocs_entsize): New function.
        (Incremental_inputs::relocs_entsize): New function.
        (Incremental_inputs::sized_create_inputs_section_data): Remove.
        (Incremental_inputs::sized_create_inputs_section_data): Remove.
        (Incremental_inputs::finalize_inputs): Remove.
        (Incremental_inputs::finalize_inputs): Remove.
        (Incremental_inputs::Input_info): Remove.
        (Incremental_inputs::Input_info): Remove.
        (Incremental_inputs::lock_): Remove.
        (Incremental_inputs::lock_): Remove.
        (Incremental_inputs::inputs_): Change type.
        (Incremental_inputs::inputs_): Change type.
        (Incremental_inputs::inputs_map_): Remove.
        (Incremental_inputs::inputs_map_): Remove.
        (Incremental_inputs::current_object_entry_): New data member.
        (Incremental_inputs::current_object_entry_): New data member.
        (Incremental_inputs::inputs_section_): New data member.
        (Incremental_inputs::inputs_section_): New data member.
        (Incremental_inputs::symtab_section_): New data member.
        (Incremental_inputs::symtab_section_): New data member.
        (Incremental_inputs::relocs_section_): New data member.
        (Incremental_inputs::relocs_section_): New data member.
        (Incremental_inputs::reloc_count_): New data member.
        (Incremental_inputs::reloc_count_): New data member.
        (Incremental_inputs_reader): New class.
        (Incremental_inputs_reader): New class.
        (Incremental_symtab_reader): New class.
        (Incremental_symtab_reader): New class.
        (Incremental_relocs_reader): New class.
        (Incremental_relocs_reader): New class.
        * layout.cc (Layout::finalize): Move finalization of incremental info
        * layout.cc (Layout::finalize): Move finalization of incremental info
        and creation of incremental info sections to follow finalization of
        and creation of incremental info sections to follow finalization of
        symbol table.  Set offsets for postprocessing sections.
        symbol table.  Set offsets for postprocessing sections.
        (Layout::create_incremental_info_sections): Call
        (Layout::create_incremental_info_sections): Call
        Incremental_inputs::create_data_sections.  Add incremental symtab
        Incremental_inputs::create_data_sections.  Add incremental symtab
        and relocs sections.  Set sh_entsize and sh_link fields.  Arrange for
        and relocs sections.  Set sh_entsize and sh_link fields.  Arrange for
        sections to layout after input sections.
        sections to layout after input sections.
        * layout.h (struct Timespec): Forward declaration.
        * layout.h (struct Timespec): Forward declaration.
        (Layout::incremental_inputs): Add const.
        (Layout::incremental_inputs): Add const.
        (Layout::create_incremental_info_sections): Add parameter.
        (Layout::create_incremental_info_sections): Add parameter.
        * main.cc (main): Remove call to Incremental_inputs::report_inputs.
        * main.cc (main): Remove call to Incremental_inputs::report_inputs.
        * object.cc: Include incremental.h.
        * object.cc: Include incremental.h.
        (Relobj::finalize_incremental_relocs): New function.
        (Relobj::finalize_incremental_relocs): New function.
        (Sized_relobj::do_layout): Record input sections in incremental info.
        (Sized_relobj::do_layout): Record input sections in incremental info.
        * object.h (Object::output_section): New function.
        * object.h (Object::output_section): New function.
        (Object::output_section_offset): Moved from Relobj.
        (Object::output_section_offset): Moved from Relobj.
        (Object::get_incremental_reloc_base): New function.
        (Object::get_incremental_reloc_base): New function.
        (Object::get_incremental_reloc_count): New function.
        (Object::get_incremental_reloc_count): New function.
        (Object::do_output_section): New function.
        (Object::do_output_section): New function.
        (Object::do_output_section_offset): Moved from Relobj.
        (Object::do_output_section_offset): Moved from Relobj.
        (Object::do_get_incremental_reloc_base): New function.
        (Object::do_get_incremental_reloc_base): New function.
        (Object::do_get_incremental_reloc_count): New function.
        (Object::do_get_incremental_reloc_count): New function.
        (Object::Object): Initialize new data members.
        (Object::Object): Initialize new data members.
        (Relobj::output_section): Renamed do_output_section and moved to
        (Relobj::output_section): Renamed do_output_section and moved to
        protected.
        protected.
        (Relobj::output_section_offset): Moved to Object.
        (Relobj::output_section_offset): Moved to Object.
        (Relobj::do_get_incremental_reloc_base): New function.
        (Relobj::do_get_incremental_reloc_base): New function.
        (Relobj::do_get_incremental_reloc_count): New function.
        (Relobj::do_get_incremental_reloc_count): New function.
        (Relobj::allocate_incremental_reloc_counts): New function.
        (Relobj::allocate_incremental_reloc_counts): New function.
        (Relobj::count_incremental_reloc): New function.
        (Relobj::count_incremental_reloc): New function.
        (Relobj::finalize_incremental_relocs): New function.
        (Relobj::finalize_incremental_relocs): New function.
        (Relobj::next_incremental_reloc_index): New function.
        (Relobj::next_incremental_reloc_index): New function.
        (Relobj::reloc_counts_): New data member.
        (Relobj::reloc_counts_): New data member.
        (Relobj::reloc_bases_): New data member.
        (Relobj::reloc_bases_): New data member.
        (Sized_relobj::do_relocate_sections): Add parameter.  Change caller.
        (Sized_relobj::do_relocate_sections): Add parameter.  Change caller.
        (Sized_relobj::relocate_sections): Add parameter.  Change all callers.
        (Sized_relobj::relocate_sections): Add parameter.  Change all callers.
        (Sized_relobj::incremental_relocs_scan): New function.
        (Sized_relobj::incremental_relocs_scan): New function.
        (Sized_relobj::incremental_relocs_scan_reltype): New function.
        (Sized_relobj::incremental_relocs_scan_reltype): New function.
        (Sized_relobj::incremental_relocs_write): New function.
        (Sized_relobj::incremental_relocs_write): New function.
        (Sized_relobj::incremental_relocs_write_reltype): New function.
        (Sized_relobj::incremental_relocs_write_reltype): New function.
        * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
        * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
        incremental link.
        incremental link.
        * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
        * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
        archives and object files elsewhere.
        archives and object files elsewhere.
        (Add_symbols::run): Report object files here.
        (Add_symbols::run): Report object files here.
        (Finish_group::run): Report end of archive at end of group.
        (Finish_group::run): Report end of archive at end of group.
        * reloc.cc: Include layout.h, incremental.h.
        * reloc.cc: Include layout.h, incremental.h.
        (Sized_relobj::do_read_relocs): Need relocations for incremental link.
        (Sized_relobj::do_read_relocs): Need relocations for incremental link.
        (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
        (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
        (Sized_relobj::incremental_relocs_scan): New function.
        (Sized_relobj::incremental_relocs_scan): New function.
        (Sized_relobj::incremental_relocs_scan_reltype): New function.
        (Sized_relobj::incremental_relocs_scan_reltype): New function.
        (Sized_relobj::do_relocate_sections): Write incremental relocations.
        (Sized_relobj::do_relocate_sections): Write incremental relocations.
        (Sized_relobj::incremental_relocs_write): New function.
        (Sized_relobj::incremental_relocs_write): New function.
        (Sized_relobj::incremental_relocs_write_reltype): New function.
        (Sized_relobj::incremental_relocs_write_reltype): New function.
        * script.cc (read_input_script): Rewrite test for incremental link.
        * script.cc (read_input_script): Rewrite test for incremental link.
        Change call to Incremental_inputs::report_script.
        Change call to Incremental_inputs::report_script.
        * symtab.h (Symbol_table::first_global_index): New function.
        * symtab.h (Symbol_table::first_global_index): New function.
        (Symbol_table::output_count): New function.
        (Symbol_table::output_count): New function.
2010-08-12  Doug Kwan  
2010-08-12  Doug Kwan  
        * arm.cc (Target_arm::merge_object_attributes): Check command line
        * arm.cc (Target_arm::merge_object_attributes): Check command line
        options --no-wchar-size-warning and --no-enum-size-warning.
        options --no-wchar-size-warning and --no-enum-size-warning.
        * options.h (General_options): Add ld-compatible options
        * options.h (General_options): Add ld-compatible options
        --no-enum-size-warning and --no-wchar-size-warning.
        --no-enum-size-warning and --no-wchar-size-warning.
2010-08-04  Ian Lance Taylor  
2010-08-04  Ian Lance Taylor  
        * x86_64.cc (Target_x86_64::Scan::local): Use
        * x86_64.cc (Target_x86_64::Scan::local): Use
        R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
        R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
        R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
        R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
2010-08-03  Cary Coutant  
2010-08-03  Cary Coutant  
        * merge.cc (Output_merge_string::do_add_input_section): Count strings
        * merge.cc (Output_merge_string::do_add_input_section): Count strings
        to reserve space in merged_strings vector. Keep total input size
        to reserve space in merged_strings vector. Keep total input size
        for stats.
        for stats.
        (Output_merge_string::do_print_merge_stats): Print total input size.
        (Output_merge_string::do_print_merge_stats): Print total input size.
        * merge.h (Output_merge_string): Add input_size_ field.
        * merge.h (Output_merge_string): Add input_size_ field.
        * stringpool.cc (Stringpool_template::string_length): Move
        * stringpool.cc (Stringpool_template::string_length): Move
        implementations out of Stringpool_template class and place in
        implementations out of Stringpool_template class and place in
        stringpool.h.
        stringpool.h.
        * stringpool.h (string_length): Move out of Stringpool_template.
        * stringpool.h (string_length): Move out of Stringpool_template.
2010-08-03  Ian Lance Taylor  
2010-08-03  Ian Lance Taylor  
        PR 11712
        PR 11712
        * layout.cc (relaxation_loop_body): If address of load segment is
        * layout.cc (relaxation_loop_body): If address of load segment is
        set, adjust address to include headers if possible.
        set, adjust address to include headers if possible.
2010-08-03  Ian Lance Taylor  
2010-08-03  Ian Lance Taylor  
        * version.cc (version_string): Bump to 1.10.
        * version.cc (version_string): Bump to 1.10.
2010-08-03  Ian Lance Taylor  
2010-08-03  Ian Lance Taylor  
        PR 11805
        PR 11805
        * layout.h (enum Output_section_order): Define.
        * layout.h (enum Output_section_order): Define.
        (class Layout): Update declarations.
        (class Layout): Update declarations.
        * layout.cc (Layout::get_output_section): Add order parameter.
        * layout.cc (Layout::get_output_section): Add order parameter.
        Remove is_interp, is_dynamic_linker_section, is_last_relro, and
        Remove is_interp, is_dynamic_linker_section, is_last_relro, and
        is_first_non_relro parameters.  Change all callers.
        is_first_non_relro parameters.  Change all callers.
        (Layout::choose_output_section): Likewise.
        (Layout::choose_output_section): Likewise.
        (Layout::add_output_section_data): Likewise.
        (Layout::add_output_section_data): Likewise.
        (Layout::make_output_section): Likewise.  Set order.
        (Layout::make_output_section): Likewise.  Set order.
        (Layout::default_section_order): New function.
        (Layout::default_section_order): New function.
        (Layout::layout_eh_frame): Call add_output_section_to_nonload.
        (Layout::layout_eh_frame): Call add_output_section_to_nonload.
        * output.cc (Output_section::Output_section): Initialize order_.
        * output.cc (Output_section::Output_section): Initialize order_.
        Don't initialize deleted fields.
        Don't initialize deleted fields.
        (Output_segment::Output_segment): Don't initialize deleted
        (Output_segment::Output_segment): Don't initialize deleted
        fields.
        fields.
        (Output_segment::add_output_section_to_load): New function
        (Output_segment::add_output_section_to_load): New function
        replacing add_output_section.  Change all callers to call this or
        replacing add_output_section.  Change all callers to call this or
        add_output_section_to_nonload.
        add_output_section_to_nonload.
        (Output_segment::add_output_section_to_nonload): New function.
        (Output_segment::add_output_section_to_nonload): New function.
        (Output_segment::remove_output_section): Rewrite.
        (Output_segment::remove_output_section): Rewrite.
        (Output_segment::add_initial_output_data): Likewise.
        (Output_segment::add_initial_output_data): Likewise.
        (Output_segment::has_any_data_sections): Likewise.
        (Output_segment::has_any_data_sections): Likewise.
        (Output_segment::is_first_section_relro): Likewise.
        (Output_segment::is_first_section_relro): Likewise.
        (Output_segment::maximum_alignment): Likewise.
        (Output_segment::maximum_alignment): Likewise.
        (Output_segment::has_dynamic_reloc): New function replacing
        (Output_segment::has_dynamic_reloc): New function replacing
        dynamic_reloc_count.  Change all callers.
        dynamic_reloc_count.  Change all callers.
        (Output_segment::has_dynamic_reloc_list): New function replacing
        (Output_segment::has_dynamic_reloc_list): New function replacing
        dynamic_reloc_count_list.  Change all callers.
        dynamic_reloc_count_list.  Change all callers.
        (Output_segment::set_section_addresses): Rewrite.
        (Output_segment::set_section_addresses): Rewrite.
        (Output_segment::set_offset): Rewrite.
        (Output_segment::set_offset): Rewrite.
        (Output_segment::find_first_and_last_list): Remove.
        (Output_segment::find_first_and_last_list): Remove.
        (Output_segment::set_tls_offsets): Rewrite.
        (Output_segment::set_tls_offsets): Rewrite.
        (Output_segment::first_section_load_address): Likewise.
        (Output_segment::first_section_load_address): Likewise.
        (Output_segment::output_section_count): Likewise.
        (Output_segment::output_section_count): Likewise.
        (Output_segment::section_with_lowest_load_address): Likewise.
        (Output_segment::section_with_lowest_load_address): Likewise.
        (Output_segment::write_section_headers): Likewise.
        (Output_segment::write_section_headers): Likewise.
        (Output_segment::print_sections_to_map): Likewise.
        (Output_segment::print_sections_to_map): Likewise.
        * output.h (class Output_data): Remove dynamic_reloc_count_
        * output.h (class Output_data): Remove dynamic_reloc_count_
        field.  Add has_dynamic_reloc_ field.  Make bools into bitfields.
        field.  Add has_dynamic_reloc_ field.  Make bools into bitfields.
        (Output_data::add_dynamic_reloc): Rewrite.
        (Output_data::add_dynamic_reloc): Rewrite.
        (Output_data::has_dynamic_reloc): New function.
        (Output_data::has_dynamic_reloc): New function.
        (Output_data::dynamic_reloc_count): Remove.
        (Output_data::dynamic_reloc_count): Remove.
        (class Output_section): Add order_ field.  Remvoe is_relro_local_,
        (class Output_section): Add order_ field.  Remvoe is_relro_local_,
        is_last_relro_, is_first_non_relro_, is_interp_,
        is_last_relro_, is_first_non_relro_, is_interp_,
        is_dynamic_linker_section_ fields.  Add order and set_order
        is_dynamic_linker_section_ fields.  Add order and set_order
        functions.  Remove is_relro_local, set_is_relro_local,
        functions.  Remove is_relro_local, set_is_relro_local,
        is_last_relro, set_is_last_relro, is_first_non_relro,
        is_last_relro, set_is_last_relro, is_first_non_relro,
        set_is_first_non_relro functions, is_interp, set_is_interp,
        set_is_first_non_relro functions, is_interp, set_is_interp,
        is_dynamic_linker_section, and set_is_dynamic_linker_section
        is_dynamic_linker_section, and set_is_dynamic_linker_section
        functions.
        functions.
        (class Output_segment): Change Output_data_list from std::list to
        (class Output_segment): Change Output_data_list from std::list to
        std:;vector.  Add output_lists_ field.  Remove output_data_ and
        std:;vector.  Add output_lists_ field.  Remove output_data_ and
        output_bss_ fields.  Update declarations.
        output_bss_ fields.  Update declarations.
2010-08-02  Ian Lance Taylor  
2010-08-02  Ian Lance Taylor  
        * arm.cc (Target_arm::gc_process_relocs): Use typename.
        * arm.cc (Target_arm::gc_process_relocs): Use typename.
        * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
        * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
        * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
        * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2010-08-02  Ian Lance Taylor  
2010-08-02  Ian Lance Taylor  
        PR 11855
        PR 11855
        * script.cc (Script_options::Script_options): Initialize
        * script.cc (Script_options::Script_options): Initialize
        symbol_definitions_ and symbol_references_.
        symbol_definitions_ and symbol_references_.
        (Script_options::add_symbol_assignment): Update
        (Script_options::add_symbol_assignment): Update
        symbol_definitions_ and symbol_references_.
        symbol_definitions_ and symbol_references_.
        (Script_options::add_symbol_reference): New function.
        (Script_options::add_symbol_reference): New function.
        (script_symbol): New function.
        (script_symbol): New function.
        * script.h (class Script_options): Add symbol_definitions_ and
        * script.h (class Script_options): Add symbol_definitions_ and
        symbol_references_ fields.
        symbol_references_ fields.
        (Script_options::referenced_const_iterator): New type.
        (Script_options::referenced_const_iterator): New type.
        (Script_options::referenced_begin): New function.
        (Script_options::referenced_begin): New function.
        (Script_options::referenced_end): New function.
        (Script_options::referenced_end): New function.
        (Script_options::is_referenced): New function.
        (Script_options::is_referenced): New function.
        (Script_options::any_unreferenced): New function.
        (Script_options::any_unreferenced): New function.
        * script-c.h (script_symbol): Declare.
        * script-c.h (script_symbol): Declare.
        * yyscript.y (exp): Call script_symbol.
        * yyscript.y (exp): Call script_symbol.
        * symtab.cc: Include "script.h".
        * symtab.cc: Include "script.h".
        (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
        (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
        Change all callers.  Check symbols referenced by scripts.
        Change all callers.  Check symbols referenced by scripts.
        (Symbol_table::add_undefined_symbols_from_command_line): Add
        (Symbol_table::add_undefined_symbols_from_command_line): Add
        layout parameter.  Change all callers.
        layout parameter.  Change all callers.
        (Symbol_table::do_add_undefined_symbols_from_command_line):
        (Symbol_table::do_add_undefined_symbols_from_command_line):
        Likewise.  Break out loop body.  Check symbols referenced by
        Likewise.  Break out loop body.  Check symbols referenced by
        scripts.
        scripts.
        (Symbol_table::add_undefined_symbol_from_command_line): New
        (Symbol_table::add_undefined_symbol_from_command_line): New
        function broken out of
        function broken out of
        do_add_undefined_symbols_from_command_line.
        do_add_undefined_symbols_from_command_line.
        * symtab.h (class Symbol_table): Update declarations.
        * symtab.h (class Symbol_table): Update declarations.
        * archive.cc: Include "layout.h".
        * archive.cc: Include "layout.h".
        (Archive::should_include_member): Add layout parameter.  Change
        (Archive::should_include_member): Add layout parameter.  Change
        all callers.  Check for symbol mentioned in expression.
        all callers.  Check for symbol mentioned in expression.
        * archive.h (class Archive): Update declaration.
        * archive.h (class Archive): Update declaration.
        * object.cc (Sized_relobj::do_should_include_member): Add layout
        * object.cc (Sized_relobj::do_should_include_member): Add layout
        parameter.
        parameter.
        * object.h (Object::should_include_member): Add layout parameter.
        * object.h (Object::should_include_member): Add layout parameter.
        Change all callers.
        Change all callers.
        (Object::do_should_include_member): Add layout parameter.
        (Object::do_should_include_member): Add layout parameter.
        (class Sized_relobj): Update declaration.
        (class Sized_relobj): Update declaration.
        * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
        * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
        parameter.
        parameter.
        * dynobj.h (class Sized_dynobj): Update declaration.
        * dynobj.h (class Sized_dynobj): Update declaration.
        * plugin.cc (Sized_pluginobj::do_should_include_member): Add
        * plugin.cc (Sized_pluginobj::do_should_include_member): Add
        layout parameter.
        layout parameter.
        * plugin.h (class Sized_pluginobj): Update declaration.
        * plugin.h (class Sized_pluginobj): Update declaration.
2010-08-02  Ian Lance Taylor  
2010-08-02  Ian Lance Taylor  
        PR 11866
        PR 11866
        * output.cc (Output_segment::set_offset): Search for the first and
        * output.cc (Output_segment::set_offset): Search for the first and
        last sections rather than assuming that the list is in order.
        last sections rather than assuming that the list is in order.
        (Output_segment::find_first_and_last_list): New function.
        (Output_segment::find_first_and_last_list): New function.
        * output.h (class Output_segment): Update declarations.
        * output.h (class Output_segment): Update declarations.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
        (relro_strip_test_SOURCES): New variable.
        (relro_strip_test_SOURCES): New variable.
        (relro_strip_test_DEPENDENCIES): New variable.
        (relro_strip_test_DEPENDENCIES): New variable.
        (relro_strip_test_LDFLAGS): New variable.
        (relro_strip_test_LDFLAGS): New variable.
        (relro_strip_test_LDADD): New variable.
        (relro_strip_test_LDADD): New variable.
        (relro_strip_test.so): New target.
        (relro_strip_test.so): New target.
2010-08-02  Ian Lance Taylor  
2010-08-02  Ian Lance Taylor  
        * i386.cc (class Target_i386): Add got_tlsdesc_ field.
        * i386.cc (class Target_i386): Add got_tlsdesc_ field.
        (Target_i386::Target_i386):: Initialize got_tlsdesc_.
        (Target_i386::Target_i386):: Initialize got_tlsdesc_.
        (Target_i386::got_tlsdesc_section): New function.
        (Target_i386::got_tlsdesc_section): New function.
        (Target_i386::got_section): Create space for GOT entries for
        (Target_i386::got_section): Create space for GOT entries for
        TLSDESC relocations.
        TLSDESC relocations.
        (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
        (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
        R_386_TLS_GOTDESC.
        R_386_TLS_GOTDESC.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
        (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
        using TLSDESC GOT.
        using TLSDESC GOT.
        * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
        * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
        (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
        (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
        (Target_x86_64::got_tlsdesc_section): New function.
        (Target_x86_64::got_tlsdesc_section): New function.
        (Target_x86_64::got_section): Create space for GOT entries for
        (Target_x86_64::got_section): Create space for GOT entries for
        TLSDESC relocations.
        TLSDESC relocations.
        (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
        (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
        R_386_TLS_GOTDESC.
        R_386_TLS_GOTDESC.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
        (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
        using TLSDESC GOT.
        using TLSDESC GOT.
2010-08-02  Ian Lance Taylor  
2010-08-02  Ian Lance Taylor  
        * testsuite/final_layout.sh: Use dc to convert from hex to
        * testsuite/final_layout.sh: Use dc to convert from hex to
        decimal.
        decimal.
2010-07-29  Sriraman Tallam  
2010-07-29  Sriraman Tallam  
        * arm.cc (Target_arm::gc_process_relocs): Add template
        * arm.cc (Target_arm::gc_process_relocs): Add template
        paramter to the call to gold::gc_process_relocs.
        paramter to the call to gold::gc_process_relocs.
        * i386.cc (Target_i386::gc_process_relocs): Add template
        * i386.cc (Target_i386::gc_process_relocs): Add template
        paramter to the call to gold::gc_process_relocs.
        paramter to the call to gold::gc_process_relocs.
        * x86_64.cc (Target_x86_64::gc_process_relocs): Add template
        * x86_64.cc (Target_x86_64::gc_process_relocs): Add template
        parameter to the call to gold::gc_process_relocs.
        parameter to the call to gold::gc_process_relocs.
        * powerpc.cc (Target_powerpc::gc_process_relocs): Add
        * powerpc.cc (Target_powerpc::gc_process_relocs): Add
        template parameter to the call to gold::gc_process_relocs.
        template parameter to the call to gold::gc_process_relocs.
        * sparc.cc (Target_sparc::gc_process_relocs): Add template
        * sparc.cc (Target_sparc::gc_process_relocs): Add template
        paramter to the call to gold::gc_process_relocs.
        paramter to the call to gold::gc_process_relocs.
        * gc.h (get_embedded_addend_size): New function.
        * gc.h (get_embedded_addend_size): New function.
        (gc_process_relocs): Save the size of the reloc for use by ICF.
        (gc_process_relocs): Save the size of the reloc for use by ICF.
        * icf.cc (get_section_contents): Get the addend from the text section
        * icf.cc (get_section_contents): Get the addend from the text section
        for SHT_REL relocation sections.
        for SHT_REL relocation sections.
        * icf.h (Icf::Reloc_addend_size_info): New typedef.
        * icf.h (Icf::Reloc_addend_size_info): New typedef.
        (Icf::Reloc_info): Add new member reloc_addend_size_info.
        (Icf::Reloc_info): Add new member reloc_addend_size_info.
        * int_encoding.h (read_from_pointer): New overloaded function.
        * int_encoding.h (read_from_pointer): New overloaded function.
        * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
        * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
        * testsuite/icf_sht_rel_addend_test.sh: New file.
        * testsuite/icf_sht_rel_addend_test.sh: New file.
        * testsuite/icf_sht_rel_addend_test_1.cc: New file.
        * testsuite/icf_sht_rel_addend_test_1.cc: New file.
        * testsuite/icf_sht_rel_addend_test_2.cc: New file.
        * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2010-07-28  Ralf Wildenhues  
2010-07-28  Ralf Wildenhues  
        * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
        * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-07-27  Jeffrey Yasskin  
2010-07-27  Jeffrey Yasskin  
        * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
        * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
        * gold/testsuite/debug_msg.cc: Likewise.
        * gold/testsuite/debug_msg.cc: Likewise.
        * gold/testsuite/odr_violation1.cc
        * gold/testsuite/odr_violation1.cc
        * gold/testsuite/odr_violation2.cc
        * gold/testsuite/odr_violation2.cc
2010-07-21  Cary Coutant  
2010-07-21  Cary Coutant  
        * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
        * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
        string, and length fields.
        string, and length fields.
        (Output_merge_string::Merged_strings_list): New type.
        (Output_merge_string::Merged_strings_list): New type.
        (Output_merge_string::Merged_strings_lists): New typedef.
        (Output_merge_string::Merged_strings_lists): New typedef.
        (Output_merge_string): Replace merged_strings_ with
        (Output_merge_string): Replace merged_strings_ with
        merged_strings_lists_.
        merged_strings_lists_.
        * merge.cc (Output_merge_string::do_add_input_section): Allocate new
        * merge.cc (Output_merge_string::do_add_input_section): Allocate new
        Merged_strings_list per input object and section.  Don't store pointer
        Merged_strings_list per input object and section.  Don't store pointer
        to the string.  Don't store length with each merged string entry.
        to the string.  Don't store length with each merged string entry.
        (Output_merge_string::finalize_merged_data): Loop over list of merged
        (Output_merge_string::finalize_merged_data): Loop over list of merged
        strings lists.  Recompute length of each merged string.
        strings lists.  Recompute length of each merged string.
2010-07-15  Cary Coutant  
2010-07-15  Cary Coutant  
        * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
        * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
        here.
        here.
2010-07-14  Ian Lance Taylor  
2010-07-14  Ian Lance Taylor  
        * descriptors.cc (Descriptors::open): Report correct name in error
        * descriptors.cc (Descriptors::open): Report correct name in error
        message.
        message.
2010-07-13  Doug Kwan  
2010-07-13  Doug Kwan  
        * arm.cc (Arm_input_section::Arm_input_section): For a
        * arm.cc (Arm_input_section::Arm_input_section): For a
        SHT_ARM_EXIDX section, always keeps the input sections.
        SHT_ARM_EXIDX section, always keeps the input sections.
        (Arm_input_section::set_exidx_section_link): New method.
        (Arm_input_section::set_exidx_section_link): New method.
        (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
        (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
        has_errors_ to false.
        has_errors_ to false.
        (Arm_exidx_input_section::has_errors,
        (Arm_exidx_input_section::has_errors,
        Arm_exidx_input_section::set_has_errors): New methods.
        Arm_exidx_input_section::set_has_errors): New methods.
        (Arm_exidx_input_section::has_errors_): New data member.
        (Arm_exidx_input_section::has_errors_): New data member.
        (Arm_relobj::get_exidx_shndx_list): New method.
        (Arm_relobj::get_exidx_shndx_list): New method.
        (Arm_output_section::append_text_sections_to_list): Do not skip
        (Arm_output_section::append_text_sections_to_list): Do not skip
        section without SHF_EXECINSTR.
        section without SHF_EXECINSTR.
        (Arm_output_section::fix_exidx_coverage): Skip input sections with
        (Arm_output_section::fix_exidx_coverage): Skip input sections with
        errors.
        errors.
        (Arm_relobj::make_exidx_input_section): Add new parameter for text
        (Arm_relobj::make_exidx_input_section): Add new parameter for text
        section header.  Make error messages more verbose.  Check for
        section header.  Make error messages more verbose.  Check for
        a non-executable section linked to an EXIDX section.
        a non-executable section linked to an EXIDX section.
        (Arm_relobj::do_read_symbols): Remove error checking, which has been
        (Arm_relobj::do_read_symbols): Remove error checking, which has been
        moved to Arm_relobj::make_exidx_input_section.  Add an assertion to
        moved to Arm_relobj::make_exidx_input_section.  Add an assertion to
        check that there is no deferred EXIDX section if we exit early.
        check that there is no deferred EXIDX section if we exit early.
        Instead of not making an EXIDX section in case of an error, make one
        Instead of not making an EXIDX section in case of an error, make one
        and set the has_errors flag of it.
        and set the has_errors flag of it.
        (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
        (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
        in a relocatable link.
        in a relocatable link.
        (Target_arm::do_relax): Look for the EXIDX output section instead of
        (Target_arm::do_relax): Look for the EXIDX output section instead of
        assuming that it is called .ARM.exidx.
        assuming that it is called .ARM.exidx.
        (Target_arm::fix_exidx_coverage): Add a new parameter for input
        (Target_arm::fix_exidx_coverage): Add a new parameter for input
        section list.  Do not check for SHF_EXECINSTR section flags but
        section list.  Do not check for SHF_EXECINSTR section flags but
        skip any input section with errors.
        skip any input section with errors.
        * output.cc (Output_section::Output_section): Initialize
        * output.cc (Output_section::Output_section): Initialize
        always_keeps_input_sections_ to false.
        always_keeps_input_sections_ to false.
        (Output_section::add_input_section): Check for
        (Output_section::add_input_section): Check for
        always_keeps_input_sections_.
        always_keeps_input_sections_.
        *  output.h (Output_section::always_keeps_input_sections,
        *  output.h (Output_section::always_keeps_input_sections,
        Output_section::set_always_keeps_input_sections): New methods.
        Output_section::set_always_keeps_input_sections): New methods.
        (Output_section::always_keeps_input_sections): New data member.
        (Output_section::always_keeps_input_sections): New data member.
2010-07-13  Rafael Espindola  
2010-07-13  Rafael Espindola  
        * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
        * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
        * fileread.h (Input_file): Add try_extra_search_path and find_file.
        * fileread.h (Input_file): Add try_extra_search_path and find_file.
2010-07-13  Philip Herron  
2010-07-13  Philip Herron  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * output.h (Output_section_lookup_maps::add_merge_section):
        * output.h (Output_section_lookup_maps::add_merge_section):
        Correct check of whether value was inserted.
        Correct check of whether value was inserted.
        (Output_section_lookup_maps::add_merge_input_section): Likewise.
        (Output_section_lookup_maps::add_merge_input_section): Likewise.
        (Output_section_lookup_maps::add_relaxed_input_section):
        (Output_section_lookup_maps::add_relaxed_input_section):
        Likewise.
        Likewise.
        * arm.cc (Target_arm::got_section): Remove used local os.
        * arm.cc (Target_arm::got_section): Remove used local os.
        * i386.cc (Target_i386::got_section): Likewise.
        * i386.cc (Target_i386::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * sparc.cc (Target_sparc::got_section): Likewise.
        * sparc.cc (Target_sparc::got_section): Likewise.
        (Target_sparc::relocate): Remove unused local have_got_offset.
        (Target_sparc::relocate): Remove unused local have_got_offset.
        * powerpc.cc (Target_powerpc::relocate): Likewise.
        * powerpc.cc (Target_powerpc::relocate): Likewise.
2010-07-13  Ian Lance Taylor  
2010-07-13  Ian Lance Taylor  
        * compressed_output.cc (zlib_decompress): Fix signature in
        * compressed_output.cc (zlib_decompress): Fix signature in
        !HAVE_ZLIB_H case.
        !HAVE_ZLIB_H case.
        * archive.cc (Archive::include_member): Unlock an external member
        * archive.cc (Archive::include_member): Unlock an external member
        of a thin archive.  Don't bother to delete an object we know is
        of a thin archive.  Don't bother to delete an object we know is
        NULL.
        NULL.
2010-07-12  Cary Coutant  
2010-07-12  Cary Coutant  
        * compressed_output.cc (zlib_decompress): New function.
        * compressed_output.cc (zlib_decompress): New function.
        (get_uncompressed_size): New function.
        (get_uncompressed_size): New function.
        (decompress_input_section): New function.
        (decompress_input_section): New function.
        * compressed_output.h (get_uncompressed_size): New function.
        * compressed_output.h (get_uncompressed_size): New function.
        (decompress_input_section): New function.
        (decompress_input_section): New function.
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
        Handle compressed debug sections.
        Handle compressed debug sections.
        * layout.cc (is_compressed_debug_section): New function.
        * layout.cc (is_compressed_debug_section): New function.
        (Layout::output_section_name): Map compressed section names to
        (Layout::output_section_name): Map compressed section names to
        canonical names.
        canonical names.
        * layout.h (is_compressed_debug_section): New function.
        * layout.h (is_compressed_debug_section): New function.
        (is_debug_info_section): Recognize compressed debug sections.
        (is_debug_info_section): Recognize compressed debug sections.
        * merge.cc: Include compressed_output.h.
        * merge.cc: Include compressed_output.h.
        (Output_merge_data::do_add_input_section): Handle compressed
        (Output_merge_data::do_add_input_section): Handle compressed
        debug sections.
        debug sections.
        (Output_merge_string::do_add_input_section): Handle compressed
        (Output_merge_string::do_add_input_section): Handle compressed
        debug sections.
        debug sections.
        * object.cc: Include compressed_output.h.
        * object.cc: Include compressed_output.h.
        (Sized_relobj::Sized_relobj): Initialize new data members.
        (Sized_relobj::Sized_relobj): Initialize new data members.
        (build_compressed_section_map): New function.
        (build_compressed_section_map): New function.
        (Sized_relobj::do_read_symbols): Handle compressed debug sections.
        (Sized_relobj::do_read_symbols): Handle compressed debug sections.
        * object.h (Object::section_is_compressed): New method.
        * object.h (Object::section_is_compressed): New method.
        (Object::do_section_is_compressed): New method.
        (Object::do_section_is_compressed): New method.
        (Sized_relobj::Compressed_section_map): New type.
        (Sized_relobj::Compressed_section_map): New type.
        (Sized_relobj::do_section_is_compressed): New method.
        (Sized_relobj::do_section_is_compressed): New method.
        (Sized_relobj::compressed_sections_): New data member.
        (Sized_relobj::compressed_sections_): New data member.
        * output.cc (Output_section::add_input_section): Handle compressed
        * output.cc (Output_section::add_input_section): Handle compressed
        debug sections.
        debug sections.
        * reloc.cc: Include compressed_output.h.
        * reloc.cc: Include compressed_output.h.
        (Sized_relobj::write_sections): Handle compressed debug sections.
        (Sized_relobj::write_sections): Handle compressed debug sections.
2010-07-08  Cary Coutant  
2010-07-08  Cary Coutant  
        * resolve.cc (Symbol_table::resolve): Remember whether undef was
        * resolve.cc (Symbol_table::resolve): Remember whether undef was
        weak when resolving to a dynamic def.
        weak when resolving to a dynamic def.
        (Symbol_table::should_override): Add adjust_dyndef flag; set it
        (Symbol_table::should_override): Add adjust_dyndef flag; set it
        for weak undef/dynamic def cases. Adjust callers.
        for weak undef/dynamic def cases. Adjust callers.
        * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
        * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
        undef_binding_weak_.
        undef_binding_weak_.
        (Symbol_table::sized_write_globals): Adjust symbol binding.
        (Symbol_table::sized_write_globals): Adjust symbol binding.
        (Symbol_table::sized_write_symbol): Add binding parameter.
        (Symbol_table::sized_write_symbol): Add binding parameter.
        * symtab.h (Symbol::set_undef_binding): New method.
        * symtab.h (Symbol::set_undef_binding): New method.
        (Symbol::is_undef_binding_weak): New method.
        (Symbol::is_undef_binding_weak): New method.
        (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
        (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
        (Symbol_table::should_override): Add new parameter.
        (Symbol_table::should_override): Add new parameter.
        (Symbol_table::sized_write_symbol): Add new parameter.
        (Symbol_table::sized_write_symbol): Add new parameter.
        * testsuite/weak_undef_file1.cc: Add new test case.
        * testsuite/weak_undef_file1.cc: Add new test case.
        * testsuite/weak_undef_file2.cc: Fix header comment.
        * testsuite/weak_undef_file2.cc: Fix header comment.
        * testsuite/weak_undef_test.cc: Add new test case.
        * testsuite/weak_undef_test.cc: Add new test case.
2010-06-29  Doug Kwan  
2010-06-29  Doug Kwan  
        * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
        * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
        Initialize USE_SYMBOL_.
        Initialize USE_SYMBOL_.
        * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
        * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
        definition.
        definition.
        (Arm_reloc_property::uses_symbol_): New data member declaration.
        (Arm_reloc_property::uses_symbol_): New data member declaration.
        * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
        * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
        uses symbol value and symbol is undefined but not weakly undefined.
        uses symbol value and symbol is undefined but not weakly undefined.
2010-06-28  Rafael Espindola  
2010-06-28  Rafael Espindola  
        * plugin.cc (Plugin::load): Use dlerror.
        * plugin.cc (Plugin::load): Use dlerror.
2010-06-26  Jeffrey Yaskin  
2010-06-26  Jeffrey Yaskin  
        * symtab.cc (detect_odr_violations): When reporting an ODR
        * symtab.cc (detect_odr_violations): When reporting an ODR
        violation, report an object where the symbol is defined.
        violation, report an object where the symbol is defined.
2010-06-25  Doug Kwan  
2010-06-25  Doug Kwan  
        * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
        * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
        (Target_arm::section_may_have_icf_unsafe_pointers): New method
        (Target_arm::section_may_have_icf_unsafe_pointers): New method
        definition.
        definition.
        (Target_arm::Scan::local_reloc_may_be_function_pointer,
        (Target_arm::Scan::local_reloc_may_be_function_pointer,
        Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
        Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
        target hook to detect function points.
        target hook to detect function points.
        (Target_arm::Scan::possible_function_pointer_reloc): New method.
        (Target_arm::Scan::possible_function_pointer_reloc): New method.
        * icf.h (Icf::check_section_for_function_pointers): Change type of
        * icf.h (Icf::check_section_for_function_pointers): Change type of
        parameter SECTION_NAME to const reference to std::string.  Use
        parameter SECTION_NAME to const reference to std::string.  Use
        target hook to determine if section may have unsafe pointers.
        target hook to determine if section may have unsafe pointers.
        * target.h (Target::section_may_have_icf_unsafe_pointers): New
        * target.h (Target::section_may_have_icf_unsafe_pointers): New
        method definition.
        method definition.
2010-06-21  Rafael Espindola  
2010-06-21  Rafael Espindola  
        * fileread.cc (Input_file::find_fie): New
        * fileread.cc (Input_file::find_fie): New
        (Input_file::open): Use Input_file::find_fie.
        (Input_file::open): Use Input_file::find_fie.
        * fileread.h (Input_file::find_fie): New
        * fileread.h (Input_file::find_fie): New
        * plugin.cc (set_extra_library_path): New.
        * plugin.cc (set_extra_library_path): New.
        (Plugin::load): Add set_extra_library_path to the transfer vector.
        (Plugin::load): Add set_extra_library_path to the transfer vector.
        (Plugin_manager::set_extra_library_path): New.
        (Plugin_manager::set_extra_library_path): New.
        (Plugin_manager::add_input_file): Use the extra search path if set.
        (Plugin_manager::add_input_file): Use the extra search path if set.
        (set_extra_library_path(): New.
        (set_extra_library_path(): New.
        * plugin.h (Plugin_manager): Add set_extra_library_path and
        * plugin.h (Plugin_manager): Add set_extra_library_path and
        extra_search_path_.
        extra_search_path_.
2010-06-19  Cary Coutant  
2010-06-19  Cary Coutant  
        * layout.cc (gdb_sections): Add .debug_types.
        * layout.cc (gdb_sections): Add .debug_types.
        (lines_only_debug_sections): Likewise.
        (lines_only_debug_sections): Likewise.
2010-06-18  Rafael Espindola  
2010-06-18  Rafael Espindola  
        * plugin.cc (add_input_file,add_input_library)
        * plugin.cc (add_input_file,add_input_library)
        (Plugin_manager::add_input_file): Make filename arguments const.
        (Plugin_manager::add_input_file): Make filename arguments const.
        * plugin.h (Plugin_manager::add_input_file): Make filename arguments
        * plugin.h (Plugin_manager::add_input_file): Make filename arguments
        const.
        const.
2010-06-16  Doug Kwan  
2010-06-16  Doug Kwan  
        * arm.cc (Target_arm::do_finalize_sections): Do not emit an
        * arm.cc (Target_arm::do_finalize_sections): Do not emit an
        .ARM.attributes section if we have not merged any input
        .ARM.attributes section if we have not merged any input
        attributes sections.
        attributes sections.
2010-06-15  Viktor Kutuzov  
2010-06-15  Viktor Kutuzov  
        * arm.cc: Allow combining objects with no EABI version
        * arm.cc: Allow combining objects with no EABI version
        information.
        information.
2010-06-15  Rafael Espindola  
2010-06-15  Rafael Espindola  
        * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
        * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2010-06-15  Viktor Kutuzov  
2010-06-15  Viktor Kutuzov  
        * fileread.cc: Only #include  if HAVE_READV.
        * fileread.cc: Only #include  if HAVE_READV.
        (struct iovec): Correct !HAVE_READV definition.
        (struct iovec): Correct !HAVE_READV definition.
2010-06-10  Cary Coutant  
2010-06-10  Cary Coutant  
        * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
        * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
        (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
        (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
        reloc sections.
        reloc sections.
        * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
        * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
        PR 11683
        PR 11683
        * symtab.h (Symbol::is_placeholder): New member function.
        * symtab.h (Symbol::is_placeholder): New member function.
        * target-reloc.h (relocate_section): Check for placeholder symbols.
        * target-reloc.h (relocate_section): Check for placeholder symbols.
        * testsuite/Makefile.am (plugin_test_8): New test.
        * testsuite/Makefile.am (plugin_test_8): New test.
        (plugin_test_9): New test.
        (plugin_test_9): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-06-09  Nick Clifton  
2010-06-09  Nick Clifton  
        * yyscript.y (input_list_element): Allow strings prefixed with
        * yyscript.y (input_list_element): Allow strings prefixed with
        the '-' character.  Treat these as libraries.
        the '-' character.  Treat these as libraries.
        * script.cc (script_add_library): New function.  Adds a library
        * script.cc (script_add_library): New function.  Adds a library
        specified by "-l" found in an input script.
        specified by "-l" found in an input script.
        * script-c.h: Add prototype for script_add_library.
        * script-c.h: Add prototype for script_add_library.
2010-06-07  Doug Kwan  
2010-06-07  Doug Kwan  
        * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
        * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
        Restrict stub-group size to be within long conditional branch
        Restrict stub-group size to be within long conditional branch
        range when working around cortex-A8 erratum.
        range when working around cortex-A8 erratum.
2010-06-07  Damien Diederen  
2010-06-07  Damien Diederen  
        * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
        * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
        #ifdef typo.
        #ifdef typo.
2010-06-03  Sriraman Tallam  
2010-06-03  Sriraman Tallam  
        PR gold/11658
        PR gold/11658
        * output.cc
        * output.cc
        (Output_section::Input_section_sort_entry::compare_section_ordering):
        (Output_section::Input_section_sort_entry::compare_section_ordering):
        Change to return non-zero correctly.
        Change to return non-zero correctly.
        (Output_section::Input_section_sort_section_order_index_compare
        (Output_section::Input_section_sort_section_order_index_compare
        ::operator()): Change to fix ambiguity in comparisons.
        ::operator()): Change to fix ambiguity in comparisons.
2010-06-01  Sriraman Tallam  
2010-06-01  Sriraman Tallam  
        * gold.h (is_wildcard_string): New function.
        * gold.h (is_wildcard_string): New function.
        * layout.cc (Layout::layout): Pass this pointer to add_input_section.
        * layout.cc (Layout::layout): Pass this pointer to add_input_section.
        (Layout::layout_eh_frame): Ditto.
        (Layout::layout_eh_frame): Ditto.
        (Layout::find_section_order_index): New method.
        (Layout::find_section_order_index): New method.
        (Layout::read_layout_from_file): New method.
        (Layout::read_layout_from_file): New method.
        * layout.h (Layout::find_section_order_index): New method.
        * layout.h (Layout::find_section_order_index): New method.
        (Layout::read_layout_from_file): New method.
        (Layout::read_layout_from_file): New method.
        (Layout::input_section_position_): New private member.
        (Layout::input_section_position_): New private member.
        (Layout::input_section_glob_): New private member.
        (Layout::input_section_glob_): New private member.
        * main.cc (main): Call read_layout_from_file here.
        * main.cc (main): Call read_layout_from_file here.
        * options.h (--section-ordering-file): New option.
        * options.h (--section-ordering-file): New option.
        * output.cc (Output_section::input_section_order_specified_): New
        * output.cc (Output_section::input_section_order_specified_): New
        member.
        member.
        (Output_section::Output_section): Initialize new member.
        (Output_section::Output_section): Initialize new member.
        (Output_section::add_input_section): Add new parameter.
        (Output_section::add_input_section): Add new parameter.
        Keep input sections when --section-ordering-file is used.
        Keep input sections when --section-ordering-file is used.
        (Output_section::set_final_data_size): Sort input sections when
        (Output_section::set_final_data_size): Sort input sections when
        section ordering file is specified.
        section ordering file is specified.
        (Output_section::Input_section_sort_entry): Add new parameter.
        (Output_section::Input_section_sort_entry): Add new parameter.
        Check sorting type.
        Check sorting type.
        (Output_section::Input_section_sort_entry::compare_section_ordering):
        (Output_section::Input_section_sort_entry::compare_section_ordering):
        New method.
        New method.
        (Output_section::Input_section_sort_compare::operator()): Change to
        (Output_section::Input_section_sort_compare::operator()): Change to
        consider section_order_index.
        consider section_order_index.
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        Change to consider section_order_index.
        Change to consider section_order_index.
        (Output_section::Input_section_sort_section_order_index_compare
        (Output_section::Input_section_sort_section_order_index_compare
        ::operator()): New method.
        ::operator()): New method.
        (Output_section::sort_attached_input_sections): Change to sort
        (Output_section::sort_attached_input_sections): Change to sort
        according to section order when specified.
        according to section order when specified.
        (Output_section::add_input_section<32, true>): Add new parameter.
        (Output_section::add_input_section<32, true>): Add new parameter.
        (Output_section::add_input_section<64, true>): Add new parameter.
        (Output_section::add_input_section<64, true>): Add new parameter.
        (Output_section::add_input_section<32, false>): Add new parameter.
        (Output_section::add_input_section<32, false>): Add new parameter.
        (Output_section::add_input_section<64, false>): Add new parameter.
        (Output_section::add_input_section<64, false>): Add new parameter.
        * output.h (Output_section::add_input_section): Add new parameter.
        * output.h (Output_section::add_input_section): Add new parameter.
        (Output_section::input_section_order_specified): New
        (Output_section::input_section_order_specified): New
        method.
        method.
        (Output_section::set_input_section_order_specified): New method.
        (Output_section::set_input_section_order_specified): New method.
        (Input_section::Input_section): Initialize section_order_index_.
        (Input_section::Input_section): Initialize section_order_index_.
        (Input_section::section_order_index): New method.
        (Input_section::section_order_index): New method.
        (Input_section::set_section_order_index): New method.
        (Input_section::set_section_order_index): New method.
        (Input_section::section_order_index_): New member.
        (Input_section::section_order_index_): New member.
        (Input_section::Input_section_sort_section_order_index_compare): New
        (Input_section::Input_section_sort_section_order_index_compare): New
        struct.
        struct.
        (Output_section::input_section_order_specified_): New member.
        (Output_section::input_section_order_specified_): New member.
        * script-sections.cc (is_wildcard_string): Delete and move modified
        * script-sections.cc (is_wildcard_string): Delete and move modified
        method to gold.h.
        method to gold.h.
        (Output_section_element_input::Output_section_element_input): Modify
        (Output_section_element_input::Output_section_element_input): Modify
        call to is_wildcard_string.
        call to is_wildcard_string.
        (Output_section_element_input::Input_section_pattern
        (Output_section_element_input::Input_section_pattern
        ::Input_section_pattern): Ditto.
        ::Input_section_pattern): Ditto.
        (Output_section_element_input::Output_section_element_input): Ditto.
        (Output_section_element_input::Output_section_element_input): Ditto.
        * testsuite/Makefile.am (final_layout): New test case.
        * testsuite/Makefile.am (final_layout): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/final_layout.cc: New file.
        * testsuite/final_layout.cc: New file.
        * testsuite/final_layout.sh: New file.
        * testsuite/final_layout.sh: New file.
2010-06-01  Rafael Espindola  
2010-06-01  Rafael Espindola  
        * plugin.cc (Plugin::load): Pass the output name to the plugin.
        * plugin.cc (Plugin::load): Pass the output name to the plugin.
2010-06-01  Rafael Espindola  
2010-06-01  Rafael Espindola  
        * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
        * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
        visibility of symbols.
        visibility of symbols.
2010-05-27  Doug Kwan  
2010-05-27  Doug Kwan  
        * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
        * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
        from start of output section instead of address for a local symbol
        from start of output section instead of address for a local symbol
        in a merged or relaxed section when doing a relocatable link.
        in a merged or relaxed section when doing a relocatable link.
2010-05-26  Rafael Espindola  
2010-05-26  Rafael Espindola  
       PR 11604
       PR 11604
        * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
        * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
        adding sections the garbage collector removed.
        adding sections the garbage collector removed.
        * gold/testsuite/Makefile.am: Add test.
        * gold/testsuite/Makefile.am: Add test.
        * gold/testsuite/Makefile.in: Regenerate.
        * gold/testsuite/Makefile.in: Regenerate.
        * gold/testsuite/plugin_test_7.sh: New.
        * gold/testsuite/plugin_test_7.sh: New.
        * gold/testsuite/plugin_test_7_1.c: New.
        * gold/testsuite/plugin_test_7_1.c: New.
        * gold/testsuite/plugin_test_7_2.c: New.
        * gold/testsuite/plugin_test_7_2.c: New.
2010-05-26  Rafael Espindola  
2010-05-26  Rafael Espindola  
        * script-sections.cc (Output_section_definition::set_section_addresses):
        * script-sections.cc (Output_section_definition::set_section_addresses):
        Check for --section-start.
        Check for --section-start.
2010-05-26  Doug Kwan  
2010-05-26  Doug Kwan  
        * arm.cc (Arm_scan_relocatable_relocs): New class.
        * arm.cc (Arm_scan_relocatable_relocs): New class.
        (Target_arm::relocate_special_relocatable): New method.
        (Target_arm::relocate_special_relocatable): New method.
        (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
        (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
        (Arm_relocate_functions::thumb_branch_common): Same.
        (Arm_relocate_functions::thumb_branch_common): Same.
        (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
        (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
        instead of Default_scan_relocatable_relocs.
        instead of Default_scan_relocatable_relocs.
        * target-reloc.h (relocate_for_relocatable): Let target handle
        * target-reloc.h (relocate_for_relocatable): Let target handle
        relocation strategy Relocatable_relocs::RELOC_SPECIAL.
        relocation strategy Relocatable_relocs::RELOC_SPECIAL.
        * target.h (Sized_target::relocate_special_relocatable): New method.
        * target.h (Sized_target::relocate_special_relocatable): New method.
2010-05-25  Viktor Kutuzov  
2010-05-25  Viktor Kutuzov  
        * timer.cc: Only #include  if HAVE_TIMES is defined.
        * timer.cc: Only #include  if HAVE_TIMES is defined.
2010-05-23  Doug Kwan  
2010-05-23  Doug Kwan  
        * arm.cc (Arm_input_section::do_output_offset): Use convert_types
        * arm.cc (Arm_input_section::do_output_offset): Use convert_types
        instead of a cast.
        instead of a cast.
        (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
        (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
        with a direct branch, not a conditional branch, to a stub.
        with a direct branch, not a conditional branch, to a stub.
        * merge.cc (Output_merge_base::record_input_section): New method
        * merge.cc (Output_merge_base::record_input_section): New method
        defintion.
        defintion.
        (Output_merge_data::do_add_input_section): Record input section if
        (Output_merge_data::do_add_input_section): Record input section if
        keeps-input-sections flag is set.
        keeps-input-sections flag is set.
        (Output_merge_string::do_add_input_section): Ditto.
        (Output_merge_string::do_add_input_section): Ditto.
        * merge.h (Output_merge_base::Output_merge_base): Initialize new data
        * merge.h (Output_merge_base::Output_merge_base): Initialize new data
        members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
        members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
        INPUT_SECTIONS_.
        INPUT_SECTIONS_.
        (Output_merge_base::keeps_input_sections,
        (Output_merge_base::keeps_input_sections,
        Output_merge_base::set_keeps_input_sections,
        Output_merge_base::set_keeps_input_sections,
        Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
        Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
        method definitions.
        method definitions.
        (Output_merge_base::Input_sections): New type declaration.
        (Output_merge_base::Input_sections): New type declaration.
        (Output_merge_base::input_sections_begin,
        (Output_merge_base::input_sections_begin,
        Output_merge_base::input_sections_end,
        Output_merge_base::input_sections_end,
        Output_merge_base::do_set_keeps_input_sections): New method definitions.
        Output_merge_base::do_set_keeps_input_sections): New method definitions.
        (Output_merge_base::bool keeps_input_sections_,
        (Output_merge_base::bool keeps_input_sections_,
        Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
        Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
        Output_merge_base::input_sections_): New data members.
        Output_merge_base::input_sections_): New data members.
        (Output_merge_data::do_set_keeps_input_sections): New method
        (Output_merge_data::do_set_keeps_input_sections): New method
        defintion.
        defintion.
        (Output_merge_string::do_set_keeps_input_sections): Ditto.
        (Output_merge_string::do_set_keeps_input_sections): Ditto.
        * output.cc (Output_section::Input_section::relobj): Move method
        * output.cc (Output_section::Input_section::relobj): Move method
        defintion from class declaration to here and handle merge sections.
        defintion from class declaration to here and handle merge sections.
        (Output_section::Input_section::shndx): Ditto.
        (Output_section::Input_section::shndx): Ditto.
        (Output_section::Output_section): Remove initializations of removed
        (Output_section::Output_section): Remove initializations of removed
        data members and initialize new data member LOOKUP_MAPS_.
        data members and initialize new data member LOOKUP_MAPS_.
        (Output_section::add_input_section): Set keeps-input-sections flag
        (Output_section::add_input_section): Set keeps-input-sections flag
        for a newly created merge output section as appropriate.  Adjust code
        for a newly created merge output section as appropriate.  Adjust code
        to use Output_section_lookup_maps class.
        to use Output_section_lookup_maps class.
        (Output_section::add_relaxed_input_section): Adjst code for lookup
        (Output_section::add_relaxed_input_section): Adjst code for lookup
        maps code refactoring.
        maps code refactoring.
        (Output_section::add_merge_input_section): Add a new parameter
        (Output_section::add_merge_input_section): Add a new parameter
        KEEPS_INPUT_SECTION.  Adjust code to use Output_section_lookup_maps
        KEEPS_INPUT_SECTION.  Adjust code to use Output_section_lookup_maps
        class.  If adding input section to a newly created merge output
        class.  If adding input section to a newly created merge output
        section fails, remove the new merge section.
        section fails, remove the new merge section.
        (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
        (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
        Adjust code for use of the Output_section_lookup_maps class.
        Adjust code for use of the Output_section_lookup_maps class.
        (Output_section::find_merge_section): Ditto.
        (Output_section::find_merge_section): Ditto.
        (Output_section::build_lookup_maps): New method defintion.
        (Output_section::build_lookup_maps): New method defintion.
        (Output_section::find_relaxed_input_section): Adjust code to use
        (Output_section::find_relaxed_input_section): Adjust code to use
        Output_section_lookup_maps class.
        Output_section_lookup_maps class.
        (Output_section::get_input_sections): Export merge sections.  Adjust
        (Output_section::get_input_sections): Export merge sections.  Adjust
        code to use Output_section_lookup_maps class.
        code to use Output_section_lookup_maps class.
        (Output_section:::add_script_input_section): Adjust code to use
        (Output_section:::add_script_input_section): Adjust code to use
        Output_section_lookup_maps class.  Update lookup maps for merge
        Output_section_lookup_maps class.  Update lookup maps for merge
        sections also.
        sections also.
        (Output_section::discard_states): Use Output_section_lookup_maps.
        (Output_section::discard_states): Use Output_section_lookup_maps.
        (Output_section::restore_states): Same.
        (Output_section::restore_states): Same.
        * output.h (Merge_section_properties): Move class defintion out of
        * output.h (Merge_section_properties): Move class defintion out of
        Output_section.
        Output_section.
        (Output_section_lookup_maps): New class.
        (Output_section_lookup_maps): New class.
        (Output_section::Input_section::is_merge_section): New method
        (Output_section::Input_section::is_merge_section): New method
        defintion.
        defintion.
        (Output_section::Input_section::relobj): Move defintion out of class
        (Output_section::Input_section::relobj): Move defintion out of class
        defintion.  Declare method only.
        defintion.  Declare method only.
        (Output_section::Input_section::shndx): Ditto.
        (Output_section::Input_section::shndx): Ditto.
        (Output_section::Input_section::output_merge_base): New method defintion.
        (Output_section::Input_section::output_merge_base): New method defintion.
        (Output_section::Input_section::u2_.pomb): New union field.
        (Output_section::Input_section::u2_.pomb): New union field.
        (Output_section::Merge_section_by_properties_map,
        (Output_section::Merge_section_by_properties_map,
        Output_section::Output_section_data_by_input_section_map,
        Output_section::Output_section_data_by_input_section_map,
        Output_section::Ouptut_relaxed_input_section_by_input_section_map):
        Output_section::Ouptut_relaxed_input_section_by_input_section_map):
        Remove types.
        Remove types.
        (Output_section::add_merge_input_section): Add new parameter
        (Output_section::add_merge_input_section): Add new parameter
        KEEPS_INPUT_SECTIONS.
        KEEPS_INPUT_SECTIONS.
        (Output_section::build_lookup_maps): New method declaration.
        (Output_section::build_lookup_maps): New method declaration.
        (Output_section::merge_section_map_,
        (Output_section::merge_section_map_,
        Output_section::merge_section_by_properties_map_,
        Output_section::merge_section_by_properties_map_,
        Output_section::relaxed_input_section_map_,
        Output_section::relaxed_input_section_map_,
        Output_section::is_relaxed_input_section_map_valid_): Remove data
        Output_section::is_relaxed_input_section_map_valid_): Remove data
        members.
        members.
        (Output_section::lookup_maps_): New data member.
        (Output_section::lookup_maps_): New data member.
2010-05-21  Doug Kwan  
2010-05-21  Doug Kwan  
        PR gold/11619
        PR gold/11619
        * arm.cc (Arm_input_section::do_output_offset): Add a cast to
        * arm.cc (Arm_input_section::do_output_offset): Add a cast to
        avoid a compilation error.
        avoid a compilation error.
2010-05-19  Rafael Espindola  
2010-05-19  Rafael Espindola  
        * script-sections.cc (Output_section_definition::allocate_to_segment):
        * script-sections.cc (Output_section_definition::allocate_to_segment):
        Update the phdrs_list even when the output section is NULL.
        Update the phdrs_list even when the output section is NULL.
        * testsuite/Makefile.am: Add test.
        * testsuite/Makefile.am: Add test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/script_test_9.cc: New.
        * testsuite/script_test_9.cc: New.
        * testsuite/script_test_9.sh: New.
        * testsuite/script_test_9.sh: New.
        * testsuite/script_test_9.t: New.
        * testsuite/script_test_9.t: New.
2010-05-19  Doug Kwan  
2010-05-19  Doug Kwan  
        * arm.cc (Arm_input_section::original_size): New method.
        * arm.cc (Arm_input_section::original_size): New method.
        (Arm_input_section::do_addralign): Add a cast.
        (Arm_input_section::do_addralign): Add a cast.
        (Arm_input_section::do_output_offset): Remove static cast.
        (Arm_input_section::do_output_offset): Remove static cast.
        (Arm_input_section::original_addralign,
        (Arm_input_section::original_addralign,
         Arm_input_section::original_size_): Change type to uint32_t.
         Arm_input_section::original_size_): Change type to uint32_t.
        (Arm_input_section::init): Add safe casts for section alignment
        (Arm_input_section::init): Add safe casts for section alignment
        and size.
        and size.
        (Arm_input_section::set_final_data_size): Do not set address and
        (Arm_input_section::set_final_data_size): Do not set address and
        offset of stub table.
        offset of stub table.
        (Arm_output_section::fix_exidx_coverage): Change use of of
        (Arm_output_section::fix_exidx_coverage): Change use of of
        Output_section::Simple_input_section to that of
        Output_section::Simple_input_section to that of
        Output_section::Input_section.
        Output_section::Input_section.
        (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
        (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
        except for the first pass.
        except for the first pass.
        * output.cc (Output_section::get_input_sections): Change type of
        * output.cc (Output_section::get_input_sections): Change type of
        input_sections to std::list.
        input_sections to std::list.
        (Output_section::add_script_input_section): Rename from
        (Output_section::add_script_input_section): Rename from
        Output_section::add_simple_input_section.  Change type of SIS
        Output_section::add_simple_input_section.  Change type of SIS
        parameter from Simple_input_section to Input_section.
        parameter from Simple_input_section to Input_section.
        * output.h (Output_section::Simple_input_section): Remove class.
        * output.h (Output_section::Simple_input_section): Remove class.
        (Output_section::Input_section): Change class visibility to public.
        (Output_section::Input_section): Change class visibility to public.
        (Output_section::Input_section::addralign): Use stored alignments
        (Output_section::Input_section::addralign): Use stored alignments
        for special input sections if set.
        for special input sections if set.
        (Output_section::Input_section::set_addralign): New method.
        (Output_section::Input_section::set_addralign): New method.
        (Output_section::get_input_sections): Change parameter type from
        (Output_section::get_input_sections): Change parameter type from
        list of Simple_input_section to list of Input_section.
        list of Simple_input_section to list of Input_section.
        (Output_section::add_script_input_section): Rename from
        (Output_section::add_script_input_section): Rename from
        Output_section::add_simple_input_section. Change first parameter's
        Output_section::add_simple_input_section. Change first parameter's
        type from Simple_input_section to Input_section and remove the
        type from Simple_input_section to Input_section and remove the
        second and third parameters.
        second and third parameters.
        * script-sections.cc (Input_section::Input_section_list): Change
        * script-sections.cc (Input_section::Input_section_list): Change
        type to list of Output_section::Input_section/
        type to list of Output_section::Input_section/
        (Input_section_info::Input_section_info): Change parameter type of
        (Input_section_info::Input_section_info): Change parameter type of
        INPUT_SECTION to Output_section::Input_section.
        INPUT_SECTION to Output_section::Input_section.
        (Input_section_info::input_section): Change return type.
        (Input_section_info::input_section): Change return type.
        (Input_section_info::input_section_): Change type to
        (Input_section_info::input_section_): Change type to
        Output_section::Input_section.
        Output_section::Input_section.
        (Output_section_element_input::set_section_addresses): Adjust code
        (Output_section_element_input::set_section_addresses): Adjust code
        to use Output_section::Input_section instead of
        to use Output_section::Input_section instead of
        Output_section::Simple_input_section.  Adjust code for renaming
        Output_section::Simple_input_section.  Adjust code for renaming
        of Output_section::add_simple_input_section.
        of Output_section::add_simple_input_section.
        (Orphan_output_section::set_section_addresses): Ditto.
        (Orphan_output_section::set_section_addresses): Ditto.
2010-05-18  Ralf Wildenhues  
2010-05-18  Ralf Wildenhues  
        * gold.h (Unordered_multimap, Unordered_map): Fix defines for
        * gold.h (Unordered_multimap, Unordered_map): Fix defines for
        when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
        when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2010-05-18  Rafael Espindola  
2010-05-18  Rafael Espindola  
        * options.cc (General_options::finalize): Handle -nostdlib.
        * options.cc (General_options::finalize): Handle -nostdlib.
        * options.h (nostdlib): New option.
        * options.h (nostdlib): New option.
        * script.cc (script_add_search_dir): Handle -nostdlib.
        * script.cc (script_add_search_dir): Handle -nostdlib.
2010-05-12  Doug Kwan  
2010-05-12  Doug Kwan  
        * arm.cc (Target_arm::do_finalize_sections): Create an empty
        * arm.cc (Target_arm::do_finalize_sections): Create an empty
        attributes section only if there no attributes section after merging.
        attributes section only if there no attributes section after merging.
        (Target_arm::merge_object_attributes): Move value of
        (Target_arm::merge_object_attributes): Move value of
        Tag_MPextension_use_legacy to that of Tag_MPextension_use.
        Tag_MPextension_use_legacy to that of Tag_MPextension_use.
        Handle Tag_DIV_use and Tag_MPextension_use_legacy.
        Handle Tag_DIV_use and Tag_MPextension_use_legacy.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
        (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
        (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
        and arm_attr_merge_7.stdout.
        and arm_attr_merge_7.stdout.
        (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
        (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
        arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
        arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
        arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
        arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
        arm_attr_merge_7b.o): New rules.
        arm_attr_merge_7b.o): New rules.
        (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
        (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
        arm_attr_merge_7
        arm_attr_merge_7
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_attr_merge.sh: New file.
        * testsuite/arm_attr_merge.sh: New file.
        * testsuite/arm_attr_merge_[67][ab].s: Same.
        * testsuite/arm_attr_merge_[67][ab].s: Same.
2010-05-05  Nick Clifton  
2010-05-05  Nick Clifton  
        * po/es.po: Updated Spanish translation.
        * po/es.po: Updated Spanish translation.
2010-04-27  H.J. Lu  
2010-04-27  H.J. Lu  
        * Makefile.am (install-exec-local): Properly install gold as
        * Makefile.am (install-exec-local): Properly install gold as
        default cross linker.
        default cross linker.
        * Makefile.in: Regenerated.
        * Makefile.in: Regenerated.
2010-04-27  H.J. Lu  
2010-04-27  H.J. Lu  
            Nick Clifton  
            Nick Clifton  
        * configure.ac (install_as_default): Define and set to false
        * configure.ac (install_as_default): Define and set to false
        unless --enable-gold or --enable-gold=both/gold has been
        unless --enable-gold or --enable-gold=both/gold has been
        specified.
        specified.
        * configure: Regenerate.
        * configure: Regenerate.
        * Makefile.am (install-exec-local): Install the executable as
        * Makefile.am (install-exec-local): Install the executable as
        'ld.gold'.  If install_as_default is true then also install it as
        'ld.gold'.  If install_as_default is true then also install it as
        'ld'.
        'ld'.
        * Makefile.in: Regenerated.
        * Makefile.in: Regenerated.
2010-04-24  Ian Lance Taylor  
2010-04-24  Ian Lance Taylor  
        * layout.cc (Layout::layout_reloc): In relocatable link don't
        * layout.cc (Layout::layout_reloc): In relocatable link don't
        combine reloc sections for grouped sections.
        combine reloc sections for grouped sections.
2010-04-23  Sriraman Tallam  
2010-04-23  Sriraman Tallam  
        * gc.h (gc_process_relocs): Pass information on relocs pointing to
        * gc.h (gc_process_relocs): Pass information on relocs pointing to
        sections that are not ordinary to icf.
        sections that are not ordinary to icf.
        * icf.cc (get_section_contents): Handle relocation pointing to section
        * icf.cc (get_section_contents): Handle relocation pointing to section
        with no object or shndx information.
        with no object or shndx information.
        * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
        * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
        * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
        * testsuite/icf_virtual_function_folding_test.sh: Delete file.
        * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2010-04-22  Ian Lance Taylor  
2010-04-22  Ian Lance Taylor  
        * expression.cc (Expression::Expression_eval_info): Add
        * expression.cc (Expression::Expression_eval_info): Add
        result_alignment_pointer field.
        result_alignment_pointer field.
        (Expression::eval_with_dot): Add result_alignment_pointer
        (Expression::eval_with_dot): Add result_alignment_pointer
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Expression::eval_maybe_dot): Likewise.
        (Expression::eval_maybe_dot): Likewise.
        (class Binary_expression): Add alignment_pointer parameter to
        (class Binary_expression): Add alignment_pointer parameter to
        left_value and right_value.  Change all callers.
        left_value and right_value.  Change all callers.
        (BINARY_EXPRESSION): Set result alignment.
        (BINARY_EXPRESSION): Set result alignment.
        (class Trinary_expression): Add alignment_pointer parameter to
        (class Trinary_expression): Add alignment_pointer parameter to
        arg2_value and arg3_value.  Change all callers.
        arg2_value and arg3_value.  Change all callers.
        (Trinary_cond::value): Set result alignment.
        (Trinary_cond::value): Set result alignment.
        (Max_expression::value, Min_expression::value): Likewise.
        (Max_expression::value, Min_expression::value): Likewise.
        (Align_expression::value): Likewise.
        (Align_expression::value): Likewise.
        * script-sections.cc (class Sections_element): Add dot_alignment
        * script-sections.cc (class Sections_element): Add dot_alignment
        parameter to set_section_addresses virtual function.  Update
        parameter to set_section_addresses virtual function.  Update
        instantiations.
        instantiations.
        (class Output_section_element): Likewise.
        (class Output_section_element): Likewise.
        (Script_sections::create_segments): Add dot_alignment parameter.
        (Script_sections::create_segments): Add dot_alignment parameter.
        Change all callers.
        Change all callers.
        (Script_sections::create_segments_from_phdrs_clause): Likewise.
        (Script_sections::create_segments_from_phdrs_clause): Likewise.
        (Script_sections::set_phdrs_clause_addresses): Likewise.
        (Script_sections::set_phdrs_clause_addresses): Likewise.
        * script-sections.h: Update declarations.
        * script-sections.h: Update declarations.
        * script.h: Update declarations.
        * script.h: Update declarations.
        * output.h (Output_segment::set_minimum_p_align): Don't decrease
        * output.h (Output_segment::set_minimum_p_align): Don't decrease
        min_p_align.
        min_p_align.
        * testsuite/script_test_3.t: Set large alignment.
        * testsuite/script_test_3.t: Set large alignment.
        * testsuite/script_test_3.sh: Make sure that at least one LOAD
        * testsuite/script_test_3.sh: Make sure that at least one LOAD
        segment has expected alignment.
        segment has expected alignment.
2010-04-22  Nick Clifton  
2010-04-22  Nick Clifton  
        * po/gold.pot: Updated by the Translation project.
        * po/gold.pot: Updated by the Translation project.
        * po/vi.po: Updated Vietnamese translation.
        * po/vi.po: Updated Vietnamese translation.
2010-04-22  H.J. Lu  
2010-04-22  H.J. Lu  
        * testsuite/Makefile.am (check_PROGRAMS): Add
        * testsuite/Makefile.am (check_PROGRAMS): Add
        icf_virtual_function_folding_test.
        icf_virtual_function_folding_test.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
2010-04-15  Andrew Haley  
2010-04-15  Andrew Haley  
        * options.h (merge_exidx_entries): New option.
        * options.h (merge_exidx_entries): New option.
        * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
        * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
        (class Arm_exidx_fixup::merge_exidx_entries_): New member.
        (class Arm_exidx_fixup::merge_exidx_entries_): New member.
        (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
        (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
        (Target_arm::merge_exidx_entries): New function.
        (Target_arm::merge_exidx_entries): New function.
        (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
        (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
        (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
        (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
        to Arm_exidx_fixup constructor.
        to Arm_exidx_fixup constructor.
        Add new arg, merge_exidx_entries.
        Add new arg, merge_exidx_entries.
        (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
        (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
        Arm_output_section::fix_exidx_coverage.
        Arm_output_section::fix_exidx_coverage.
2010-04-18  Sriraman Tallam  
2010-04-18  Sriraman Tallam  
        * icf.cc (get_section_contents): Check for preemptible functions.
        * icf.cc (get_section_contents): Check for preemptible functions.
        Ignore addend when appropriate.
        Ignore addend when appropriate.
        * symtab.cc (should_add_dynsym_entry): Add new parameter.  Check for
        * symtab.cc (should_add_dynsym_entry): Add new parameter.  Check for
        section folded.
        section folded.
        (add_from_relobj): Check for section folded.
        (add_from_relobj): Check for section folded.
        (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
        (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
        * symtab.h (should_add_dynsym_entry): Add new parameter.
        * symtab.h (should_add_dynsym_entry): Add new parameter.
        * target-reloc.h (scan_relocs): Check for section folded.
        * target-reloc.h (scan_relocs): Check for section folded.
        * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
        * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
        Check reloc types for function pointers in shared objects.
        Check reloc types for function pointers in shared objects.
        * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
        * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
        case.
        case.
        (icf_preemptible_functions_test): New test case.
        (icf_preemptible_functions_test): New test case.
        (icf_string_merge_test): New test case.
        (icf_string_merge_test): New test case.
        * testsuite.Makefile.in: Regenerate.
        * testsuite.Makefile.in: Regenerate.
        * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
        * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
        bar_glob.  Refactor code.
        bar_glob.  Refactor code.
        * testsuite/icf_preemptible_functions_test.cc: New file.
        * testsuite/icf_preemptible_functions_test.cc: New file.
        * testsuite/icf_preemptible_functions_test.sh: New file.
        * testsuite/icf_preemptible_functions_test.sh: New file.
        * testsuite/icf_string_merge_test.cc: New file.
        * testsuite/icf_string_merge_test.cc: New file.
        * testsuite/icf_string_merge_test.sh: New file.
        * testsuite/icf_string_merge_test.sh: New file.
        * testsuite/icf_virtual_function_folding_test.cc: New file.
        * testsuite/icf_virtual_function_folding_test.cc: New file.
        * testsuite/icf_virtual_function_folding_test.sh: New file.
        * testsuite/icf_virtual_function_folding_test.sh: New file.
2010-04-14  Doug Kwan  
2010-04-14  Doug Kwan  
        * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
        * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
        for local symbol recounting if we remove a section due to ICF.
        for local symbol recounting if we remove a section due to ICF.
        * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
        * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
        there are no regular objects in input.
        there are no regular objects in input.
2010-04-13  Doug Kwan  
2010-04-13  Doug Kwan  
        * arm.cc (Arm_input_section::set_final_data_size): Compute
        * arm.cc (Arm_input_section::set_final_data_size): Compute
        accurate final data size instead of using current data size.
        accurate final data size instead of using current data size.
2010-04-09  Doug Kwan  
2010-04-09  Doug Kwan  
        * layout.cc (Layout::choose_output_section): Handle script section
        * layout.cc (Layout::choose_output_section): Handle script section
        types.
        types.
        (Layout::make_output_section_for_script): Add section type parameter.
        (Layout::make_output_section_for_script): Add section type parameter.
        Handle script section types.
        Handle script section types.
        * layout.h (Layout::make_output_section_for_script): Add section
        * layout.h (Layout::make_output_section_for_script): Add section
        type parameter.
        type parameter.
        * output.cc (Output_section::Output_section): Initialize data member
        * output.cc (Output_section::Output_section): Initialize data member
        is_noload_.
        is_noload_.
        (Output_section::do_reset_address_and_file_offset): Do not set address
        (Output_section::do_reset_address_and_file_offset): Do not set address
        to 0 if section is a NOLOAD section.
        to 0 if section is a NOLOAD section.
        * output.h (Output_section::is_noload): New method.
        * output.h (Output_section::is_noload): New method.
        (Output_section::set_is_noload): Ditto.
        (Output_section::set_is_noload): Ditto.
        (Output_section::is_noload_): New data member.
        (Output_section::is_noload_): New data member.
        * script-c.h (Script_section_type): New enum type.
        * script-c.h (Script_section_type): New enum type.
        (struct Parser_output_section_header): Add new file section_type.
        (struct Parser_output_section_header): Add new file section_type.
        * script-sections.cc (Sections_element::output_section_name): Add
        * script-sections.cc (Sections_element::output_section_name): Add
        parameter for returning script section type.
        parameter for returning script section type.
        (Output_section_definition::output_section_name): Ditto.
        (Output_section_definition::output_section_name): Ditto.
        (Output_section_definition::section_type)P; New method.
        (Output_section_definition::section_type)P; New method.
        (Output_section_definiton::script_section_type_name): Ditto.
        (Output_section_definiton::script_section_type_name): Ditto.
        (Output_section_definition::script_section_type_): New data member.
        (Output_section_definition::script_section_type_): New data member.
        (Output_section_definition::Output_section_definition): Initialize
        (Output_section_definition::Output_section_definition): Initialize
        data member Output_section_definition::script_section_type_.
        data member Output_section_definition::script_section_type_.
        (Output_section_definition::create_sections): Pass script section type
        (Output_section_definition::create_sections): Pass script section type
        to Layout::make_output_section_for_script.
        to Layout::make_output_section_for_script.
        (Output_section_definition::output_section_name): Return script
        (Output_section_definition::output_section_name): Return script
        section type to caller.
        section type to caller.
        (Output_section_definition::set_section_address): Do not advance
        (Output_section_definition::set_section_address): Do not advance
        dot value and load address if section type is NOLOAD.  Set address
        dot value and load address if section type is NOLOAD.  Set address
        of NOLOAD sections regardless of section flags.
        of NOLOAD sections regardless of section flags.
        (Output_section_definition::print): Print section type if it is
        (Output_section_definition::print): Print section type if it is
        not SCRIPT_SECTION_TYPE_NONE.
        not SCRIPT_SECTION_TYPE_NONE.
        (Output_section_definition::section_type): New method.
        (Output_section_definition::section_type): New method.
        (Output_section_definition::script_section_type_name): Ditto.
        (Output_section_definition::script_section_type_name): Ditto.
        (Script_sections::output_section_name): Add new parameter
        (Script_sections::output_section_name): Add new parameter
        PSECTION_TYPE for returning script section type.  Pass it to
        PSECTION_TYPE for returning script section type.  Pass it to
        section elements.  Handle discard sections.
        section elements.  Handle discard sections.
        (Sort_output_sections::operator()): Handle NOLOAD sections.
        (Sort_output_sections::operator()): Handle NOLOAD sections.
        * script-sections.h (Script_sections::Section_type): New enum type.
        * script-sections.h (Script_sections::Section_type): New enum type.
        (Script_sections::output_section_name): Add a new parameter for
        (Script_sections::output_section_name): Add a new parameter for
        returning script section type.
        returning script section type.
        * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
        * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
        INFO and NOLOAD.
        INFO and NOLOAD.
        * yyscript.y (union): Add new field SECTION_TYPE.
        * yyscript.y (union): Add new field SECTION_TYPE.
        (COPY, DSECT, INFO, NOLOAD): New tokens.
        (COPY, DSECT, INFO, NOLOAD): New tokens.
        (opt_address_and_section_type): Change type to output_section_header.
        (opt_address_and_section_type): Change type to output_section_header.
        (section_type): New non-terminal
        (section_type): New non-terminal
        (section_header): Handle section type.
        (section_header): Handle section type.
        (opt_address_and_section_type): Return section type value.
        (opt_address_and_section_type): Return section type value.
2010-04-09  H.J. Lu  
2010-04-09  H.J. Lu  
        * testsuite/plugin_common_test_1.c (foo): Add prototype.
        * testsuite/plugin_common_test_1.c (foo): Add prototype.
        * testsuite/plugin_common_test_2.c (foo): Likewise.
        * testsuite/plugin_common_test_2.c (foo): Likewise.
2010-04-08  Doug Kwan  
2010-04-08  Doug Kwan  
        * merge.cc (Output_merge_data::set_final_data_size): Handle empty
        * merge.cc (Output_merge_data::set_final_data_size): Handle empty
        Output_merge_data.
        Output_merge_data.
        * output.cc (Output_section::add_merge_input_section): Simplify
        * output.cc (Output_section::add_merge_input_section): Simplify
        code and return status of Output_merge_base::add_input_section.
        code and return status of Output_merge_base::add_input_section.
        Update merge section map only if Output_merge_base::add_input_section
        Update merge section map only if Output_merge_base::add_input_section
        returns true.
        returns true.
2010-04-07  Doug Kwan  
2010-04-07  Doug Kwan  
        * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
        * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
        if section is marked as containing instructions but has no mapping
        if section is marked as containing instructions but has no mapping
        symbols.
        symbols.
        (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
        (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
        correct section index.
        correct section index.
        (Arm_relobj::find_linked_text_section): Ditto.
        (Arm_relobj::find_linked_text_section): Ditto.
2010-04-07  Cary Coutant  
2010-04-07  Cary Coutant  
        * archive.cc (include_member): Destroy Read_symbols_data object before
        * archive.cc (include_member): Destroy Read_symbols_data object before
        releasing file.
        releasing file.
        * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
        * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
        * object.h (Read_symbols_data::Read_symbols_data) New constructor.
        * object.h (Read_symbols_data::Read_symbols_data) New constructor.
        (Read_symbols_data::~Read_symbols_data) New destructor.
        (Read_symbols_data::~Read_symbols_data) New destructor.
        (Section_relocs::Section_relocs) New constructor.
        (Section_relocs::Section_relocs) New constructor.
        (Section_relocs::~Section_relocs) New destructor.
        (Section_relocs::~Section_relocs) New destructor.
        (Read_relocs_data::Read_relocs_data) New constructor.
        (Read_relocs_data::Read_relocs_data) New constructor.
        (Read_relocs_data::~Read_relocs_data) New destructor.
        (Read_relocs_data::~Read_relocs_data) New destructor.
        * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
        * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
        pointers to NULL after deleting.
        pointers to NULL after deleting.
2010-04-07  Doug Kwan  
2010-04-07  Doug Kwan  
        * arm.cc: Replace "endianity" with "endianness" in comments.
        * arm.cc: Replace "endianity" with "endianness" in comments.
        (Arm_exidx_cantunwind): Ditto.
        (Arm_exidx_cantunwind): Ditto.
        (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
        (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
        (Arm_relobj::merge_flags_and_attributes): New method.
        (Arm_relobj::merge_flags_and_attributes): New method.
        (Arm_relobj::merge_flags_and_attributes_): New data member.
        (Arm_relobj::merge_flags_and_attributes_): New data member.
        (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
        (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
        (Arm_relobj::scan_sections_for_stubs): Ditto.
        (Arm_relobj::scan_sections_for_stubs): Ditto.
        (Arm_relobj::do_read_symbols): Check to see if we really want to
        (Arm_relobj::do_read_symbols): Check to see if we really want to
        merge processor-specific flags and attributes.  Exit early if
        merge processor-specific flags and attributes.  Exit early if
        an object is empty except for section names and the undefined symbol.
        an object is empty except for section names and the undefined symbol.
        (Target_arm::do_finalize_sections): Move check for ELF format to
        (Target_arm::do_finalize_sections): Move check for ELF format to
        Arm_relobj::do_read_symbols.  Merge processor specific flags and
        Arm_relobj::do_read_symbols.  Merge processor specific flags and
        attributes from a regular object only when we have determined that
        attributes from a regular object only when we have determined that
        it is aapropriate.  Do not create an .ARM.attributes section in
        it is aapropriate.  Do not create an .ARM.attributes section in
        output if there is no regular input object.
        output if there is no regular input object.
        (Target_arm::merge_processor_specific_flags): Check
        (Target_arm::merge_processor_specific_flags): Check
        --warn-mismatch before printing any error.
        --warn-mismatch before printing any error.
        (Target_arm::merge_object_attributes): Ditto.
        (Target_arm::merge_object_attributes): Ditto.
        * gold.cc (queue_middle_tasks): Handle the case in which there is
        * gold.cc (queue_middle_tasks): Handle the case in which there is
        no regular object in input.
        no regular object in input.
        * options.cc (General_options::parse_EB): New method.
        * options.cc (General_options::parse_EB): New method.
        (General_options::parse_EL): Same.
        (General_options::parse_EL): Same.
        (General_options::General_options): Initialize endianness_.
        (General_options::General_options): Initialize endianness_.
        * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
        * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
        New options.
        New options.
        (General_options::Endianness): New enum.
        (General_options::Endianness): New enum.
        (General_options::endianness): New method.
        (General_options::endianness): New method.
        (General_options::endianness_): New data member.
        (General_options::endianness_): New data member.
        * parameters.cc (Parameters::set_options): Check target endianness.
        * parameters.cc (Parameters::set_options): Check target endianness.
        (Parameters::set_target_once): Ditto.
        (Parameters::set_target_once): Ditto.
        (Parameters::check_target_endianness): New method.
        (Parameters::check_target_endianness): New method.
        (parameters_force_valid_target): If either -EL or -EB is specified,
        (parameters_force_valid_target): If either -EL or -EB is specified,
        use it to define endianness of default target.
        use it to define endianness of default target.
        * parameters.h (Parameters::check_target_endianness): New method
        * parameters.h (Parameters::check_target_endianness): New method
        declaration.
        declaration.
        * target.h (class Target): Change "endianity" to "endianness"
        * target.h (class Target): Change "endianity" to "endianness"
        in comments.
        in comments.
2010-04-07  Ralf Wildenhues  
2010-04-07  Ralf Wildenhues  
        * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
        * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
        * configure: Regenerate.
        * configure: Regenerate.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-04-06  Cary Coutant  
2010-04-06  Cary Coutant  
        gcc PR lto/42757
        gcc PR lto/42757
        * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
        * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
        prevailing definitions of common symbols.
        prevailing definitions of common symbols.
        * testsuite/plugin_test_6.sh: New test case.
        * testsuite/plugin_test_6.sh: New test case.
        * testsuite/plugin_common_test_1.c: New test case.
        * testsuite/plugin_common_test_1.c: New test case.
        * testsuite/plugin_common_test_2.c: New test case.
        * testsuite/plugin_common_test_2.c: New test case.
        * testsuite/Makefile.am (plugin_test_6): New test case.
        * testsuite/Makefile.am (plugin_test_6): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2010-04-06  Nick Clifton  
2010-04-06  Nick Clifton  
        * po/vi.po: New Vietnamese translation.
        * po/vi.po: New Vietnamese translation.
2010-03-30  Doug Kwan  
2010-03-30  Doug Kwan  
        * arm.cc (Target_arm::using_thumb_only): Handle v6-M
        * arm.cc (Target_arm::using_thumb_only): Handle v6-M
2010-03-25  Doug Kwan  
2010-03-25  Doug Kwan  
        * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
        * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
        to avoid a conversion warning on a 32-bit host.
        to avoid a conversion warning on a 32-bit host.
2010-03-24  Ian Lance Taylor  
2010-03-24  Ian Lance Taylor  
        * testsuite/script_test_3.t: Add a TLS segment.
        * testsuite/script_test_3.t: Add a TLS segment.
        * testsuite/Makefile.am (check_PROGRAMS): Add
        * testsuite/Makefile.am (check_PROGRAMS): Add
        tls_phdrs_script_test.
        tls_phdrs_script_test.
        (tls_phdrs_script_test_SOURCES): Define.
        (tls_phdrs_script_test_SOURCES): Define.
        (tls_phdrs_script_test_DEPENDENCIES): Define.
        (tls_phdrs_script_test_DEPENDENCIES): Define.
        (tls_phdrs_script_test_LDFLAGS): Define.
        (tls_phdrs_script_test_LDFLAGS): Define.
        (tls_phdrs_script_test_LDADD): Define.
        (tls_phdrs_script_test_LDADD): Define.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2010-03-23  Cary Coutant  
2010-03-23  Cary Coutant  
        * fileread.cc (find_or_make_view): Fix comment.
        * fileread.cc (find_or_make_view): Fix comment.
2010-03-23  Ian Lance Taylor  
2010-03-23  Ian Lance Taylor  
        * script-sections.cc (class Orphan_section_placement): Define
        * script-sections.cc (class Orphan_section_placement): Define
        PLACE_TLS and PLACE_TLS_BSS.
        PLACE_TLS and PLACE_TLS_BSS.
        (Orphan_section_placement::Orphan_section_placement): Initialize
        (Orphan_section_placement::Orphan_section_placement): Initialize
        new places.
        new places.
        (Orphan_section_placement::find_place): Handle SHF_TLS sections.
        (Orphan_section_placement::find_place): Handle SHF_TLS sections.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
        (tls_script_test_SOURCES): Define.
        (tls_script_test_SOURCES): Define.
        (tls_script_test_DEPENDENCIES): Define.
        (tls_script_test_DEPENDENCIES): Define.
        (tls_script_test_LDFLAGS): Define.
        (tls_script_test_LDFLAGS): Define.
        (tls_script_test_LDADD): Define.
        (tls_script_test_LDADD): Define.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2010-03-22  Doug Kwan  
2010-03-22  Doug Kwan  
        * arm.cc (Arm_relocate_functions::abs8,
        * arm.cc (Arm_relocate_functions::abs8,
        Arm_relocate_functions::abs16): Use correct check for overflow
        Arm_relocate_functions::abs16): Use correct check for overflow
        specified in the ARM ELF specs.
        specified in the ARM ELF specs.
        (Arm_relocate_functions): thumb_branch_common.  Handle bit 1 of branch
        (Arm_relocate_functions): thumb_branch_common.  Handle bit 1 of branch
        target of a BLX instruction specially.
        target of a BLX instruction specially.
        (Reloc_stub::stub_type_for_reloc): Ditto.
        (Reloc_stub::stub_type_for_reloc): Ditto.
        (Relocate::relocate): Use symbolic names instead of numeric relocation
        (Relocate::relocate): Use symbolic names instead of numeric relocation
        codes to report error.
        codes to report error.
        (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
        (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
        workaround.
        workaround.
        * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
        * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
        thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
        thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
        thumb2_blx_out_of_range.stdout
        thumb2_blx_out_of_range.stdout
        (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
        (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
        thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
        thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
        (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
        (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
        thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
        thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
        thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
        thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
        thumb2_blx_in_range, thumb2_blx_in_range.o,
        thumb2_blx_in_range, thumb2_blx_in_range.o,
        thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
        thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
        thumb2_blx_out_of_range.o): New rules.
        thumb2_blx_out_of_range.o): New rules.
        (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
        (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
        thumb2_blx_in_range and thumb2_blx_out_of_range.
        thumb2_blx_in_range and thumb2_blx_out_of_range.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * arm_branch_in_range.sh: Add tests for THUMB BLX.
        * arm_branch_in_range.sh: Add tests for THUMB BLX.
        * testsuite/thumb_blx_in_range.s: New file.
        * testsuite/thumb_blx_in_range.s: New file.
        * testsuite/thumb_blx_out_of_range.s: New file.
        * testsuite/thumb_blx_out_of_range.s: New file.
2010-03-22  Rafael Espindola  
2010-03-22  Rafael Espindola  
        * archive.cc (Should_include): Move to archive.h.
        * archive.cc (Should_include): Move to archive.h.
        (should_include_member): Make it a member of Archive.
        (should_include_member): Make it a member of Archive.
        (Lib_group): New.
        (Lib_group): New.
        (Add_lib_group_symbols): New.
        (Add_lib_group_symbols): New.
        * archive.h: Include options.h.
        * archive.h: Include options.h.
        (Archive_member): Moved from Archive.
        (Archive_member): Moved from Archive.
        (Should_include): Moved from archive.cc.
        (Should_include): Moved from archive.cc.
        (Lib_group): New.
        (Lib_group): New.
        (Add_lib_group_symbols): New.
        (Add_lib_group_symbols): New.
        * dynobj.cc (do_should_include_member): New.
        * dynobj.cc (do_should_include_member): New.
        * dynobj.h (do_should_include_member): New.
        * dynobj.h (do_should_include_member): New.
        * gold.cc (queue_initial_tasks): Update call to queue.
        * gold.cc (queue_initial_tasks): Update call to queue.
        * main.cc (main): Print lib group stats.
        * main.cc (main): Print lib group stats.
        * object.cc (do_should_include_member): New.
        * object.cc (do_should_include_member): New.
        * object.h: Include archive.h.
        * object.h: Include archive.h.
        (Object::should_include_member): New.
        (Object::should_include_member): New.
        (Object::do_should_include_member): New.
        (Object::do_should_include_member): New.
        (Sized_relobj::do_should_include_member): New.
        (Sized_relobj::do_should_include_member): New.
        * options.cc (General_options::parse_start_lib): New.
        * options.cc (General_options::parse_start_lib): New.
        (General_options::parse_end_lib): New.
        (General_options::parse_end_lib): New.
        (Input_arguments::add_file): Handle lib groups.
        (Input_arguments::add_file): Handle lib groups.
        (Input_arguments::start_group): Check we are not in a lib.
        (Input_arguments::start_group): Check we are not in a lib.
        (Input_arguments::start_lib): New.
        (Input_arguments::start_lib): New.
        (Input_arguments::end_lib): New.
        (Input_arguments::end_lib): New.
        * options.h (General_options): Add start_lib and end_lib.
        * options.h (General_options): Add start_lib and end_lib.
        (Input_argument::lib_): New.
        (Input_argument::lib_): New.
        (Input_argument::lib): New.
        (Input_argument::lib): New.
        (Input_argument::is_lib): New.
        (Input_argument::is_lib): New.
        (Input_file_lib): New.
        (Input_file_lib): New.
        (Input_arguments::in_lib_): New.
        (Input_arguments::in_lib_): New.
        (Input_arguments::in_lib): New.
        (Input_arguments::in_lib): New.
        (Input_arguments::start_lib): New.
        (Input_arguments::start_lib): New.
        (Input_arguments::end_lib_): New.
        (Input_arguments::end_lib_): New.
        * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
        * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
        in unused members as preempted.
        in unused members as preempted.
        (Sized_pluginobj::do_should_include_member): New.
        (Sized_pluginobj::do_should_include_member): New.
        * plugin.h (Sized_pluginobj::do_should_include_member): New.
        * plugin.h (Sized_pluginobj::do_should_include_member): New.
        * readsyms.cc (Read_symbols::locks): If we are just reading a member,
        * readsyms.cc (Read_symbols::locks): If we are just reading a member,
        return the blocker.
        return the blocker.
        (Read_symbols::do_whole_lib_group): New.
        (Read_symbols::do_whole_lib_group): New.
        (Read_symbols::do_lib_group): New.
        (Read_symbols::do_lib_group): New.
        (Read_symbols::do_read_symbols): Handle lib groups.
        (Read_symbols::do_read_symbols): Handle lib groups.
        (Read_symbols::get_name): Handle lib groups.
        (Read_symbols::get_name): Handle lib groups.
        * readsyms.h (Read_symbols): Add an archive member pointer.
        * readsyms.h (Read_symbols): Add an archive member pointer.
        (Read_symbols::do_whole_lib_group): New.
        (Read_symbols::do_whole_lib_group): New.
        (Read_symbols::do_lib_group): New.
        (Read_symbols::do_lib_group): New.
        (Read_symbols::member_): New.
        (Read_symbols::member_): New.
        * script.cc (read_input_script): Update call to queue_soon.
        * script.cc (read_input_script): Update call to queue_soon.
2010-03-19  Doug Kwan  
2010-03-19  Doug Kwan  
        * arm.cc (Stub_table::Stub_table): Initialize new data members
        * arm.cc (Stub_table::Stub_table): Initialize new data members
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
        (Stub_table::add_reloc_stub): Assign stub offset and update
        (Stub_table::add_reloc_stub): Assign stub offset and update
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
        (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
        (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
        New data members.
        New data members.
        (Stub_table::update_data_size_and_addralign): Use
        (Stub_table::update_data_size_and_addralign): Use
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
        Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
        instead of going over all reloc stubs.
        instead of going over all reloc stubs.
        (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
        (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
        * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
        * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
        Stringpool_template::offset_ to size of Stringpool_char.
        Stringpool_template::offset_ to size of Stringpool_char.
        (Stringpool_template::new_key_offset): Remove code to initialize
        (Stringpool_template::new_key_offset): Remove code to initialize
        Stringpool_template::offset_.
        Stringpool_template::offset_.
        * stringpool.h (Stringpool_template::set_no_zero_null): Set
        * stringpool.h (Stringpool_template::set_no_zero_null): Set
        Stringpool_template::offset_ to zero.
        Stringpool_template::offset_ to zero.
2010-03-15  Doug Kwan  
2010-03-15  Doug Kwan  
        * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
        * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
        offset_.
        offset_.
        (Stringpool_template::new_key_offset): New method.
        (Stringpool_template::new_key_offset): New method.
        (Stringpool_template::add_string): Assign offsets when adding new
        (Stringpool_template::add_string): Assign offsets when adding new
        strings.
        strings.
        (Stringpool_template::set_string_offsets): Do not set string offsets
        (Stringpool_template::set_string_offsets): Do not set string offsets
        when not optimizing.
        when not optimizing.
        * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
        * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
        member size_.
        member size_.
        (Chunked_vector::clear): Clear size_.
        (Chunked_vector::clear): Clear size_.
        (Chunked_vector::reserve): Call reserve method of all Element_vectors.
        (Chunked_vector::reserve): Call reserve method of all Element_vectors.
        (Chunked_vector::size): Return size_.
        (Chunked_vector::size): Return size_.
        (Chunked_vector::push_back): Use size_ to find insert position.
        (Chunked_vector::push_back): Use size_ to find insert position.
        (Chunked_vector::size_): New data member.
        (Chunked_vector::size_): New data member.
        (Stringpool_template::set_no_zero_null): Assert string set is empty.
        (Stringpool_template::set_no_zero_null): Assert string set is empty.
        (Stringpool_template::new_key_offset): New method declaration.
        (Stringpool_template::new_key_offset): New method declaration.
        (Stringpool_template::offset_): New data member.
        (Stringpool_template::offset_): New data member.
2010-03-15   Rafael Espindola  
2010-03-15   Rafael Espindola  
        * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
        * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
        Add_symbols' constructor.
        Add_symbols' constructor.
        * readsyms.h (Add_symbols): Remove the input_group member.
        * readsyms.h (Add_symbols): Remove the input_group member.
2010-03-10  Ian Lance Taylor  
2010-03-10  Ian Lance Taylor  
        * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
        * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
        target to ask whether a reference to a symbol requires a stack
        target to ask whether a reference to a symbol requires a stack
        split.
        split.
        * target.h (Target::is_call_to_non_split): New function.
        * target.h (Target::is_call_to_non_split): New function.
        (Target::do_is_call_to_non_split): Declare virtual function.
        (Target::do_is_call_to_non_split): Declare virtual function.
        * target.cc: Include "symtab.h".
        * target.cc: Include "symtab.h".
        (Target::do_is_call_to_non_split): New function.
        (Target::do_is_call_to_non_split): New function.
        * i386.cc (Target_i386::do_is_call_to_non_split): New function.
        * i386.cc (Target_i386::do_is_call_to_non_split): New function.
2010-03-10  Cary Coutant  
2010-03-10  Cary Coutant  
        * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
        * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
        (File_read::open[1]): Remove initial mapping of whole_file_view_.
        (File_read::open[1]): Remove initial mapping of whole_file_view_.
        (File_read::open[2]): Add whole_file_view_ to list of views.
        (File_read::open[2]): Add whole_file_view_ to list of views.
        (File_read::make_view): Remove test of whole_file_view_.
        (File_read::make_view): Remove test of whole_file_view_.
        (File_read::find_or_make_view): Create whole_file_view_ if
        (File_read::find_or_make_view): Create whole_file_view_ if
        necessary.
        necessary.
        (File_read::clear_views): Replace bool parameter with enum;
        (File_read::clear_views): Replace bool parameter with enum;
        adjust all callers.  Don't delete views with permanent data;
        adjust all callers.  Don't delete views with permanent data;
        do delete cached views and views from archives if
        do delete cached views and views from archives if
        --no-keep-files-mapped is set.  Set whole_file_view_ to NULL
        --no-keep-files-mapped is set.  Set whole_file_view_ to NULL
        if clearing the corresponding view.
        if clearing the corresponding view.
        * fileread.h (File_read::Clear_views_mode): New enum.
        * fileread.h (File_read::Clear_views_mode): New enum.
        (File_read::View::is_permanent_view): New method.
        (File_read::View::is_permanent_view): New method.
        (File_read::clear_views): Replace bool parameter
        (File_read::clear_views): Replace bool parameter
        with enum; adjust all callers.
        with enum; adjust all callers.
        * options.h (General_options): Change keep_files_mapped option;
        * options.h (General_options): Change keep_files_mapped option;
        add map_whole_files.
        add map_whole_files.
        * readsyms.cc (Add_symbols::run): Delete sd_ object before
        * readsyms.cc (Add_symbols::run): Delete sd_ object before
        releasing the file.
        releasing the file.
        * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
        * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
        the file.
        the file.
2010-03-10  David S. Miller  
2010-03-10  David S. Miller  
        * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
        * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2010-03-09  Sriraman Tallam  
2010-03-09  Sriraman Tallam  
        * icf.cc (get_section_contents): Add '@' marker after processing the
        * icf.cc (get_section_contents): Add '@' marker after processing the
        merge reloc.
        merge reloc.
2010-03-08  Doug Kwan  
2010-03-08  Doug Kwan  
        * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
        * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
        due to a conversion warning.
        due to a conversion warning.
        (Arm_relobj::update_output_local_symbol_count): Check for local
        (Arm_relobj::update_output_local_symbol_count): Check for local
        symbol with unset output index.
        symbol with unset output index.
2010-03-05  Ian Lance Taylor  
2010-03-05  Ian Lance Taylor  
        * options.h (class General_options): Add --spare-dynamic-tags.
        * options.h (class General_options): Add --spare-dynamic-tags.
        * output.cc (Output_data_dynamic::set_final_data_size): Implement
        * output.cc (Output_data_dynamic::set_final_data_size): Implement
        --spare-dynamic-tags.
        --spare-dynamic-tags.
2010-03-05  Ian Lance Taylor  
2010-03-05  Ian Lance Taylor  
        * incremental.cc: Include "libiberty.h".
        * incremental.cc: Include "libiberty.h".
2010-03-05  Rainer Orth  
2010-03-05  Rainer Orth  
        * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
        * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
        function, is_info_ member.
        function, is_info_ member.
        * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
        * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
        (Versions::Versions): Update caller.
        (Versions::Versions): Update caller.
        (Versions::define_base_version): Likewise.
        (Versions::define_base_version): Likewise.
        (Versions::add_def): Likewise.
        (Versions::add_def): Likewise.
2010-03-03  Sriraman Tallam  
2010-03-03  Sriraman Tallam  
        * i386.cc (Target_i386::can_check_for_function_pointers): New function.
        * i386.cc (Target_i386::can_check_for_function_pointers): New function.
        (Scan::possible_function_pointer_reloc): New function.
        (Scan::possible_function_pointer_reloc): New function.
        (Scan::local_reloc_may_be_function_pointer): Change to call
        (Scan::local_reloc_may_be_function_pointer): Change to call
        possible_function_pointer_reloc.
        possible_function_pointer_reloc.
        (Scan::global_reloc_may_be_function_pointer): Ditto.
        (Scan::global_reloc_may_be_function_pointer): Ditto.
        * icf.h (Icf::check_section_for_function_pointers): Change to reject
        * icf.h (Icf::check_section_for_function_pointers): Change to reject
        relocations in ".data.rel.ro._ZTV" section.
        relocations in ".data.rel.ro._ZTV" section.
        * testsuite/icf_safe_so_test.sh: Change to pass i386.
        * testsuite/icf_safe_so_test.sh: Change to pass i386.
        * testsuite/icf_safe_so_test.cc: Ditto.
        * testsuite/icf_safe_so_test.cc: Ditto.
        * testsuite/icf_safe_test.cc: Ditto.
        * testsuite/icf_safe_test.cc: Ditto.
        * testsuite/icf_safe_test.sh: Ditto.
        * testsuite/icf_safe_test.sh: Ditto.
2010-03-03  Viktor Kutuzov  
2010-03-03  Viktor Kutuzov  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * target-reloc.h (relocate_section): Check the symbol table index
        * target-reloc.h (relocate_section): Check the symbol table index
        for -1U before setting the local symbol index.
        for -1U before setting the local symbol index.
        (scan_relocatable_relocs): If copying the relocation, record that
        (scan_relocatable_relocs): If copying the relocation, record that
        the local symbol is required.
        the local symbol is required.
        * object.h (Symbol_value::is_output_symtab_index_set): New
        * object.h (Symbol_value::is_output_symtab_index_set): New
        function.
        function.
        (Symbol_value::may_be_discarded_from_output_symtab): New
        (Symbol_value::may_be_discarded_from_output_symtab): New
        function.
        function.
        (Symbol_value::has_output_symtab_entry): New function.
        (Symbol_value::has_output_symtab_entry): New function.
        (Symbol_value::needs_output_symtab_entry): Remove.
        (Symbol_value::needs_output_symtab_entry): Remove.
        (Symbol_value::output_symtab_index): Make sure the symbol index is
        (Symbol_value::output_symtab_index): Make sure the symbol index is
        set.
        set.
        (Symbol_value::set_output_symtab_index): Make sure the symbol
        (Symbol_value::set_output_symtab_index): Make sure the symbol
        index is not set.  Make sure the new index is valid.
        index is not set.  Make sure the new index is valid.
        (Symbol_value::set_must_have_output_symtab_entry): New function.
        (Symbol_value::set_must_have_output_symtab_entry): New function.
        (Symbol_value::has_output_dynsym_entry): New function.
        (Symbol_value::has_output_dynsym_entry): New function.
        (Symbol_value::set_output_dynsym_index): Make sure the new index
        (Symbol_value::set_output_dynsym_index): Make sure the new index
        is valid.
        is valid.
        (Sized_relobj::set_must_have_output_symtab_entry): New function.
        (Sized_relobj::set_must_have_output_symtab_entry): New function.
        * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
        * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
        local symbol if permitted.
        local symbol if permitted.
        (Sized_relobj::do_finalize_local_symbols): Call
        (Sized_relobj::do_finalize_local_symbols): Call
        is_output_symtab_index_set rather than needs_output_symtab_entry.
        is_output_symtab_index_set rather than needs_output_symtab_entry.
        (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
        (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
        rather than needs_output_symtab_entry.  Call
        rather than needs_output_symtab_entry.  Call
        has_output_dynsym_entry rather than needs_output_dynsym_entry.
        has_output_dynsym_entry rather than needs_output_dynsym_entry.
        * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
        * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
        is_output_symtab_index_set rather than needs_output_symtab_entry.
        is_output_symtab_index_set rather than needs_output_symtab_entry.
        * testsuite/discard_locals_relocatable_test.c: New file.
        * testsuite/discard_locals_relocatable_test.c: New file.
        * testsuite/discard_locals_test.sh: Test -r.
        * testsuite/discard_locals_test.sh: Test -r.
        * testsuite/Makefile.am (check_DATA): Add
        * testsuite/Makefile.am (check_DATA): Add
        discard_locals_relocatable_test1.syms,
        discard_locals_relocatable_test1.syms,
        discard_local_relocatable_test2.syms.
        discard_local_relocatable_test2.syms.
        (MOSTLYCLEANFILES): Likewise.  Also add
        (MOSTLYCLEANFILES): Likewise.  Also add
        discard_locals_relocatable_test1.lout and
        discard_locals_relocatable_test1.lout and
        discard_locals_relocatable_test2.out.
        discard_locals_relocatable_test2.out.
        (discard_locals_relocatable_test1.syms): New target.
        (discard_locals_relocatable_test1.syms): New target.
        (discard_locals_relocatable_test.o): New target.
        (discard_locals_relocatable_test.o): New target.
        (discard_locals_relocatable_test1.out): New target.
        (discard_locals_relocatable_test1.out): New target.
        (discard_locals_relocatable_test2.syms): New target.
        (discard_locals_relocatable_test2.syms): New target.
        (discard_locals_relocatable_test2.out): New target.
        (discard_locals_relocatable_test2.out): New target.
        (various): Add missing ../ld-new dependencies.
        (various): Add missing ../ld-new dependencies.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2010-03-03  Nick Clifton  
2010-03-03  Nick Clifton  
        * po/fi.po: New Finnish translation.
        * po/fi.po: New Finnish translation.
2010-03-01  Doug Kwan  
2010-03-01  Doug Kwan  
        * layout.cc (Layout::Layout): Force section types of .init_array*,
        * layout.cc (Layout::Layout): Force section types of .init_array*,
        .preinit_array* and .fini_array* sections.
        .preinit_array* and .fini_array* sections.
        * output.cc (Output_section::Input_section_sort_entry::has_priority):
        * output.cc (Output_section::Input_section_sort_entry::has_priority):
        Fix check of return value of std::string::find.().
        Fix check of return value of std::string::find.().
        (Output_section::Input_section_sort_compare::operator()): Remove
        (Output_section::Input_section_sort_compare::operator()): Remove
        comment about .init_array.
        comment about .init_array.
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        (Output_section::Input_section_sort_init_fini_compare::operator()):
        New method.
        New method.
        (Output_section::sort_attached_input_sections): Handle .init_array
        (Output_section::sort_attached_input_sections): Handle .init_array
        and .fini_array specially.
        and .fini_array specially.
        * output.h (Output_section::Inut_section_sort_compare): Update
        * output.h (Output_section::Inut_section_sort_compare): Update
        comment.
        comment.
        (Output_section::Input_section_sort_init_fini_compare): New struct.
        (Output_section::Input_section_sort_init_fini_compare): New struct.
2010-02-26  Doug Kwan  
2010-02-26  Doug Kwan  
        * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
        * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
        R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
        R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
        * testsuite/debug_msg.sh: Avoid matching source line number for
        * testsuite/debug_msg.sh: Avoid matching source line number for
        use of global variable undef_int.
        use of global variable undef_int.
2010-02-26  Doug Kwan  
2010-02-26  Doug Kwan  
        * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
        * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
        R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
        R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
        (Target_arm::scan_reloc_section_for_stubs): Instead of calling
        (Target_arm::scan_reloc_section_for_stubs): Instead of calling
        scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
        scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
        * options.cc (General_options::General_options): Initialize member
        * options.cc (General_options::General_options): Initialize member
        fix_v4bx_.
        fix_v4bx_.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
        (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
        (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
        and rm_no_fix_v4bx.stdout
        and rm_no_fix_v4bx.stdout
        (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
        (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
        arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
        arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
        arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
        arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
        (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
        (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
        and arm_no_fix_v4bx.
        and arm_no_fix_v4bx.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/arm_fix_v4bx.s: New file.
        * testsuite/arm_fix_v4bx.s: New file.
        * testsuite/arm_fix_v4bx.sh: Ditto.
        * testsuite/arm_fix_v4bx.sh: Ditto.
2010-02-24  Doug Kwan  
2010-02-24  Doug Kwan  
        * arm.cc (Target_arm::got_section): Make the .got section the first
        * arm.cc (Target_arm::got_section): Make the .got section the first
        non RELRO section in the data segment.
        non RELRO section in the data segment.
        * testsuite/script_test_5.sh: Fix match patterns to avoid matching
        * testsuite/script_test_5.sh: Fix match patterns to avoid matching
        suffixes of section names.
        suffixes of section names.
2010-02-24  Doug Kwan  
2010-02-24  Doug Kwan  
        * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
        * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
        flags and attributes merging if an input file is a binary file.
        flags and attributes merging if an input file is a binary file.
        * fileread.cc (Input_file::open): Record format of original file.
        * fileread.cc (Input_file::open): Record format of original file.
        * fileread.h (Input_file::Format): New enum type.
        * fileread.h (Input_file::Format): New enum type.
        (Input_file::Input_file): Initialize data member format_.
        (Input_file::Input_file): Initialize data member format_.
        (Input_file::format): New method definition.
        (Input_file::format): New method definition.
        (Input_file::format_):: New data member.
        (Input_file::format_):: New data member.
2010-02-24  Doug Kwan  
2010-02-24  Doug Kwan  
        * arm.cc (Arm_output_data_got): New class.
        * arm.cc (Arm_output_data_got): New class.
        (ARM_TCB_SIZE): New constant
        (ARM_TCB_SIZE): New constant
        (Target_arm): Use Arm_output_data_got instead of Output_data_got.
        (Target_arm): Use Arm_output_data_got instead of Output_data_got.
        (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
        (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
        If user uses a script with a SECTIONS clause, issue only a warning
        If user uses a script with a SECTIONS clause, issue only a warning
        for a misplaced EXIDX input section.  Otherwise, issue an error.
        for a misplaced EXIDX input section.  Otherwise, issue an error.
        (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
        (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
        garbage collection.
        garbage collection.
        (Target_arm::got_mode_index_entry): Handle static linking.
        (Target_arm::got_mode_index_entry): Handle static linking.
        (Target_arm::Scan::local): Ditto.
        (Target_arm::Scan::local): Ditto.
        (Target_arm::Scan::global): Ditto.
        (Target_arm::Scan::global): Ditto.
        (Target_arm::Relocate::relocate_tls): Handle static linking.  Fix
        (Target_arm::Relocate::relocate_tls): Handle static linking.  Fix
        all incorrectly implemented relocations.
        all incorrectly implemented relocations.
        (Target_arm::fix_exidx_coverage): Pass layout to
        (Target_arm::fix_exidx_coverage): Pass layout to
        Arm_output_section::fix_exidx_coverage.
        Arm_output_section::fix_exidx_coverage.
        * layout.cc (Layout::section_name_mapping): Remove trailing dots
        * layout.cc (Layout::section_name_mapping): Remove trailing dots
        from ".ARM.exidx." and ".ARM.extab.".
        from ".ARM.exidx." and ".ARM.extab.".
2010-02-23  Viktor Kutuzov  
2010-02-23  Viktor Kutuzov  
        * arm.cc (Target_arm::do_finalize_sections): Create attribute
        * arm.cc (Target_arm::do_finalize_sections): Create attribute
        section if it does not already exist.
        section if it does not already exist.
        * attributes.cc (Attributes_section_data::Attributes_section_data):
        * attributes.cc (Attributes_section_data::Attributes_section_data):
        Don't crash if size is zero.
        Don't crash if size is zero.
2010-02-23  Viktor Kutuzov  
2010-02-23  Viktor Kutuzov  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * gold.cc (queue_middle_tasks): If no input files were opened,
        * gold.cc (queue_middle_tasks): If no input files were opened,
        exit.
        exit.
        * workqueue.h (Task_function::Task_function): Assert that there is
        * workqueue.h (Task_function::Task_function): Assert that there is
        a blocker.
        a blocker.
2010-02-22  Doug Kwan  
2010-02-22  Doug Kwan  
        * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
        * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
        * icf.cc (get_section_contents): Cast snprintf arguments to long long
        * icf.cc (get_section_contents): Cast snprintf arguments to long long
        types to avoid warnings due to different uint64_t implementations
        types to avoid warnings due to different uint64_t implementations
        on different hosts.
        on different hosts.
2010-02-21  Doug Kwan  
2010-02-21  Doug Kwan  
        * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
        * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
        handling of the maximum backward branch offset.
        handling of the maximum backward branch offset.
        (Arm_relocate_functions::thumb_branch_common): Ditto.
        (Arm_relocate_functions::thumb_branch_common): Ditto.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
        (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
        (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
        thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
        thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
        thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
        thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
        (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
        (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
        arm_bl_out_of_range.stdout, arm_bl_out_of_range,
        arm_bl_out_of_range.stdout, arm_bl_out_of_range,
        arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
        arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
        thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
        thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
        thumb_bl_out_of_range thumb_bl_out_of_range.o,
        thumb_bl_out_of_range thumb_bl_out_of_range.o,
        thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
        thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
        thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
        thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
        thumb2_bl_out_of_range.o): New rules.
        thumb2_bl_out_of_range.o): New rules.
        (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
        (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
        thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
        thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
        thumb2_bl_out_of_range
        thumb2_bl_out_of_range
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/arm_bl_in_range.s: New file.
        * testsuite/arm_bl_in_range.s: New file.
        * testsuite/arm_bl_out_of_range.s: Ditto.
        * testsuite/arm_bl_out_of_range.s: Ditto.
        * testsuite/arm_branch_in_range.sh: Ditto.
        * testsuite/arm_branch_in_range.sh: Ditto.
        * testsuite/arm_branch_range.t: Ditto.
        * testsuite/arm_branch_range.t: Ditto.
        * testsuite/thumb2_branch_range.t: Ditto.
        * testsuite/thumb2_branch_range.t: Ditto.
        * testsuite/thumb_bl_in_range.s: Ditto.
        * testsuite/thumb_bl_in_range.s: Ditto.
        * testsuite/thumb_bl_out_of_range.s: Ditto.
        * testsuite/thumb_bl_out_of_range.s: Ditto.
        * testsuite/thumb_branch_range.t: Ditto.
        * testsuite/thumb_branch_range.t: Ditto.
2010-02-20  Sriraman Tallam  
2010-02-20  Sriraman Tallam  
        * gc.h (gc_process_relocs): Change vectors to point to the new list.
        * gc.h (gc_process_relocs): Change vectors to point to the new list.
        Add reloc offset information.
        Add reloc offset information.
        * icf.cc (get_section_contents): Change iterators to point to the new
        * icf.cc (get_section_contents): Change iterators to point to the new
        vectors. Add reloc offset information to the contents.
        vectors. Add reloc offset information to the contents.
        * icf.h (Icf::Sections_reachable_info): New typedef.
        * icf.h (Icf::Sections_reachable_info): New typedef.
        (Icf::Sections_reachable_list): New typedef.
        (Icf::Sections_reachable_list): New typedef.
        (Icf::Offset_info): New typedef.
        (Icf::Offset_info): New typedef.
        (Icf::Reloc_info): New struct typedef.
        (Icf::Reloc_info): New struct typedef.
        (Icf::Reloc_info_list): New typedef.
        (Icf::Reloc_info_list): New typedef.
        (Icf::symbol_reloc_list): Delete method.
        (Icf::symbol_reloc_list): Delete method.
        (Icf::addend_reloc_list): Delete method.
        (Icf::addend_reloc_list): Delete method.
        (Icf::section_reloc_list): Delete method.
        (Icf::section_reloc_list): Delete method.
        (Icf::reloc_info_list): New method.
        (Icf::reloc_info_list): New method.
        (Icf::reloc_info_list_): New member.
        (Icf::reloc_info_list_): New member.
2010-02-19  Doug Kwan  
2010-02-19  Doug Kwan  
        * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
        * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
        R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
        R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
        * arm.cc (Arm_relocation_functions): New forward declaration.
        * arm.cc (Arm_relocation_functions): New forward declaration.
        (Target_arm::Target_arm): Initialize new data members
        (Target_arm::Target_arm): Initialize new data members
        got_mod_index_offset_ and tls_base_symbol_defined_.
        got_mod_index_offset_ and tls_base_symbol_defined_.
        (Target_arm::Relocate::relocate_tls): New method.
        (Target_arm::Relocate::relocate_tls): New method.
        (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
        (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
         Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
         Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
        New methods.
        New methods.
        (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
        (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
        GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
        GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
        (Target_arm::got_mod_index_offset_,
        (Target_arm::got_mod_index_offset_,
        Target_arm::tls_base_symbol_defined_): New data members.
        Target_arm::tls_base_symbol_defined_): New data members.
        (Target_arm::Scan::local, Target::Scan::global,
        (Target_arm::Scan::local, Target::Scan::global,
        Target_arm::Relocate::relocate): Handle 32-bit initial TLS
        Target_arm::Relocate::relocate): Handle 32-bit initial TLS
        relocations.
        relocations.
2010-02-18  Doug Kwan  
2010-02-18  Doug Kwan  
        * arm.cc (Arm_relobj::find_linked_text_section): New method.
        * arm.cc (Arm_relobj::find_linked_text_section): New method.
        (Arm_relobj::make_exidx_input_section): Pass section index of linked
        (Arm_relobj::make_exidx_input_section): Pass section index of linked
        text section as a parameter becuase some broken tools may not set
        text section as a parameter becuase some broken tools may not set
        the link in section header.
        the link in section header.
        (Target_arm::has_got_section): New method.
        (Target_arm::has_got_section): New method.
        (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
        (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
        without any mapping symbol as data only.  Remove warning.
        without any mapping symbol as data only.  Remove warning.
        (Arm_relobj::do_read_synbols): If an EXIDX input section has no
        (Arm_relobj::do_read_synbols): If an EXIDX input section has no
        link in its section header, try to discover the link by inspecting the
        link in its section header, try to discover the link by inspecting the
        REL31 relocation at the beginning of the section.
        REL31 relocation at the beginning of the section.
        (Target_arm::Scan::check_non_pic): Report name of offending relocation
        (Target_arm::Scan::check_non_pic): Report name of offending relocation
        in error message.
        in error message.
        (Target_arm::Scan::global): Treat any reference to the symbol
        (Target_arm::Scan::global): Treat any reference to the symbol
        _GLOBAL_OFFSET_TABLE_ as a GOT access.
        _GLOBAL_OFFSET_TABLE_ as a GOT access.
2010-02-12  Sriraman Tallam  
2010-02-12  Sriraman Tallam  
        * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
        * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
        * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
        * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
        * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
        * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::global_reloc_may_be_function_pointer): New function.
        (Scan::possible_function_pointer_reloc): New function.
        (Scan::possible_function_pointer_reloc): New function.
        (Target_x86_64::can_check_for_function_pointers): New function.
        (Target_x86_64::can_check_for_function_pointers): New function.
        * gc.h (gc_process_relocs): Scan relocation types to determine if
        * gc.h (gc_process_relocs): Scan relocation types to determine if
        function pointers were taken for targets that support it.
        function pointers were taken for targets that support it.
        * icf.cc (Icf::find_identical_sections): Include functions for
        * icf.cc (Icf::find_identical_sections): Include functions for
        folding in safe ICF whose pointer is not taken.
        folding in safe ICF whose pointer is not taken.
        * icf.h (Secn_fptr_taken_set): New typedef.
        * icf.h (Secn_fptr_taken_set): New typedef.
        (fptr_section_id_): New member.
        (fptr_section_id_): New member.
        (section_has_function_pointers): New function.
        (section_has_function_pointers): New function.
        (set_section_has_function_pointers): New function.
        (set_section_has_function_pointers): New function.
        (check_section_for_function_pointers): New function.
        (check_section_for_function_pointers): New function.
        * options.h: Fix comment for safe ICF option.
        * options.h: Fix comment for safe ICF option.
        * target.h (can_check_for_function_pointers): New function.
        * target.h (can_check_for_function_pointers): New function.
        * testsuite/Makefile.am: Add icf_safe_so_test test case.
        * testsuite/Makefile.am: Add icf_safe_so_test test case.
        Modify icf_safe_test for X86-64.
        Modify icf_safe_test for X86-64.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/icf_safe_so_test.cc: New file.
        * testsuite/icf_safe_so_test.cc: New file.
        * testsuite/icf_safe_so_test.sh: New file.
        * testsuite/icf_safe_so_test.sh: New file.
        * testsuite/icf_safe_test.cc (kept_func_3): New function.
        * testsuite/icf_safe_test.cc (kept_func_3): New function.
        (main): Change to take pointer to function kept_func_3.
        (main): Change to take pointer to function kept_func_3.
        * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
        * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
        folding is done correctly for X86-64.
        folding is done correctly for X86-64.
2010-02-12  David S. Miller  
2010-02-12  David S. Miller  
        * output.h (Output_reloc::Output_reloc): Add
        * output.h (Output_reloc::Output_reloc): Add
        is_symbolless parameter.
        is_symbolless parameter.
        (Output_reloc::is_symbolless): New.
        (Output_reloc::is_symbolless): New.
        (Output_reloc::is_symbolless_): New.
        (Output_reloc::is_symbolless_): New.
        (Output_reloc::type_): Decrease to 29 bits.
        (Output_reloc::type_): Decrease to 29 bits.
        (Output_reloc::Output_reloc): Add is_symbolless parameter.
        (Output_reloc::Output_reloc): Add is_symbolless parameter.
        (Output_reloc::is_symbolless): New.
        (Output_reloc::is_symbolless): New.
        (Output_data_reloc::add_global): Handle is_symbolless.
        (Output_data_reloc::add_global): Handle is_symbolless.
        (Output_data_reloc::add_global_relative): Likewise.
        (Output_data_reloc::add_global_relative): Likewise.
        (Output_data_reloc::add_local): Likewise.
        (Output_data_reloc::add_local): Likewise.
        (Output_data_reloc::add_local_relative): Likewise.
        (Output_data_reloc::add_local_relative): Likewise.
        (Output_data_reloc::add_symbolless_global_addend): New.
        (Output_data_reloc::add_symbolless_global_addend): New.
        (Output_data_reloc::add_symbolless_local_addend): New.
        (Output_data_reloc::add_symbolless_local_addend): New.
        * output.cc (Output_reloc::Output_reloc): Handle
        * output.cc (Output_reloc::Output_reloc): Handle
        is_symbolless.
        is_symbolless.
        (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
        (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
        instead of ->is_relative_
        instead of ->is_relative_
        (Output_reloc::write): Likewise.
        (Output_reloc::write): Likewise.
        (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
        (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
        (Output_reloc::write_rel): Simplify.
        (Output_reloc::write_rel): Simplify.
        * sparc.cc (Target_sparc::Scan::local): Use
        * sparc.cc (Target_sparc::Scan::local): Use
        ->add_symbolless_local_addend as needed.
        ->add_symbolless_local_addend as needed.
        (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
        (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
        needed.  Also, emit appropriate unaligned vs. aligned dynamic reloc
        needed.  Also, emit appropriate unaligned vs. aligned dynamic reloc
        based upon relocation offset.
        based upon relocation offset.
2010-02-11  Doug Kwan  
2010-02-11  Doug Kwan  
        * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
        * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
        (Target_arm::Scan::global): Ditto.  Also remove a comment before the
        (Target_arm::Scan::global): Ditto.  Also remove a comment before the
        beginning of function.
        beginning of function.
        (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
        (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
        and MOVT_ABS relocations.  Those are non issued in scanning.  Fix
        and MOVT_ABS relocations.  Those are non issued in scanning.  Fix
        parameter is_32bit in calls to should_apply_static_reloc.
        parameter is_32bit in calls to should_apply_static_reloc.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
        (check_DATA): Add arm_abs_global.stdout.
        (check_DATA): Add arm_abs_global.stdout.
        (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
        (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
        arm_abs_global.stdout): New rules.
        arm_abs_global.stdout): New rules.
        (MOSTLLYCLEANFILES): Add arm_abs_global
        (MOSTLLYCLEANFILES): Add arm_abs_global
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/arm_abs_global.s: New file.
        * testsuite/arm_abs_global.s: New file.
        * testsuite/arm_abs_global.sh: Ditto.
        * testsuite/arm_abs_global.sh: Ditto.
        * testsuite/arm_abs_lib.s: Ditto.
        * testsuite/arm_abs_lib.s: Ditto.
2010-02-11  Ian Lance Taylor  
2010-02-11  Ian Lance Taylor  
        * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
        * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
        Read_relocs task.
        Read_relocs task.
        (queue_middle_tasks): Likewise, and also for Scan_relocs.  Run
        (queue_middle_tasks): Likewise, and also for Scan_relocs.  Run
        Allocate_commons_task first.
        Allocate_commons_task first.
        * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
        * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
        task, rather than symtab_lock_.
        task, rather than symtab_lock_.
        (Gc_process_relocs::~Gc_process_relocs): New function.
        (Gc_process_relocs::~Gc_process_relocs): New function.
        (Gc_process_relocs::is_runnable): Check this_blocker_.
        (Gc_process_relocs::is_runnable): Check this_blocker_.
        (Gc_process_relocs::locks): Use next_blocker_ rather than
        (Gc_process_relocs::locks): Use next_blocker_ rather than
        blocker_.
        blocker_.
        (Scan_relocs::~Scan_relocs): New function.
        (Scan_relocs::~Scan_relocs): New function.
        (Scan_relocs::is_runnable): Check this_blocker_ rather than
        (Scan_relocs::is_runnable): Check this_blocker_ rather than
        symtab_lock_.
        symtab_lock_.
        (Scan_relocs::locks): Drop symtab_lock_ and blocker_.  Add
        (Scan_relocs::locks): Drop symtab_lock_ and blocker_.  Add
        next_blocker_.
        next_blocker_.
        * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
        * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
        fields.  Add this_blocker_ and next_blocker_ fields.  Adjust
        fields.  Add this_blocker_ and next_blocker_ fields.  Adjust
        constructor accordingly.
        constructor accordingly.
        (class Gc_process_relocs): Likewise.
        (class Gc_process_relocs): Likewise.
        (class Scan_relocs): Likewise.
        (class Scan_relocs): Likewise.
        * common.h (class Allocate_commons_task): Remove symtab_lock_
        * common.h (class Allocate_commons_task): Remove symtab_lock_
        field, and corresponding constructor parameter.
        field, and corresponding constructor parameter.
        * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
        * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
        symtab_lock_.
        symtab_lock_.
        (Allocate_commons_task::locks): Likewise.
        (Allocate_commons_task::locks): Likewise.
2010-02-11  Ian Lance Taylor  
2010-02-11  Ian Lance Taylor  
        * gold-threads.h (class Once): Define.
        * gold-threads.h (class Once): Define.
        (class Initialize_lock): Rewrite as child of Once.
        (class Initialize_lock): Rewrite as child of Once.
        * gold-threads.cc (class Once_initialize): Define.
        * gold-threads.cc (class Once_initialize): Define.
        (once_pointer_control): New static variable.
        (once_pointer_control): New static variable.
        (once_pointer, once_arg): New static variables.
        (once_pointer, once_arg): New static variables.
        (c_run_once): New static function.
        (c_run_once): New static function.
        (Once::Once, Once::run_once, Once::internal_run): New functions.
        (Once::Once, Once::run_once, Once::internal_run): New functions.
        (class Initialize_lock_once): Remove.
        (class Initialize_lock_once): Remove.
        (initialize_lock_control): Remove.
        (initialize_lock_control): Remove.
        (initialize_lock_pointer): Remove.
        (initialize_lock_pointer): Remove.
        (initialize_lock_once): Remove.
        (initialize_lock_once): Remove.
        (Initialize_lock::Initialize_lock): Move to gold-threads.h.
        (Initialize_lock::Initialize_lock): Move to gold-threads.h.
        (Initialize_lock::initialize): Rewrite.
        (Initialize_lock::initialize): Rewrite.
        (Initialize_lock::do_run_once): New function.
        (Initialize_lock::do_run_once): New function.
        * archive.cc (Archive::interpret_header): Only clear name if it is
        * archive.cc (Archive::interpret_header): Only clear name if it is
        not already empty.
        not already empty.
        * fileread.cc: Include "gold-threads.h"
        * fileread.cc: Include "gold-threads.h"
        (file_counts_lock): New static variable.
        (file_counts_lock): New static variable.
        (file_counts_initialize_lock): Likewise.
        (file_counts_initialize_lock): Likewise.
        (File_read::release): Only increment counts when using --stats.
        (File_read::release): Only increment counts when using --stats.
        Use a lock around the increment.
        Use a lock around the increment.
        * parameters.cc (class Set_parameters_target_once): Define.
        * parameters.cc (class Set_parameters_target_once): Define.
        (set_parameters_target_once): New static variable.
        (set_parameters_target_once): New static variable.
        (Parameters::Parameters): Move here from parameters.h.
        (Parameters::Parameters): Move here from parameters.h.
        (Parameters::set_target): Rewrite.
        (Parameters::set_target): Rewrite.
        (Parameters::set_target_once): New function.
        (Parameters::set_target_once): New function.
        (Parameters::clear_target): Move here and rewrite.
        (Parameters::clear_target): Move here and rewrite.
        * parameters.h (class Parameters): Update declarations.  Add
        * parameters.h (class Parameters): Update declarations.  Add
        set_parameters_target_once_ field.
        set_parameters_target_once_ field.
        (Parameters::Parameters): Move to parameters.cc.
        (Parameters::Parameters): Move to parameters.cc.
        (Parameters::clear_target): Likewise.
        (Parameters::clear_target): Likewise.
        * readsyms.cc (Read_symbols::do_group): Create a Start_group
        * readsyms.cc (Read_symbols::do_group): Create a Start_group
        task.
        task.
        (Start_group::~Start_group): New function.
        (Start_group::~Start_group): New function.
        (Start_group::is_runnable): New function.
        (Start_group::is_runnable): New function.
        (Start_group::locks, Start_group::run): New functions.
        (Start_group::locks, Start_group::run): New functions.
        (Finish_group::run): Change saw_undefined to size_t.
        (Finish_group::run): Change saw_undefined to size_t.
        * readsyms.h (class Start_group): Define.
        * readsyms.h (class Start_group): Define.
        (class Finish_group): Change saw_undefined_ field to size_t.
        (class Finish_group): Change saw_undefined_ field to size_t.
        (Finish_group::Finish_group): Remove saw_undefined and
        (Finish_group::Finish_group): Remove saw_undefined and
        this_blocker parameters.  Change all callers.
        this_blocker parameters.  Change all callers.
        (Finish_group::set_saw_undefined): New function.
        (Finish_group::set_saw_undefined): New function.
        (Finish_group::set_blocker): New function.
        (Finish_group::set_blocker): New function.
        * symtab.h (class Symbol_table): Change saw_undefined to return
        * symtab.h (class Symbol_table): Change saw_undefined to return
        size_t.  Change saw_undefined_ field to size_t.
        size_t.  Change saw_undefined_ field to size_t.
        * target-select.cc (Set_target_once::do_run_once): New function.
        * target-select.cc (Set_target_once::do_run_once): New function.
        (Target_selector::Target_selector): Initialize set_target_once_
        (Target_selector::Target_selector): Initialize set_target_once_
        field.  Don't initialize lock_ and initialize_lock_ fields.
        field.  Don't initialize lock_ and initialize_lock_ fields.
        (Target_selector::instantiate_target): Rewrite.
        (Target_selector::instantiate_target): Rewrite.
        (Target_selector::set_target): New function.
        (Target_selector::set_target): New function.
        * target-select.h (class Set_target_once): Define.
        * target-select.h (class Set_target_once): Define.
        (class Target_selector): Update declarations.  Make
        (class Target_selector): Update declarations.  Make
        Set_target_once a friend.  Remove lock_ and initialize_lock_
        Set_target_once a friend.  Remove lock_ and initialize_lock_
        fields.  Add set_target_once_ field.
        fields.  Add set_target_once_ field.
2010-02-10  Ian Lance Taylor  
2010-02-10  Ian Lance Taylor  
        * dirsearch.cc (Dirsearch::initialize): Add all blockers before
        * dirsearch.cc (Dirsearch::initialize): Add all blockers before
        queueing any tasks.
        queueing any tasks.
        * gold.cc (queue_middle_gc_tasks): Likewise.  Fix final blocker.
        * gold.cc (queue_middle_gc_tasks): Likewise.  Fix final blocker.
        (queue_middle_tasks): Add all blockers before queueing any tasks.
        (queue_middle_tasks): Add all blockers before queueing any tasks.
        (queue_final_tasks): Likewise.
        (queue_final_tasks): Likewise.
        * token.h (Task_token::add_blockers): New function.
        * token.h (Task_token::add_blockers): New function.
        * object.h (Input_objects::number_of_relobjs): New function.
        * object.h (Input_objects::number_of_relobjs): New function.
2010-02-10  Ian Lance Taylor  
2010-02-10  Ian Lance Taylor  
        * i386.cc (Relocate::relocate_tls): A local symbol is final if not
        * i386.cc (Relocate::relocate_tls): A local symbol is final if not
        shared, not if not position independent.
        shared, not if not position independent.
        * x86_64.cc (Relocate::relocate_tls): Likewise.
        * x86_64.cc (Relocate::relocate_tls): Likewise.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
        (tls_pie_pic_test): New target.
        (tls_pie_pic_test): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
        (tls_test_main_pie.o, tls_test_pie.o): New targets.
        (tls_test_main_pie.o, tls_test_pie.o): New targets.
        (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
        (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2010-02-09  David S. Miller  
2010-02-09  David S. Miller  
        * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
        * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
        R_SPARC_RELATIVE using ->add_local_relative().
        R_SPARC_RELATIVE using ->add_local_relative().
        (Target_sparc::Scan::global): Likewise for ->add_global_relative().
        (Target_sparc::Scan::global): Likewise for ->add_global_relative().
        * output.h (Output_data_dynamic::add_section_size): New method
        * output.h (Output_data_dynamic::add_section_size): New method
        that takes two Output_data objects.
        that takes two Output_data objects.
        (Output_data_dynamic::Dynamic_entry): Create storage for secondary
        (Output_data_dynamic::Dynamic_entry): Create storage for secondary
        entry param.  Handle it in initializers.
        entry param.  Handle it in initializers.
        * output.cc (Output_data_dynamic::Dynamic_entry::write): For
        * output.cc (Output_data_dynamic::Dynamic_entry::write): For
        DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
        DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
        * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
        * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
        arg.
        arg.
        * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
        * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
        and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
        and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
        * arm.cc (Target_arm::do_finalize_sections): Update to pass false
        * arm.cc (Target_arm::do_finalize_sections): Update to pass false
        for dynrel_includes_plt.
        for dynrel_includes_plt.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
        * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
        * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
        before .rela.plt
        before .rela.plt
        (Target_sparc::do_finalize_sections): Update to pass true for
        (Target_sparc::do_finalize_sections): Update to pass true for
        dynrel_includes_plt.
        dynrel_includes_plt.
        * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
        * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
        output before .rela.plt
        output before .rela.plt
        (Target_powerpc::do_finalize_sections): Update to pass true for
        (Target_powerpc::do_finalize_sections): Update to pass true for
        dynrel_includes_plt when 32-bit.
        dynrel_includes_plt when 32-bit.
2010-02-08  Doug Kwan  
2010-02-08  Doug Kwan  
        * arm.cc (Arm_relobj::simple_input_section_output_address): New
        * arm.cc (Arm_relobj::simple_input_section_output_address): New
        method.
        method.
        (Arm_relobj::section_needs_cortex_a8_stub_scanning,
        (Arm_relobj::section_needs_cortex_a8_stub_scanning,
        Arm_relobj::scan_section_for_cortex_a8_stubs,
        Arm_relobj::scan_section_for_cortex_a8_stubs,
        Arm_relobj::do_relocation_section): Instead of calling
        Arm_relobj::do_relocation_section): Instead of calling
        Output_section::output_address, use faster
        Output_section::output_address, use faster
        Arm_relobj::simple_input_section_output_address.
        Arm_relobj::simple_input_section_output_address.
2010-02-08  David S. Miller  
2010-02-08  David S. Miller  
        * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
        * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
        unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
        unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
        relocation helper function.
        relocation helper function.
        * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
        * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
        just like R_SPARC_GOT{10,13,22}.
        just like R_SPARC_GOT{10,13,22}.
        (Target_sparc::Scan::local): Likewise.
        (Target_sparc::Scan::local): Likewise.
        (Target_sparc::Relocate:relocate): Likewise.
        (Target_sparc::Relocate:relocate): Likewise.
2010-02-06  Ian Lance Taylor  
2010-02-06  Ian Lance Taylor  
        * configure.ac: Rewrite targetobjs duplicate removal code to use
        * configure.ac: Rewrite targetobjs duplicate removal code to use
        only shell constructs.
        only shell constructs.
        * configure: Rebuild.
        * configure: Rebuild.
2010-02-05  Doug Kwan  
2010-02-05  Doug Kwan  
        PR 11247
        PR 11247
        * arm.cc (Arm_relobj::section_is_scannable): New method.
        * arm.cc (Arm_relobj::section_is_scannable): New method.
        (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
        (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
        (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
        (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
2010-02-04  Doug Kwan  
2010-02-04  Doug Kwan  
        PR 11247
        PR 11247
        * arm-reloc-property.cc (cstdio): Include.
        * arm-reloc-property.cc (cstdio): Include.
        * configure.ac (targetobjs): Remove duplicates.
        * configure.ac (targetobjs): Remove duplicates.
        * configure: Regenerate.
        * configure: Regenerate.
        * resolve.cc (Symbol_table::resolve): Explicit instantiate both
        * resolve.cc (Symbol_table::resolve): Explicit instantiate both
        big and little endian version for a given address size.
        big and little endian version for a given address size.
2010-02-03  Doug Kwan  
2010-02-03  Doug Kwan  
        * arm-reloc-property.cc
        * arm-reloc-property.cc
        (Arm_reloc_property_table::reloc_name_in_error_message): New method
        (Arm_reloc_property_table::reloc_name_in_error_message): New method
        definition.
        definition.
        * arm-reloc-property.h
        * arm-reloc-property.h
        (Arm_reloc_property_table::get_implemented_static_reloc_property):
        (Arm_reloc_property_table::get_implemented_static_reloc_property):
        New method definition.
        New method definition.
        (Arm_reloc_property_table::reloc_name_in_error_message): New method
        (Arm_reloc_property_table::reloc_name_in_error_message): New method
        declaration.
        declaration.
        * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
        * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
        overflow to N.
        overflow to N.
        (GOT_PREL): Change implemented to Y.
        (GOT_PREL): Change implemented to Y.
        * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
        * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
        (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
        (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
        (Arm_relocate_functions::movw_abs_nc): Remove method.
        (Arm_relocate_functions::movw_abs_nc): Remove method.
        (Arm_relocate_functions::movt_abs): Ditto.
        (Arm_relocate_functions::movt_abs): Ditto.
        (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
        (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
        (Arm_relocate_functions::thm_movt_abs): Ditto.
        (Arm_relocate_functions::thm_movt_abs): Ditto.
        (Arm_relocate_functions::movw_rel_nc): Ditto.
        (Arm_relocate_functions::movw_rel_nc): Ditto.
        (Arm_relocate_functions::movw_rel): Ditto.
        (Arm_relocate_functions::movw_rel): Ditto.
        (Arm_relocate_functions::movt_rel): Ditto.
        (Arm_relocate_functions::movt_rel): Ditto.
        (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
        (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
        (Arm_relocate_functions:thm_movw_rel): Ditto.
        (Arm_relocate_functions:thm_movw_rel): Ditto.
        (Arm_relocate_functions:thm_movt_rel): Ditto.
        (Arm_relocate_functions:thm_movt_rel): Ditto.
        (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
        (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
        (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
        (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
        New method definitions.
        New method definitions.
        (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
        (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
        (Arm_relocation_functions::arm_grp_ldr): Ditto.
        (Arm_relocation_functions::arm_grp_ldr): Ditto.
        (Arm_relocation_functions::arm_grp_ldrs): Ditto.
        (Arm_relocation_functions::arm_grp_ldrs): Ditto.
        (Arm_relocation_functions::arm_grp_ldc): Ditto.
        (Arm_relocation_functions::arm_grp_ldc): Ditto.
        (Target_arm::Relocate::relocate): Check for non-static or
        (Target_arm::Relocate::relocate): Check for non-static or
        unimplemented relocation code and exit early.  Change calls to
        unimplemented relocation code and exit early.  Change calls to
        Target_arm::reloc_uses_thumb_bit and
        Target_arm::reloc_uses_thumb_bit and
        Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
        Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
        instead.  Refactor code to handle similar relocations to increase
        instead.  Refactor code to handle similar relocations to increase
        code sharing.  Remove check for unsupported relocation code in switch
        code sharing.  Remove check for unsupported relocation code in switch
        statement.
        statement.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
        relocation property table to find out size.  Change error message to
        relocation property table to find out size.  Change error message to
        print out the name of a relocation code instead of the numeric value.
        print out the name of a relocation code instead of the numeric value.
        (Target_arm::scan_reloc_for_stub): Use relocation property table
        (Target_arm::scan_reloc_for_stub): Use relocation property table
        instead of calling Target_arm::reloc_uses_thumb_bit().
        instead of calling Target_arm::reloc_uses_thumb_bit().
2010-02-02  Doug Kwan  
2010-02-02  Doug Kwan  
        * arm.cc (Target_arm::relocate_section): Do view adjustment for all
        * arm.cc (Target_arm::relocate_section): Do view adjustment for all
        types of relaxed input section.
        types of relaxed input section.
2010-02-02  Doug Kwan  
2010-02-02  Doug Kwan  
        * Makefile.am (HFILES): Add arm-reloc-property.h.
        * Makefile.am (HFILES): Add arm-reloc-property.h.
        (DEFFILES): New.
        (DEFFILES): New.
        (TARGETSOURCES): Add arm-reloc-property.cc
        (TARGETSOURCES): Add arm-reloc-property.cc
        (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
        (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
        (libgold_a_SOURCES): $(DEFFILES)
        (libgold_a_SOURCES): $(DEFFILES)
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * arm-reloc-property.cc: New file.
        * arm-reloc-property.cc: New file.
        * arm-reloc-property.h: New file.
        * arm-reloc-property.h: New file.
        * arm-reloc.def: New file.
        * arm-reloc.def: New file.
        * arm.cc: Update comments.
        * arm.cc: Update comments.
        (arm-reloc-property.h): New included header.
        (arm-reloc-property.h): New included header.
        (arm_reloc_property_table): New global variable.
        (arm_reloc_property_table): New global variable.
        (Target_arm::do_select_as_default_target): New method definition.
        (Target_arm::do_select_as_default_target): New method definition.
        * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
        * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
        arm-reloc-property to targ_extra_obj.
        arm-reloc-property to targ_extra_obj.
        * parameters.cc (set_parameters_target): Call
        * parameters.cc (set_parameters_target): Call
        Target::select_as_default_target().
        Target::select_as_default_target().
        * target.h (Target::select_as_default_target): New method definition.
        * target.h (Target::select_as_default_target): New method definition.
        (Target::do_select_as_default_target): Same.
        (Target::do_select_as_default_target): Same.
2010-02-01  Doug Kwan  
2010-02-01  Doug Kwan  
        * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
        * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
        first_output_text_section_.
        first_output_text_section_.
        (Arm_exidx_fixup::first_output_text_section): New method definition.
        (Arm_exidx_fixup::first_output_text_section): New method definition.
        (Arm_exidx_fixup::first_output_text_section_): New data member.
        (Arm_exidx_fixup::first_output_text_section_): New data member.
        (Arm_exidx_fixup::process_exidx_section): Record the first text
        (Arm_exidx_fixup::process_exidx_section): Record the first text
        output section seen.
        output section seen.
        (Arm_output_section::fix_exidx_coverage): Set correct linked section
        (Arm_output_section::fix_exidx_coverage): Set correct linked section
        and entsize in output section header.
        and entsize in output section header.
2010-01-29  Viktor Kutuzov  
2010-01-29  Viktor Kutuzov  
        * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
        * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
        R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
        R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
        (Arm_relocate_functions::thm_alu11): New Method.
        (Arm_relocate_functions::thm_alu11): New Method.
        (Arm_relocate_functions::thm_pc8): New Method.
        (Arm_relocate_functions::thm_pc8): New Method.
        (Arm_relocate_functions::thm_pc12): New Method.
        (Arm_relocate_functions::thm_pc12): New Method.
        (Target_arm::Scan::local): Handle the relocations.
        (Target_arm::Scan::local): Handle the relocations.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
        (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2010-01-29  Doug Kwan  
2010-01-29  Doug Kwan  
        * arm.cc (Target_arm::Scan::global): General PLTs for the same set
        * arm.cc (Target_arm::Scan::global): General PLTs for the same set
        of relocation types as ld.
        of relocation types as ld.
2010-01-29  Doug Kwan  
2010-01-29  Doug Kwan  
        * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
        * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
        to public.
        to public.
        (Arm_relocate_functions::thumb_branch_common): Ditto.
        (Arm_relocate_functions::thumb_branch_common): Ditto.
        (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
        (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
        Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
        Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
        Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
        Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
        Arm_relocate_functions::jump24): Remove.
        Arm_relocate_functions::jump24): Remove.
        (Target_arm::Relocate::relocate): Adjust code to call
        (Target_arm::Relocate::relocate): Adjust code to call
        Arm_relocation_functions::arm_branch_common and
        Arm_relocation_functions::arm_branch_common and
        Arm_relocation_functions::thumb_branch_common instead of their removed
        Arm_relocation_functions::thumb_branch_common instead of their removed
        wrappers.  Merge switch-cases together to reduce source code size.
        wrappers.  Merge switch-cases together to reduce source code size.
2010-01-29  Doug Kwan  
2010-01-29  Doug Kwan  
        * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
        * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
        output_local_symbol_count_needs_update_.
        output_local_symbol_count_needs_update_.
        (Arm_relobj::output_local_symbol_count_needs_update,
        (Arm_relobj::output_local_symbol_count_needs_update,
         Arm_relobj::set_output_local_symbol_count_needs_update,
         Arm_relobj::set_output_local_symbol_count_needs_update,
         Arm_relobj::update_output_local_symbol_count): New methods.
         Arm_relobj::update_output_local_symbol_count): New methods.
        (Arm_relobj::output_local_symbol_count_needs_update_): New data
        (Arm_relobj::output_local_symbol_count_needs_update_): New data
        member.
        member.
        (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
        (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
        of pointed function as in a R_ARM_PREL31 relocation.
        of pointed function as in a R_ARM_PREL31 relocation.
        (Arm_output_section::fix_exidx_coverage): Mark objects
        (Arm_output_section::fix_exidx_coverage): Mark objects
        for output local symbol count updating.
        for output local symbol count updating.
        (Target_arm::do_relax): Update output local symbol counts in objects
        (Target_arm::do_relax): Update output local symbol counts in objects
        if necessary.
        if necessary.
        * object.h (Sized_relobj::set_output_local_symbol_count): New method.
        * object.h (Sized_relobj::set_output_local_symbol_count): New method.
2010-01-29  Viktor Kutuzov  
2010-01-29  Viktor Kutuzov  
        * arm.cc: Added support for the ARM relocations:
        * arm.cc: Added support for the ARM relocations:
        R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
        R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
        R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
        R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
        (Arm_relocate_functions::movw_rel_nc): Renamed (was
        (Arm_relocate_functions::movw_rel_nc): Renamed (was
        movw_prel_nc).
        movw_prel_nc).
        (Arm_relocate_functions::movw_rel): New method.
        (Arm_relocate_functions::movw_rel): New method.
        (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
        (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
        (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
        (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
        thm_movw_prel_nc).
        thm_movw_prel_nc).
        (Arm_relocate_functions::thm_movw_rel): New method.
        (Arm_relocate_functions::thm_movw_rel): New method.
        (Arm_relocate_functions::thm_movt_rel): Renamed (was
        (Arm_relocate_functions::thm_movt_rel): Renamed (was
        thm_movt_prel).
        thm_movt_prel).
        (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
        (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
        relocations.
        relocations.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
2010-01-27  Viktor Kutuzov  
2010-01-27  Viktor Kutuzov  
        * arm.cc: Added support for ARM group relocations.
        * arm.cc: Added support for ARM group relocations.
        (Target_arm::reloc_needs_sym_origin): New method.
        (Target_arm::reloc_needs_sym_origin): New method.
        (Arm_relocate_functions::calc_grp_kn): New method.
        (Arm_relocate_functions::calc_grp_kn): New method.
        (Arm_relocate_functions::calc_grp_residual): New method.
        (Arm_relocate_functions::calc_grp_residual): New method.
        (Arm_relocate_functions::calc_grp_gn): New method.
        (Arm_relocate_functions::calc_grp_gn): New method.
        (Arm_relocate_functions::arm_grp_alu): New Method.
        (Arm_relocate_functions::arm_grp_alu): New Method.
        (Arm_relocate_functions::arm_grp_ldr): New Method.
        (Arm_relocate_functions::arm_grp_ldr): New Method.
        (Arm_relocate_functions::arm_grp_ldrs): New Method.
        (Arm_relocate_functions::arm_grp_ldrs): New Method.
        (Arm_relocate_functions::arm_grp_ldc): New Method.
        (Arm_relocate_functions::arm_grp_ldc): New Method.
        (Target_arm::Scan::local): Handle the ARM group relocations.
        (Target_arm::Scan::local): Handle the ARM group relocations.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
2010-01-26  Doug Kwan  
2010-01-26  Doug Kwan  
        * arm.cc (set): Include.
        * arm.cc (set): Include.
        (class Arm_exidx_fixup): Change type of last_input_section_ to const
        (class Arm_exidx_fixup): Change type of last_input_section_ to const
        pointer type.
        pointer type.
        (Arm_output_section::Text_section_list): New type.
        (Arm_output_section::Text_section_list): New type.
        (Arm_output_section::append_text_sections_to_list): New method.
        (Arm_output_section::append_text_sections_to_list): New method.
        (Arm_output_section::fix_exidx_coverage): Ditto.
        (Arm_output_section::fix_exidx_coverage): Ditto.
        (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
        (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
        (Arm_relobj::convert_input_section_to_relaxed_section): Use
        (Arm_relobj::convert_input_section_to_relaxed_section): Use
        Relobj::set_section_offset() instead of
        Relobj::set_section_offset() instead of
        Sized_relobj::invalidate_section_offset().
        Sized_relobj::invalidate_section_offset().
        (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
        (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
        parameter for section headers. Ignore relocation sections for
        parameter for section headers. Ignore relocation sections for
        unallocated sections and EXIDX sections.
        unallocated sections and EXIDX sections.
        (Target_arm::fix_exidx_coverage): New method.
        (Target_arm::fix_exidx_coverage): New method.
        (Target_arm::output_section_address_less_than): New type.
        (Target_arm::output_section_address_less_than): New type.
        (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
        (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
        linked text section instead of the EXIDX section.
        linked text section instead of the EXIDX section.
        (Arm_output_section::create_stub_group): Add an assertion to check
        (Arm_output_section::create_stub_group): Add an assertion to check
        that this is not an EXIDX output section.
        that this is not an EXIDX output section.
        (Arm_output_section::append_text_sections_to_list): New method.
        (Arm_output_section::append_text_sections_to_list): New method.
        (Arm_output_section::fix_exidx_coverage): Ditto.
        (Arm_output_section::fix_exidx_coverage): Ditto.
        (Arm_relobj::scan_sections_for_stubs): Adjust call to
        (Arm_relobj::scan_sections_for_stubs): Adjust call to
        Arm_relobj::section_needs_reloc_stub_scanning.
        Arm_relobj::section_needs_reloc_stub_scanning.
        (Target_arm::do_relax): Fix EXIDX output section coverage in the
        (Target_arm::do_relax): Fix EXIDX output section coverage in the
        first pass.
        first pass.
        (Target_arm::fix_exidx_coverage): New method.
        (Target_arm::fix_exidx_coverage): New method.
        * object.h (Relobj::set_output_section): New method.
        * object.h (Relobj::set_output_section): New method.
        (Sized_relobj::invalidate_section_offset): Remove method.
        (Sized_relobj::invalidate_section_offset): Remove method.
        (Sized_relobj::do_invalidate_section_offset): Remove method.
        (Sized_relobj::do_invalidate_section_offset): Remove method.
        (Sized_relobj::do_set_section_offset): Handle offset value -1.
        (Sized_relobj::do_set_section_offset): Handle offset value -1.
2010-01-25  Doug Kwan  
2010-01-25  Doug Kwan  
        * arm.cc (Arm_exidx_merged_section::do_output_offset):
        * arm.cc (Arm_exidx_merged_section::do_output_offset):
        Fix warning due to signed and unsigned comparison on a 32-bit host.
        Fix warning due to signed and unsigned comparison on a 32-bit host.
2010-01-22  Doug Kwan  
2010-01-22  Doug Kwan  
        * arm.cc (Target_arm::do_relax): Record an output section for section
        * arm.cc (Target_arm::do_relax): Record an output section for section
        offset adjustment it contains any stub table that has changed.
        offset adjustment it contains any stub table that has changed.
        * layout.cc (Layout::clean_up_after_relaxation): Adjust section
        * layout.cc (Layout::clean_up_after_relaxation): Adjust section
        offsets in an output section if necessary.
        offsets in an output section if necessary.
        * output.cc (Output_section::Output_section): Initialize
        * output.cc (Output_section::Output_section): Initialize
        section_offsets_need_adjustments_.
        section_offsets_need_adjustments_.
        (Output_section::add_input_section_for_script): Renamed to
        (Output_section::add_input_section_for_script): Renamed to
        Output_section::add_simple_input_section.
        Output_section::add_simple_input_section.
        (Output_section::save_states): Add a comment.
        (Output_section::save_states): Add a comment.
        (Output_section::discard_states): New method defintion.
        (Output_section::discard_states): New method defintion.
        (Output_section::adjust_section_offsets): Same.
        (Output_section::adjust_section_offsets): Same.
        * output.h (Output_section::add_input_section_for_script): Renamed to
        * output.h (Output_section::add_input_section_for_script): Renamed to
        Output_section::add_simple_input_section.
        Output_section::add_simple_input_section.
        (Output_section::discard_states): New method declaration.
        (Output_section::discard_states): New method declaration.
        (Output_section::adjust_section_offsets): Same.
        (Output_section::adjust_section_offsets): Same.
        (Output_section::section_offsets_need_adjustment,
        (Output_section::section_offsets_need_adjustment,
        Output_section::set_section_offsets_need_adjustment): New method
        Output_section::set_section_offsets_need_adjustment): New method
        definitions.
        definitions.
        (Output_section::section_offsets_need_adjustment_): New data member.
        (Output_section::section_offsets_need_adjustment_): New data member.
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_input::set_section_address): Adjust code for
        (Output_section_element_input::set_section_address): Adjust code for
        renaming of Output_section::add_input_section_for_script.
        renaming of Output_section::add_input_section_for_script.
        (Orphan_output_section::set_section_address): Same.
        (Orphan_output_section::set_section_address): Same.
2010-01-22  Viktor Kutuzov  
2010-01-22  Viktor Kutuzov  
        * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
        * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
        Fix_v4bx enum values .
        Fix_v4bx enum values .
        * gold/options.h (General_options): New option definitions.
        * gold/options.h (General_options): New option definitions.
        (General_options::fix_v4bx): New method.
        (General_options::fix_v4bx): New method.
        (General_options::Fix_v4bx): New enum.
        (General_options::Fix_v4bx): New enum.
        * gold/options.cc (General_options::parse_fix_v4bx): New method.
        * gold/options.cc (General_options::parse_fix_v4bx): New method.
        (General_options::parse_fix_v4bx_interworking): New method.
        (General_options::parse_fix_v4bx_interworking): New method.
2010-01-22  Doug Kwan  
2010-01-22  Doug Kwan  
        * arm.cc (Arm_exidx_fixup): New class.
        * arm.cc (Arm_exidx_fixup): New class.
2010-01-21  Doug Kwan  
2010-01-21  Doug Kwan  
        * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
        * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
        classes.
        classes.
        (Arm_exidx_section_offset_map): New type.
        (Arm_exidx_section_offset_map): New type.
2010-01-21  Doug Kwan  
2010-01-21  Doug Kwan  
        * arm.cc (Arm_exidx_input_section): New class.
        * arm.cc (Arm_exidx_input_section): New class.
        (Arm_relobj::exidx_input_section_by_link,
        (Arm_relobj::exidx_input_section_by_link,
        Arm_relobj::exidx_input_section_by_shndx,
        Arm_relobj::exidx_input_section_by_shndx,
        Arm_relobj::make_exidx_input_section): New methods.
        Arm_relobj::make_exidx_input_section): New methods.
        (read_arm_attributes_section): Remove.
        (read_arm_attributes_section): Remove.
        (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
        (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
        information about them.
        information about them.
        (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
        (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
        to here.
        to here.
2010-01-20  Doug Kwan  
2010-01-20  Doug Kwan  
        * arm.cc (Target_arm::Arm_input_section_map): Change key type from
        * arm.cc (Target_arm::Arm_input_section_map): Change key type from
        Input_section_specifier to Section_id.
        Input_section_specifier to Section_id.
        (Target_arm::new_arm_input_section: Adjust code for change of key
        (Target_arm::new_arm_input_section: Adjust code for change of key
        type.
        type.
        (Target_arm::find_arm_input_section): Ditto.
        (Target_arm::find_arm_input_section): Ditto.
        * gc.h (object.h): Include for Section_id nand Section_id_hash.
        * gc.h (object.h): Include for Section_id nand Section_id_hash.
        (Section_id): Remove.
        (Section_id): Remove.
        (Garbage_collection::Section_id_hash): Remove.
        (Garbage_collection::Section_id_hash): Remove.
        * icf.h (object.h): Include for Section_id nand Section_id_hash.
        * icf.h (object.h): Include for Section_id nand Section_id_hash.
        (Section_id): Remove.
        (Section_id): Remove.
        (Icf::Section_id_hash): Remove.
        (Icf::Section_id_hash): Remove.
        * object.h (Section_id, Const_section_id, Section_id_hash,
        * object.h (Section_id, Const_section_id, Section_id_hash,
        Const_section_id_hash): New type definitions.
        Const_section_id_hash): New type definitions.
        * output.cc (Output_section::add_relaxed_input_section): Change to
        * output.cc (Output_section::add_relaxed_input_section): Change to
        use Const_section_id instead of Input_section_specifier as key type.
        use Const_section_id instead of Input_section_specifier as key type.
        (Output_section::add_merge_input_section): Ditto.
        (Output_section::add_merge_input_section): Ditto.
        (Output_section::build_relaxation_map): Change to use Section_id
        (Output_section::build_relaxation_map): Change to use Section_id
        instead of Input_section_specifier as key type.
        instead of Input_section_specifier as key type.
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        Ditto.
        Ditto.
        (Output_section::convert_input_sections_to_relaxed_sections): Change
        (Output_section::convert_input_sections_to_relaxed_sections): Change
        to use Const_section_id instead of Input_section_specifier as key type.
        to use Const_section_id instead of Input_section_specifier as key type.
        (Output_section::find_merge_section): Ditto.
        (Output_section::find_merge_section): Ditto.
        (Output_section::find_relaxed_input_section): Ditto.
        (Output_section::find_relaxed_input_section): Ditto.
        * output.h (Input_section_specifier): Remove class.
        * output.h (Input_section_specifier): Remove class.
        (Output_section::Output_section_data_by_input_section_map): Change
        (Output_section::Output_section_data_by_input_section_map): Change
        key type to Const_section_id.
        key type to Const_section_id.
        (Output_section::Output_relaxed_input_section_by_input_section_map):
        (Output_section::Output_relaxed_input_section_by_input_section_map):
        Ditto.
        Ditto.
        (Output_section::Relaxation_map): Change key type to Section_id.
        (Output_section::Relaxation_map): Change key type to Section_id.
2010-01-20  Viktor Kutuzov  
2010-01-20  Viktor Kutuzov  
        * gold/arm.cc: Added support for R_ARM_V4BX relocation
        * gold/arm.cc: Added support for R_ARM_V4BX relocation
        (class Arm_v4bx_stub): New class.
        (class Arm_v4bx_stub): New class.
        (DEF_STUBS): Updated definition to support v4_veneer_bx.
        (DEF_STUBS): Updated definition to support v4_veneer_bx.
        (Stub_factory::make_arm_v4bx_stub): New method.
        (Stub_factory::make_arm_v4bx_stub): New method.
        (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
        (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
        (Stub_table::empty): Handle v4bx stubs.
        (Stub_table::empty): Handle v4bx stubs.
        (Stub_table::add_arm_v4bx_stub): New method.
        (Stub_table::add_arm_v4bx_stub): New method.
        (Stub_table::find_arm_v4bx_stub): New method.
        (Stub_table::find_arm_v4bx_stub): New method.
        (Arm_relocate_functions::v4bx): New method.
        (Arm_relocate_functions::v4bx): New method.
        (Target_arm::fix_v4bx): New method.
        (Target_arm::fix_v4bx): New method.
        (Target_arm::Target_arm): Handle R_ARM_V4BX.
        (Target_arm::Target_arm): Handle R_ARM_V4BX.
        (Stub_table::relocate_stubs): Likewise.
        (Stub_table::relocate_stubs): Likewise.
        (Stub_table::do_write): Likewise.
        (Stub_table::do_write): Likewise.
        (Stub_table::update_data_size_and_addralign): Likewise.
        (Stub_table::update_data_size_and_addralign): Likewise.
        (Stub_table::finalize_stubs):  Likewise.
        (Stub_table::finalize_stubs):  Likewise.
        (Target_arm::Scan::local): Likewise.
        (Target_arm::Scan::local): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::do_finalize_sections): Likewise.
        (Target_arm::do_finalize_sections): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
        (Target_arm::scan_reloc_for_stub): Likewise.
        (Target_arm::scan_reloc_for_stub): Likewise.
        (Target_arm::scan_reloc_section_for_stubs): Likewise.
        (Target_arm::scan_reloc_section_for_stubs): Likewise.
2010-01-19  Ian Lance Taylor  
2010-01-19  Ian Lance Taylor  
        * output.cc (Output_section_headers::do_sized_write): Write large
        * output.cc (Output_section_headers::do_sized_write): Write large
        segment count to sh_info field.
        segment count to sh_info field.
        (Output_file_header::do_sized_write): For large segment count,
        (Output_file_header::do_sized_write): For large segment count,
        write PN_XNUM to e_phnum field.
        write PN_XNUM to e_phnum field.
2010-01-15  Viktor Kutuzov  
2010-01-15  Viktor Kutuzov  
        * arm.cc (Arm_relocate_functions::thm_jump6): New function.
        * arm.cc (Arm_relocate_functions::thm_jump6): New function.
        (Arm_relocate_functions::thm_jump8): New function.
        (Arm_relocate_functions::thm_jump8): New function.
        (Arm_relocate_functions::thm_jump11): New function.
        (Arm_relocate_functions::thm_jump11): New function.
        (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
        (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
        R_ARM_THM_JUMP11.
        R_ARM_THM_JUMP11.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocate::relocate): Likewise.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
2010-01-14  Doug Kwan  
2010-01-14  Doug Kwan  
        * arm.cc (map, utility): Include headers.
        * arm.cc (map, utility): Include headers.
        (Target_arm::apply_cortex_a8_workaround): New method.
        (Target_arm::apply_cortex_a8_workaround): New method.
        (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
        (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
        (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
        (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
        (Target_arm::Scan::global): R_ARM_THM_JUMP19.
        (Target_arm::Scan::global): R_ARM_THM_JUMP19.
        (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
        (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
        the --[no-]fix-cortex-a8 command line options.
        the --[no-]fix-cortex-a8 command line options.
        (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
        (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
        (Target_arm::relocate_stub): Use addend in instruction template.
        (Target_arm::relocate_stub): Use addend in instruction template.
        * options.h (DEFINE_bool): Set the user-set flag.
        * options.h (DEFINE_bool): Set the user-set flag.
        (General_options): Add --[no-]-fix-cortex options.
        (General_options): Add --[no-]-fix-cortex options.
        * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
        * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
        : Update fast look-up map after conversion.
        : Update fast look-up map after conversion.
2010-01-14  Sriraman Tallam  
2010-01-14  Sriraman Tallam  
        * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
        * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
        in the first pass of do_layout.
        in the first pass of do_layout.
2010-01-13  Doug Kwan  
2010-01-13  Doug Kwan  
        * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
        * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
        Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
        Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
        apparent compiler problem of not folding static constant integral
        apparent compiler problem of not folding static constant integral
        data members of elfcpp::Elf_sizes<32>.
        data members of elfcpp::Elf_sizes<32>.
2010-01-13  Doug Kwan  
2010-01-13  Doug Kwan  
        * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
        * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
        Arm_relobj::section_needs_cortex_a8_stub_scanning,
        Arm_relobj::section_needs_cortex_a8_stub_scanning,
        Arm_relobj::scan_section_for_cortex_a8_erratum,
        Arm_relobj::scan_section_for_cortex_a8_erratum,
        Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
        Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
        (Arm_relobj::scan_sections_for_stubs): Move code deciding what
        (Arm_relobj::scan_sections_for_stubs): Move code deciding what
        sections to scan for relocation stubs into a new method
        sections to scan for relocation stubs into a new method
        Arm_relobj::section_needs_reloc_stub_scanning.  Handle both
        Arm_relobj::section_needs_reloc_stub_scanning.  Handle both
        relocation and Cortex-A8 stub scanning.
        relocation and Cortex-A8 stub scanning.
        (Target_arm::do_relax): Force stubs to be after stubbed sections
        (Target_arm::do_relax): Force stubs to be after stubbed sections
        if fixing the Cortex-A8 erratum.  Remove all Cortex-A8 stubs at
        if fixing the Cortex-A8 erratum.  Remove all Cortex-A8 stubs at
        the beginning of a new relaxation pass.  Update a comment.
        the beginning of a new relaxation pass.  Update a comment.
        (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
        (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
2010-01-12  Ian Lance Taylor  
2010-01-12  Ian Lance Taylor  
        * target-reloc.h (visibility_error): New inline function.
        * target-reloc.h (visibility_error): New inline function.
        (relocate_section): Call visibility_error.
        (relocate_section): Call visibility_error.
        * testsuite/Makefile.am (check_DATA): Add protected_3.err.
        * testsuite/Makefile.am (check_DATA): Add protected_3.err.
        (MOSTLYCLEANFILES): Likewise.
        (MOSTLYCLEANFILES): Likewise.
        (protected_4_pic.o, protected_3.err): New targets.
        (protected_4_pic.o, protected_3.err): New targets.
        * testsuite/protected_4.cc: New file.
        * testsuite/protected_4.cc: New file.
2010-01-12  Doug Kwan  
2010-01-12  Doug Kwan  
        * arm.cc (Cortex_a8_reloc): New class.
        * arm.cc (Cortex_a8_reloc): New class.
        (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
        (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
        and cortex_a8_relocs_info_.
        and cortex_a8_relocs_info_.
        (Target_arm::fix_cortex_a8): New method definition.
        (Target_arm::fix_cortex_a8): New method definition.
        (Target_arm::Cortex_a8_relocs_info): New type.
        (Target_arm::Cortex_a8_relocs_info): New type.
        (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
        (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
        New data member declarations.
        New data member declarations.
        (Target_arm::scan_reloc_for_stub): Record information about
        (Target_arm::scan_reloc_for_stub): Record information about
        relocations for THUMB branches that might be exempted from the
        relocations for THUMB branches that might be exempted from the
        Cortex-A8 workaround.
        Cortex-A8 workaround.
        (Target_arm::do_relax): Clear all Cortex-A8 relocation information
        (Target_arm::do_relax): Clear all Cortex-A8 relocation information
        at the beginning of a relaxation pass.
        at the beginning of a relaxation pass.
2010-01-12  Doug Kwan  
2010-01-12  Doug Kwan  
        * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
        * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
        (Arm_relobj::Mapping_symbol_position,
        (Arm_relobj::Mapping_symbol_position,
         Arm_reloj::Mapping_symbol_position_less,
         Arm_reloj::Mapping_symbol_position_less,
         Arm_relobj::Mapping_symbols_info): New types.
         Arm_relobj::Mapping_symbols_info): New types.
        (Target_arm::is_mapping_symbol_name): New method definition.
        (Target_arm::is_mapping_symbol_name): New method definition.
        (Arm_relobj::do_count_local_symbols): Save information about mapping
        (Arm_relobj::do_count_local_symbols): Save information about mapping
        symbols.
        symbols.
2010-01-11  Doug Kwan  
2010-01-11  Doug Kwan  
        * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
        * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
        Arm_relocate_functions::thumb32_branch_upper,
        Arm_relocate_functions::thumb32_branch_upper,
        Arm_relocate_functions::thumb32_branch_lower,
        Arm_relocate_functions::thumb32_branch_lower,
        Arm_relocate_functions::thumb32_cond_branch_offset,
        Arm_relocate_functions::thumb32_cond_branch_offset,
        Arm_relocate_functions::thumb32_cond_branch_upper,
        Arm_relocate_functions::thumb32_cond_branch_upper,
        Arm_relocate_functions::thumb32_cond_branch_lower,
        Arm_relocate_functions::thumb32_cond_branch_lower,
        Arm_relocate_functions::thm_jump19): New methods to handle THUMB
        Arm_relocate_functions::thm_jump19): New methods to handle THUMB
        branch offset encoding.
        branch offset encoding.
        (Arm_relocate_functions::thumb_branch_common): Use new branch
        (Arm_relocate_functions::thumb_branch_common): Use new branch
        offset encoding methods to avoid code duplication.
        offset encoding methods to avoid code duplication.
        (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
        (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
        (Stub_addend_reader::operator()): Use new branch encoding method
        (Stub_addend_reader::operator()): Use new branch encoding method
        to avoid code duplication.
        to avoid code duplication.
2010-01-11  Doug Kwan  
2010-01-11  Doug Kwan  
        * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
        * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
        (Target_arm::do_finalize_sections): Define special EXIDX section
        (Target_arm::do_finalize_sections): Define special EXIDX section
        symbols only if referenced.
        symbols only if referenced.
        * gc.h (Garbage_collection::add_reference): New method.
        * gc.h (Garbage_collection::add_reference): New method.
        (gc_process_relocs): Use Garbage_collection::add_reference to avoid
        (gc_process_relocs): Use Garbage_collection::add_reference to avoid
        code duplication.
        code duplication.
2010-01-11  Ian Lance Taylor  
2010-01-11  Ian Lance Taylor  
        * script.cc (Version_script_info::build_expression_list_lookup):
        * script.cc (Version_script_info::build_expression_list_lookup):
        Change complaing about duplicate wildcard match from error to
        Change complaing about duplicate wildcard match from error to
        warning.
        warning.
        * script.cc (class Lazy_demangler): Recreate--revert part of patch
        * script.cc (class Lazy_demangler): Recreate--revert part of patch
        of 2009-12-30.
        of 2009-12-30.
        (Version_script_info::Version_script_info): Initialize globs_,
        (Version_script_info::Version_script_info): Initialize globs_,
        default_version_, default_is_global_, and exact_.  Don't
        default_version_, default_is_global_, and exact_.  Don't
        initialize globals_ or locals_.
        initialize globals_ or locals_.
        (Version_script_info::build_lookup_tables): Build local symbols
        (Version_script_info::build_lookup_tables): Build local symbols
        first.
        first.
        (Version_script_info::unquote): New function.
        (Version_script_info::unquote): New function.
        (Version_script_info::add_exact_match): New function.
        (Version_script_info::add_exact_match): New function.
        (Version_script_info::build_expression_list_lookup): Remove lookup
        (Version_script_info::build_expression_list_lookup): Remove lookup
        parameter.  Add is_global parameter.  Change all callers.  Handle
        parameter.  Add is_global parameter.  Change all callers.  Handle
        wildcard pattern specially.  Unquote pattern.  Call
        wildcard pattern specially.  Unquote pattern.  Call
        add_exact_match.
        add_exact_match.
        (Version_script_info::get_name_to_match): New function.
        (Version_script_info::get_name_to_match): New function.
        (Version_script_info::get_symbol_version): New function.
        (Version_script_info::get_symbol_version): New function.
        (Version_script_info::get_symbol_version_helper): Remove.
        (Version_script_info::get_symbol_version_helper): Remove.
        (Version_script_info::check_unmatched_names): Call unquote.
        (Version_script_info::check_unmatched_names): Call unquote.
        * script.h (class Version_script_info): Change get_symbol_version
        * script.h (class Version_script_info): Change get_symbol_version
        to be non-inline and add is_global parameter; change all callers.
        to be non-inline and add is_global parameter; change all callers.
        Rewrite symbol_is_local.  Update declarations.  Define struct
        Rewrite symbol_is_local.  Update declarations.  Define struct
        Version_tree_match, Exact, Globs.  Don't define struct Lookup.
        Version_tree_match, Exact, Globs.  Don't define struct Lookup.
        Remove globals_ and locals_ members.  Add exact_, globs_,
        Remove globals_ and locals_ members.  Add exact_, globs_,
        default_version_, is_global_.
        default_version_, is_global_.
        (Version_script_info::Glob): Remove pattern, add expression and
        (Version_script_info::Glob): Remove pattern, add expression and
        is_global.  Update constructor.  Change all callers.
        is_global.  Update constructor.  Change all callers.
        * dynobj.cc (Versions::finalize): Mark the version symbol as the
        * dynobj.cc (Versions::finalize): Mark the version symbol as the
        default version.
        default version.
        (Versions::symbol_section_contents): If a symbol is undefined, or
        (Versions::symbol_section_contents): If a symbol is undefined, or
        defined in a dynamic object, set the version index to
        defined in a dynamic object, set the version index to
        VER_NDX_LOCAL.
        VER_NDX_LOCAL.
        * symtab.cc (Symbol_table::add_from_relobj): Don't call
        * symtab.cc (Symbol_table::add_from_relobj): Don't call
        symbol_is_local.
        symbol_is_local.
        (Symbol_table::add_from_pluginobj): Likewise.
        (Symbol_table::add_from_pluginobj): Likewise.
        * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
        * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
2010-01-11  Doug Kwan  
2010-01-11  Doug Kwan  
        * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
        * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
        (incremental_dump_LDADD): Add linking option for libintl.
        (incremental_dump_LDADD): Add linking option for libintl.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
2010-01-11  H.J. Lu  
2010-01-11  H.J. Lu  
        PR gold/11144
        PR gold/11144
        * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
        * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
        instead of -Ds.
        instead of -Ds.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
2010-01-10  Doug Kwan  
2010-01-10  Doug Kwan  
        * options.h (DEFINE_var): Use parentheses around argument varname__
        * options.h (DEFINE_var): Use parentheses around argument varname__
        in macro body to avoid any unintended subsequent substitutions.
        in macro body to avoid any unintended subsequent substitutions.
2010-01-10  Ian Lance Taylor  
2010-01-10  Ian Lance Taylor  
        * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
        * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
        candidates before doing symbol resolution.
        candidates before doing symbol resolution.
        * resolve.cc (Symbol_table::resolve): Add symbols to the list of
        * resolve.cc (Symbol_table::resolve): Add symbols to the list of
        ODR candidates if only one is weak.
        ODR candidates if only one is weak.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        * script.cc (Version_script_info::build_expression_list_lookup):
        * script.cc (Version_script_info::build_expression_list_lookup):
        Don't warn about ambiguous version, just record the ambiguity.
        Don't warn about ambiguous version, just record the ambiguity.
        (Version_script_info::get_symbol_version_helper): Give error if
        (Version_script_info::get_symbol_version_helper): Give error if
        version is ambiguous.
        version is ambiguous.
2010-01-08  Doug Kwan  
2010-01-08  Doug Kwan  
        * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
        * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
          prev_data_size_ and prev_addralign_.  Remove initializer for
          prev_data_size_ and prev_addralign_.  Remove initializer for
          deleted data member has_been_changed_.
          deleted data member has_been_changed_.
          (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
          (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
          to determine if the table is empty.
          to determine if the table is empty.
          (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
          (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
          Remove.
          Remove.
          (Stub_table::add_reloc_stub): Define method in class definition
          (Stub_table::add_reloc_stub): Define method in class definition
          instead of just declaring it there.
          instead of just declaring it there.
          (Stub_table::add_cortex_a8_stub): New method definition.
          (Stub_table::add_cortex_a8_stub): New method definition.
          (Stub_table::update_data_size_and_addralign): Ditto.
          (Stub_table::update_data_size_and_addralign): Ditto.
          (Stub_table::finalize_stubs): Ditto.
          (Stub_table::finalize_stubs): Ditto.
          (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
          (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
          (Stub_table::do_addralign_): Return address alignment in the
          (Stub_table::do_addralign_): Return address alignment in the
          (Stub_table::do_reset_address_and_file_offset): Define method in
          (Stub_table::do_reset_address_and_file_offset): Define method in
          class definition instead of declaring it there.  Set current data
          class definition instead of declaring it there.  Set current data
          size to be the data size of the previous pass.
          size to be the data size of the previous pass.
          (Stub_table::set_final_data_size): Use current data size as the
          (Stub_table::set_final_data_size): Use current data size as the
          final data size.
          final data size.
          (Stub_table::relocate_stub): Change parameter type of stub from
          (Stub_table::relocate_stub): Change parameter type of stub from
          Reloc_stub pointer to Stub pointer.
          Reloc_stub pointer to Stub pointer.
          (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
          (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
          (Stub_table::Cortex_a8_stub_list): New typedef.
          (Stub_table::Cortex_a8_stub_list): New typedef.
          (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
          (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
           Stub_table::prev_addralign_): New data member.
           Stub_table::prev_addralign_): New data member.
          (Arm_relobj::Arm_relobj): Initialize data member
          (Arm_relobj::Arm_relobj): Initialize data member
          section_has_cortex_a8_workaround_.
          section_has_cortex_a8_workaround_.
          (Arm_relobj::section_has_cortex_a8_workaround,
          (Arm_relobj::section_has_cortex_a8_workaround,
           Arm_relobj::mark_section_for_cortex_a8_workaround): New method
           Arm_relobj::mark_section_for_cortex_a8_workaround): New method
           definitions.
           definitions.
          (Arm_relobj::section_has_cortex_a8_workaround_): New data member
          (Arm_relobj::section_has_cortex_a8_workaround_): New data member
          declarations.
          declarations.
          (Target_arm::relocate_stub): Change parameter type of stub from
          (Target_arm::relocate_stub): Change parameter type of stub from
          Reloc_stub pointer to Stub pointer.
          Reloc_stub pointer to Stub pointer.
          (Insn_template::size, Insn_template::alignment): Handle
          (Insn_template::size, Insn_template::alignment): Handle
          THUMB16_SPECIAL_TYPE.
          THUMB16_SPECIAL_TYPE.
          (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
          (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
           Stub_table::update_data_size_and_addralign,
           Stub_table::update_data_size_and_addralign,
           Stub_table::apply_cortex_a8_workaround_to_address_range): New method
           Stub_table::apply_cortex_a8_workaround_to_address_range): New method
          definitions.
          definitions.
          (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
          (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
          (Stub_table::do_write): Ditto.
          (Stub_table::do_write): Ditto.
          (Target_arm::do_relax): Adjust code for changes in Stub_table.
          (Target_arm::do_relax): Adjust code for changes in Stub_table.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        PR 11108
        PR 11108
        * symtab.h (class Symbol): Remove fields is_target_special_ and
        * symtab.h (class Symbol): Remove fields is_target_special_ and
        has_plt_offset_.  Add field is_defined_in_discarded_section_.
        has_plt_offset_.  Add field is_defined_in_discarded_section_.
        (Symbol::is_defined_in_discarded_section): New function.
        (Symbol::is_defined_in_discarded_section): New function.
        (Symbol::set_is_defined_in_discarded_section): New function.
        (Symbol::set_is_defined_in_discarded_section): New function.
        (Symbol::has_plt_offset): Rewrite.
        (Symbol::has_plt_offset): Rewrite.
        (Symbol::set_plt_offset): Verify that new offset is not -1U.
        (Symbol::set_plt_offset): Verify that new offset is not -1U.
        * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
        * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
        Don't initialize is_target_special_ or has_plt_offset_.
        Don't initialize is_target_special_ or has_plt_offset_.
        Initialize is_defined_in_discarded_section_.
        Initialize is_defined_in_discarded_section_.
        (Symbol_table::add_from_relobj): If appropriate, set
        (Symbol_table::add_from_relobj): If appropriate, set
        is_defined_in_discarded_section.
        is_defined_in_discarded_section.
        * resolve.cc (Symbol::override_base_with_special): Don't test
        * resolve.cc (Symbol::override_base_with_special): Don't test
        is_target_special_.  Change has_plt_offset_ to has_plt_offset().
        is_target_special_.  Change has_plt_offset_ to has_plt_offset().
        * target-reloc.h (relocate_section): Do special handling for
        * target-reloc.h (relocate_section): Do special handling for
        symbols defined in discarded sections for global symbols as well
        symbols defined in discarded sections for global symbols as well
        as local symbols.
        as local symbols.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
        * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
        the SHT_SYMTAB case.
        the SHT_SYMTAB case.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        * object.cc (Sized_relobj::do_layout): Don't get confused if
        * object.cc (Sized_relobj::do_layout): Don't get confused if
        layout_eh_frame returns NULL.
        layout_eh_frame returns NULL.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        PR 11084
        PR 11084
        * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
        * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
        dynamic symbol table, use the normal symbol table.
        dynamic symbol table, use the normal symbol table.
        (Sized_dynobj::do_read_symbols): Remove assertion about type of
        (Sized_dynobj::do_read_symbols): Remove assertion about type of
        symbol table.
        symbol table.
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        PR 11072
        PR 11072
        * layout.cc (Layout::include_section): Remove .gnu_debuglink
        * layout.cc (Layout::include_section): Remove .gnu_debuglink
        sections.
        sections.
2010-01-08  H.J. Lu  
2010-01-08  H.J. Lu  
        * version.cc (print_version): Change to "Copyright 2010".
        * version.cc (print_version): Change to "Copyright 2010".
2010-01-08  Ian Lance Taylor  
2010-01-08  Ian Lance Taylor  
        PR 10287
        PR 10287
        PR 11063
        PR 11063
        * i386.cc (class Target_i386): Change return type of plt_section
        * i386.cc (class Target_i386): Change return type of plt_section
        to be non-const.
        to be non-const.
        (class Output_data_plt_i386): Add tls_desc_rel_ field.
        (class Output_data_plt_i386): Add tls_desc_rel_ field.
        (Output_data_plt_i386::Output_data_plt_i386): Initialize
        (Output_data_plt_i386::Output_data_plt_i386): Initialize
        tls_desc_rel_ field.
        tls_desc_rel_ field.
        (Output_data_plt_i386::rel_tls_desc): New function.
        (Output_data_plt_i386::rel_tls_desc): New function.
        (Target_i386::rel_tls_desc_section): New function.
        (Target_i386::rel_tls_desc_section): New function.
        (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
        (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
        (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
        (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
        R_386_TLS_DESC reloc in rel_tls_desc_section.
        R_386_TLS_DESC reloc in rel_tls_desc_section.
        * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
        * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
        Define struct Tlsdesc_info.
        Define struct Tlsdesc_info.
        (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
        (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
        (Target_x86_64::do_reloc_symbol_index): New function.
        (Target_x86_64::do_reloc_symbol_index): New function.
        (Target_x86_64::add_tlsdesc_info): New function.
        (Target_x86_64::add_tlsdesc_info): New function.
        (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
        (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
        tlsdesc_rel_ field.
        tlsdesc_rel_ field.
        (Output_data_plt_x86_64::rela_plt): Rename from rel_plt.  Change
        (Output_data_plt_x86_64::rela_plt): Rename from rel_plt.  Change
        all callers.
        all callers.
        (Output_data_plt_x86_64::rela_tlsdesc): New function.
        (Output_data_plt_x86_64::rela_tlsdesc): New function.
        (Target_x86_64::rela_tlsdesc_section): New function.
        (Target_x86_64::rela_tlsdesc_section): New function.
        (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
        (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
        handling.
        handling.
        (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
        (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
        (Target_x86_64::do_reloc_addend): New function.
        (Target_x86_64::do_reloc_addend): New function.
        R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
        R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
        * output.h (class Output_reloc) [SHT_REL]: Add new constructor
        * output.h (class Output_reloc) [SHT_REL]: Add new constructor
        declarations.  Define TARGET_CODE.  Add arg field to u1_ union.
        declarations.  Define TARGET_CODE.  Add arg field to u1_ union.
        (Output_reloc::type): New function.
        (Output_reloc::type): New function.
        (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
        (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
        (Output_reloc::is_target_specific): New function.
        (Output_reloc::is_target_specific): New function.
        (Output_reloc::target_arg): New function.
        (Output_reloc::target_arg): New function.
        (class Output_reloc) [SHT_RELA]: Add four new constructors for
        (class Output_reloc) [SHT_RELA]: Add four new constructors for
        absolute relocs and target specific relocs.
        absolute relocs and target specific relocs.
        (class Output_data_reloc) [SHT_REL]: Add add_absolute and
        (class Output_data_reloc) [SHT_REL]: Add add_absolute and
        add_target_specific.
        add_target_specific.
        (class Output_data_reloc) [SHT_RELA]: Likewise.
        (class Output_data_reloc) [SHT_RELA]: Likewise.
        * output.cc (Output_reloc::Output_reloc): Add four new versions
        * output.cc (Output_reloc::Output_reloc): Add four new versions
        for absolute relocs and target specific relocs.
        for absolute relocs and target specific relocs.
        (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
        (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
        (Output_reloc::get_symbol_index): Likewise.
        (Output_reloc::get_symbol_index): Likewise.
        (Output_reloc::local_section_offset): Check that local_sym_index_
        (Output_reloc::local_section_offset): Check that local_sym_index_
        is not TARGET_CODE or 0.
        is not TARGET_CODE or 0.
        (Output_reloc::symbol_value): Likewise.
        (Output_reloc::symbol_value): Likewise.
        (Output_reloc::write) [SHT_RELA]: Call target for target specific
        (Output_reloc::write) [SHT_RELA]: Call target for target specific
        reloc.
        reloc.
        * target.h (class Target): Add reloc_symbol_index and reloc_addend
        * target.h (class Target): Add reloc_symbol_index and reloc_addend
        functions.  Add do_reloc_symbol_index and do_reloc_addend virtual
        functions.  Add do_reloc_symbol_index and do_reloc_addend virtual
        functions.
        functions.
        * layout.cc (add_target_dynamic_tags): Use output section for
        * layout.cc (add_target_dynamic_tags): Use output section for
        DT_PLTRELSZ and DT_JMPREL.
        DT_PLTRELSZ and DT_JMPREL.
2010-01-07  Ian Lance Taylor  
2010-01-07  Ian Lance Taylor  
        PR 11061
        PR 11061
        * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
        * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
        function.
        function.
        (class Output_data_reloc_generic): Define.
        (class Output_data_reloc_generic): Define.
        (class Output_data_reloc_base): Change base class to
        (class Output_data_reloc_base): Change base class to
        Output_data_reloc_generic.  Change add() method to call
        Output_data_reloc_generic.  Change add() method to call
        bump_relative_reloc_count for a relative reloc.  Remove
        bump_relative_reloc_count for a relative reloc.  Remove
        sort_relocs_ field.
        sort_relocs_ field.
        * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
        * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
        to sort_relocs().
        to sort_relocs().
        * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
        * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
        Output_data_reloc_generic*.  Add DT_RELCOUNT/DT_RELACOUNT tag if
        Output_data_reloc_generic*.  Add DT_RELCOUNT/DT_RELACOUNT tag if
        appropriate.
        appropriate.
        * layout.h (class Layout): Update declaration.
        * layout.h (class Layout): Update declaration.
2010-01-07  Ian Lance Taylor  
2010-01-07  Ian Lance Taylor  
        * output.h (class Output_data): Add const version of
        * output.h (class Output_data): Add const version of
        output_section and do_output_section.
        output_section and do_output_section.
        (class Output_section_data): Add const version of
        (class Output_section_data): Add const version of
        do_output_section.
        do_output_section.
        (class Output_section): Likewise.
        (class Output_section): Likewise.
        * layout.cc (Layout::add_target_dynamic_tags): New function.
        * layout.cc (Layout::add_target_dynamic_tags): New function.
        * layout.h (class Layout): Update declarations.
        * layout.h (class Layout): Update declarations.
        * arm.cc (Target_arm::do_finalize_sections): Use
        * arm.cc (Target_arm::do_finalize_sections): Use
        add_target_dynamic_tags.
        add_target_dynamic_tags.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
        * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
        * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2010-01-07  Ian Lance Taylor  
2010-01-07  Ian Lance Taylor  
        PR 11042
        PR 11042
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
        object as needed.
        object as needed.
2010-01-07  Dmitry Gorbachev  
2010-01-07  Dmitry Gorbachev  
            Ian Lance Taylor  
            Ian Lance Taylor  
        PR 11019
        PR 11019
        * object.cc: Instantiate Xindex::initialize_symtab_xindex and
        * object.cc: Instantiate Xindex::initialize_symtab_xindex and
        Xindex::read_symtab_xindex.
        Xindex::read_symtab_xindex.
2010-01-07  Doug Kwan  
2010-01-07  Doug Kwan  
        * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
        * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
        (Insn_template::thumb16_bcond_insn): New method declaration.
        (Insn_template::thumb16_bcond_insn): New method declaration.
        (Insn_template): Fix spelling.
        (Insn_template): Fix spelling.
        (Stub::thumb16_special): New method declaration.
        (Stub::thumb16_special): New method declaration.
        (Stub::do_write): Define virtual method which was previously pure
        (Stub::do_write): Define virtual method which was previously pure
        virtual.
        virtual.
        (Stub::do_thumb16_special): New method declaration.
        (Stub::do_thumb16_special): New method declaration.
        (Stub::do_fixed_endian_write): New template member.
        (Stub::do_fixed_endian_write): New template member.
        (Reloc_stub::do_write): Remove.
        (Reloc_stub::do_write): Remove.
        (Reloc_stub::do_fixed_endian_write): Remove.
        (Reloc_stub::do_fixed_endian_write): Remove.
        (Cortex_a8_stub): New class definition.
        (Cortex_a8_stub): New class definition.
        (Stub_factory::make_cortex_a8_stub): New method definition.
        (Stub_factory::make_cortex_a8_stub): New method definition.
        (Stub_factory::Stub_factory): Add missing static storage class
        (Stub_factory::Stub_factory): Add missing static storage class
        qualifier for elf32_arm_stub_a8_veneer_blx.
        qualifier for elf32_arm_stub_a8_veneer_blx.
2010-01-07  Ian Lance Taylor  
2010-01-07  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.h (class General_options): Add --warn-unresolved-symbols
        * options.h (class General_options): Add --warn-unresolved-symbols
        and --error-unresolved-symbols.
        and --error-unresolved-symbols.
        * errors.cc (Errors::undefined_symbol): Implement
        * errors.cc (Errors::undefined_symbol): Implement
        --warn-unresolved-symbols.
        --warn-unresolved-symbols.
        * options.h (class General_options): Add -z text and -z textoff.
        * options.h (class General_options): Add -z text and -z textoff.
        * layout.cc (Layout::finish_dynamic_section): Implement -z text.
        * layout.cc (Layout::finish_dynamic_section): Implement -z text.
2010-01-06  Sriraman Tallam  
2010-01-06  Sriraman Tallam  
        * gc.h (Garbage_collection::Cident_section_map): New typedef.
        * gc.h (Garbage_collection::Cident_section_map): New typedef.
        (Garbage_collection::cident_sections): New function.
        (Garbage_collection::cident_sections): New function.
        (Garbage_collection::add_cident_section): New function.
        (Garbage_collection::add_cident_section): New function.
        (Garbage_collection::cident_sections_): New member.
        (Garbage_collection::cident_sections_): New member.
        (gc_process_relocs): Add references to sections whose names are C
        (gc_process_relocs): Add references to sections whose names are C
        identifiers.
        identifiers.
        * gold.h (cident_section_start_prefix): New constant.
        * gold.h (cident_section_start_prefix): New constant.
        (cident_section_stop_prefix): New constant.
        (cident_section_stop_prefix): New constant.
        (is_cident): New function.
        (is_cident): New function.
        * layout.cc (Layout::define_section_symbols): Replace string constants
        * layout.cc (Layout::define_section_symbols): Replace string constants
        with the newly defined constants.
        with the newly defined constants.
        * object.cc (Sized_relobj::do_layout): Track sections whose names are
        * object.cc (Sized_relobj::do_layout): Track sections whose names are
        C identifiers.
        C identifiers.
        * testsuite/Makefile.am: Add gc_orphan_section_test.
        * testsuite/Makefile.am: Add gc_orphan_section_test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/gc_orphan_section_test.cc: New file.
        * testsuite/gc_orphan_section_test.cc: New file.
        * testsuite/gc_orphan_section_test.sh: New file.
        * testsuite/gc_orphan_section_test.sh: New file.
2010-01-06  Ian Lance Taylor  
2010-01-06  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.h (class General_options): Add --warn-shared-textrel.
        * options.h (class General_options): Add --warn-shared-textrel.
        * layout.cc (Layout::finish_dynamic_section): Implement
        * layout.cc (Layout::finish_dynamic_section): Implement
        --warn-shared-textrel.
        --warn-shared-textrel.
        PR 10980
        PR 10980
        * options.h (class General_options): Add --warn-multiple-gp.
        * options.h (class General_options): Add --warn-multiple-gp.
2010-01-06  Viktor Kutuzov  
2010-01-06  Viktor Kutuzov  
        * Makefile.am (incremental_dump_DEPENDENCIES): Remove
        * Makefile.am (incremental_dump_DEPENDENCIES): Remove
        $(THREADSLIB) and $(LIBDL).
        $(THREADSLIB) and $(LIBDL).
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2010-01-06  Ian Lance Taylor  
2010-01-06  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.cc (General_options::parse_section_start): New function.
        * options.cc (General_options::parse_section_start): New function.
        (General_options::section_start): New function.
        (General_options::section_start): New function.
        (General_options::General_options): Initialize all members.
        (General_options::General_options): Initialize all members.
        * options.h: Include 
        * options.h: Include 
        (class General_options): Add --section-start.  Add section_starts_
        (class General_options): Add --section-start.  Add section_starts_
        member.
        member.
        * layout.cc (Layout::attach_allocated_section_to_segment): If
        * layout.cc (Layout::attach_allocated_section_to_segment): If
        --section-start was used, set the address of the segment.  Remove
        --section-start was used, set the address of the segment.  Remove
        local sort_sections.
        local sort_sections.
        (Layout::relaxation_loop_body): If the address of the load segment
        (Layout::relaxation_loop_body): If the address of the load segment
        has been set by --section-start, don't use it.
        has been set by --section-start, don't use it.
        * output.h (Output_segment::update_flags_for_output_section): New
        * output.h (Output_segment::update_flags_for_output_section): New
        function.
        function.
        * output.cc (Output_segment::add_output_section): Call
        * output.cc (Output_segment::add_output_section): Call
        update_flags_for_output_section.
        update_flags_for_output_section.
2010-01-05  Ian Lance Taylor  
2010-01-05  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.h (class General_options): Add --undefined-version.
        * options.h (class General_options): Add --undefined-version.
        * script.cc (struct Version_expression): Add was_matched_by_symbol
        * script.cc (struct Version_expression): Add was_matched_by_symbol
        field.
        field.
        (Version_script_info::matched_symbol): New function.
        (Version_script_info::matched_symbol): New function.
        (Version_script_info::get_symbol_version_helper): Call
        (Version_script_info::get_symbol_version_helper): Call
        matched_symbol.
        matched_symbol.
        (Version_script_info::check_unmatched_names): New function.
        (Version_script_info::check_unmatched_names): New function.
        * script.h (class Version_script_info): Update declarations.
        * script.h (class Version_script_info): Update declarations.
        * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
        * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
        * options.h (class General_options): Use DEFINE_bool_alias for
        * options.h (class General_options): Use DEFINE_bool_alias for
        allow_multiple_definition.
        allow_multiple_definition.
        * resolve.cc (Symbol_table::should_override): Don't test
        * resolve.cc (Symbol_table::should_override): Don't test
        allow_multiple_definition.
        allow_multiple_definition.
        PR 10980
        PR 10980
        * options.h (class General_options): Add --cref.
        * options.h (class General_options): Add --cref.
        * main.cc (main): Print cref table if --cref.  Don't close mapfile
        * main.cc (main): Print cref table if --cref.  Don't close mapfile
        until after printing cref table.
        until after printing cref table.
        * cref.cc: Include "symtab.h".
        * cref.cc: Include "symtab.h".
        (class Cref_inputs): Define Cref_table_compare and Cref_table.
        (class Cref_inputs): Define Cref_table_compare and Cref_table.
        (Cref_table_compare::operator()): New function.
        (Cref_table_compare::operator()): New function.
        (Cref_inputs::gather_cref): New function.
        (Cref_inputs::gather_cref): New function.
        (filecol): New static const.
        (filecol): New static const.
        (Cref_inputs::print_cref): New function.
        (Cref_inputs::print_cref): New function.
        (Cref::print_cref): New function.
        (Cref::print_cref): New function.
        * cref.h: Include .
        * cref.h: Include .
        (class Cref): Update declarations.
        (class Cref): Update declarations.
        * mapfile.h (Mapfile::file): New function.
        * mapfile.h (Mapfile::file): New function.
        * object.h (class Object): Define Symbols.  Declare virtual
        * object.h (class Object): Define Symbols.  Declare virtual
        do_get_global_symbols.
        do_get_global_symbols.
        (Object::get_global_symbols): New function.
        (Object::get_global_symbols): New function.
        * object.cc (Input_objects::add_object): Pass object to cref_ if
        * object.cc (Input_objects::add_object): Pass object to cref_ if
        --cref.
        --cref.
        (Input_objects::archive_start): Likewise.
        (Input_objects::archive_start): Likewise.
        (Input_objects::archive_stop): Likewise.
        (Input_objects::archive_stop): Likewise.
        (Input_objects::print_cref): New function.
        (Input_objects::print_cref): New function.
        * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
        * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
        * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
        * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
        --cref.
        --cref.
        * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
        * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
        function.
        function.
        * plugin.h (class Sized_pluginobj): Update declarations.
        * plugin.h (class Sized_pluginobj): Update declarations.
2010-01-05  Ian Lance Taylor  
2010-01-05  Ian Lance Taylor  
        * symtab.cc (Symbol_table::add_from_object): Rename def parameter
        * symtab.cc (Symbol_table::add_from_object): Rename def parameter
        to is_default_version.  Rename insdef to insdefault.
        to is_default_version.  Rename insdef to insdefault.
        (Symbol_table::add_from_relobj): Rename def to is_default_version
        (Symbol_table::add_from_relobj): Rename def to is_default_version
        and local to is_forced_local.
        and local to is_forced_local.
        (Symbol_table::add_from_pluginobj): Likewise.
        (Symbol_table::add_from_pluginobj): Likewise.
        (Symbol_table::add_from_dynobj): Likewise.
        (Symbol_table::add_from_dynobj): Likewise.
        (Symbol_table::define_special_symbol): Rename insdef to
        (Symbol_table::define_special_symbol): Rename insdef to
        insdefault.
        insdefault.
2010-01-04  Ian Lance Taylor  
2010-01-04  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.h (class General_options): Add
        * options.h (class General_options): Add
        --allow-multiple-definition and -z muldefs.
        --allow-multiple-definition and -z muldefs.
        * resolve.cc (Symbol_table::should_override): Don't warn about a
        * resolve.cc (Symbol_table::should_override): Don't warn about a
        multiple symbol definition if --allow-multiple-definition or -z
        multiple symbol definition if --allow-multiple-definition or -z
        muldefs.
        muldefs.
        PR 10980
        PR 10980
        * options.h (class General_options): Add --add-needed and
        * options.h (class General_options): Add --add-needed and
        --copy-dt-needed-entries.  Tweak --as-needed help entry.
        --copy-dt-needed-entries.  Tweak --as-needed help entry.
        * object.cc (Input_objects::check_dynamic_dependencies): Give an
        * object.cc (Input_objects::check_dynamic_dependencies): Give an
        error if --copy-dt-needed-entries aka --add-needed is used and
        error if --copy-dt-needed-entries aka --add-needed is used and
        would cause a change in behaviour.
        would cause a change in behaviour.
        PR 10980
        PR 10980
        * options.h (class General_options): Add -G as a short version of
        * options.h (class General_options): Add -G as a short version of
        --shared.  Add no-op options -assert, -g, and -i.
        --shared.  Add no-op options -assert, -g, and -i.
2010-01-04  Sriraman Tallam  
2010-01-04  Sriraman Tallam  
        * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
        * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
        check for .text or .gnu.linkonce.t sections.
        check for .text or .gnu.linkonce.t sections.
        * icf.cc (Icf::find_identical_sections): Ditto.
        * icf.cc (Icf::find_identical_sections): Ditto.
        Change the detection for mangled function name within the section
        Change the detection for mangled function name within the section
        name.
        name.
        * icf.h (is_section_foldable_candidate): New function.
        * icf.h (is_section_foldable_candidate): New function.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10980
        PR 10980
        * options.h (class General_options): Permit two dashes with
        * options.h (class General_options): Permit two dashes with
        --retain-symbols-file.
        --retain-symbols-file.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10979
        PR 10979
        * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
        * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
        don't put the file header and segment headers in the text
        don't put the file header and segment headers in the text
        segment.
        segment.
        PR 10979
        PR 10979
        * common.cc (Sort_commons::operator()): Stabilize sort when both
        * common.cc (Sort_commons::operator()): Stabilize sort when both
        entries are NULL.
        entries are NULL.
        (Symbol_table::do_allocate_commons_list): When allocating common
        (Symbol_table::do_allocate_commons_list): When allocating common
        symbols, skip a symbol which is no longer common.
        symbols, skip a symbol which is no longer common.
        * symtab.h (Symbol::is_common): Test whether the symbol comes from
        * symtab.h (Symbol::is_common): Test whether the symbol comes from
        an object before checking its type.
        an object before checking its type.
        * testsuite/common_test_2.c: New file.
        * testsuite/common_test_2.c: New file.
        * testsuite/common_test_3.c: New file.
        * testsuite/common_test_3.c: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
        * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
        (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
        (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
        (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
        (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
        (common_test_2_pic.o, common_test_2.so): New targets.
        (common_test_2_pic.o, common_test_2.so): New targets.
        (common_test_3_pic.o, common_test_3.so): New targets.
        (common_test_3_pic.o, common_test_3.so): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        PR 10979
        PR 10979
        * script.cc (read_input_script): If we see a new SECTIONS clause,
        * script.cc (read_input_script): If we see a new SECTIONS clause,
        and we have added an input section, give an error.
        and we have added an input section, give an error.
        * layout.h (class Layout): Add have_added_input_section function.
        * layout.h (class Layout): Add have_added_input_section function.
        Add have_added_input_section_ field.
        Add have_added_input_section_ field.
        * layout.cc (Layout::Layout): Initialize
        * layout.cc (Layout::Layout): Initialize
        have_added_input_section_.
        have_added_input_section_.
        (Layout::layout): Set have_added_input_section_.
        (Layout::layout): Set have_added_input_section_.
        (Layout::layout_eh_frame): Likewise.
        (Layout::layout_eh_frame): Likewise.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10931
        PR 10931
        * options.h (class General_options): Add --sort-common option.
        * options.h (class General_options): Add --sort-common option.
        * symtab.h (class Symbol_table): Define Sort_commons_order enum.
        * symtab.h (class Symbol_table): Define Sort_commons_order enum.
        * common.cc (Sort_common): Add sort_order parameter to
        * common.cc (Sort_common): Add sort_order parameter to
        constructor.  Add sort_order_ field.
        constructor.  Add sort_order_ field.
        (Sort_commons::operator): Check sort_order_.
        (Sort_commons::operator): Check sort_order_.
        (Symbol_table::allocate_commons): Determine the sort order.
        (Symbol_table::allocate_commons): Determine the sort order.
        (Symbol_table::do_allocate_commons): Add sort_order parameter.
        (Symbol_table::do_allocate_commons): Add sort_order parameter.
        Change all callers.
        Change all callers.
        (Symbol_table::do_allocate_commons_list): Likewise.
        (Symbol_table::do_allocate_commons_list): Likewise.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10916
        PR 10916
        * symtab.cc (Symbol_table::add_from_relobj): When not exporting
        * symtab.cc (Symbol_table::add_from_relobj): When not exporting
        symbols from this object, don't change the visibility of an
        symbols from this object, don't change the visibility of an
        undefined symbol.
        undefined symbol.
        * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
        * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10861
        PR 10861
        * script.h (class Version_script_info): Define Language enum.
        * script.h (class Version_script_info): Define Language enum.
        Update declarations.  Define Glob, Exact, and Lookup types.  Add
        Update declarations.  Define Glob, Exact, and Lookup types.  Add
        new fields globals_, locals_, and is_finalized_.
        new fields globals_, locals_, and is_finalized_.
        * script.cc: Various formatting fixes.
        * script.cc: Various formatting fixes.
        (class Parser_closure): Change language_stack_ from a vector of
        (class Parser_closure): Change language_stack_ from a vector of
        std::string to one of Version_script_info::Language.  Adjust all
        std::string to one of Version_script_info::Language.  Adjust all
        uses accordingly.
        uses accordingly.
        (class Lazy_demangler): Remove.
        (class Lazy_demangler): Remove.
        (struct Version_expression): Change language from std::string to
        (struct Version_expression): Change language from std::string to
        Version_script_info::Language.
        Version_script_info::Language.
        (Version_script_info::Version_script_info): New function.
        (Version_script_info::Version_script_info): New function.
        (Version_script_info::~Version_script_info): Don't call clear.
        (Version_script_info::~Version_script_info): Don't call clear.
        (Version_script_info::finalize): New function.
        (Version_script_info::finalize): New function.
        (Version_script_info::build_lookup_tables): New function.
        (Version_script_info::build_lookup_tables): New function.
        (Version_script_info::build_expression_list_lookup): New
        (Version_script_info::build_expression_list_lookup): New
        function.
        function.
        (Version_script_info::get_symbol_version_helper): Rewrite to use
        (Version_script_info::get_symbol_version_helper): Rewrite to use
        lookup tables.
        lookup tables.
        (Version_script_info::print_expression_list): Adjust to use
        (Version_script_info::print_expression_list): Adjust to use
        Version_script_info::Language.
        Version_script_info::Language.
        (script_push_lex_into_version_mode): Check that the version script
        (script_push_lex_into_version_mode): Check that the version script
        has not been finalized.
        has not been finalized.
        (version_script_push_lang): Change language string to
        (version_script_push_lang): Change language string to
        Version_script_info::Language.
        Version_script_info::Language.
        * options.cc (Command_line::version_script): New function.
        * options.cc (Command_line::version_script): New function.
        * options.h (class General_options): Add finalize_dynamic_list
        * options.h (class General_options): Add finalize_dynamic_list
        function.  Change version_script from declaration to definition.
        function.  Change version_script from declaration to definition.
        * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
        * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
        * testsuite/version_script.map: Remove duplicate def of foo.
        * testsuite/version_script.map: Remove duplicate def of foo.
        * testsuite/Makefile.am (ver_matching_def.so): Depend upon
        * testsuite/Makefile.am (ver_matching_def.so): Depend upon
        version_script.map.
        version_script.map.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10843
        PR 10843
        * target-reloc.h (relocate_for_relocatable): When copying a reloc,
        * target-reloc.h (relocate_for_relocatable): When copying a reloc,
        if the input symbol index is 0, make the output symbol index 0.
        if the input symbol index is 0, make the output symbol index 0.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10670
        PR 10670
        * options.h (class General_options): Add -x/--discard-all.
        * options.h (class General_options): Add -x/--discard-all.
        * object.cc (Sized_relobj::do_count_local_symbols): Handle
        * object.cc (Sized_relobj::do_count_local_symbols): Handle
        --discard-all.  If the local symbol needs a dynamic entry, check
        --discard-all.  If the local symbol needs a dynamic entry, check
        that before handling --discard-locals.
        that before handling --discard-locals.
2009-12-30  Ian Lance Taylor  
2009-12-30  Ian Lance Taylor  
        PR 10450
        PR 10450
        * output.cc (Output_segment::Output_segment): If PT_TLS, set the
        * output.cc (Output_segment::Output_segment): If PT_TLS, set the
        flags to PF_R.
        flags to PF_R.
        (Output_segment::add_output_section): Don't change the flags if
        (Output_segment::add_output_section): Don't change the flags if
        the type is PT_TLS.
        the type is PT_TLS.
        PR 10450
        PR 10450
        * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
        * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
        GNU hash table if they need a dynamic value.  Otherwise, don't add
        GNU hash table if they need a dynamic value.  Otherwise, don't add
        them if they are defined in a dynamic object or are forced local.
        them if they are defined in a dynamic object or are forced local.
2009-12-29  Ian Lance Taylor  
2009-12-29  Ian Lance Taylor  
        PR 10450
        PR 10450
        * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
        * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
        .gnu.hash table for a 32-bit target.
        .gnu.hash table for a 32-bit target.
        PR 10450
        PR 10450
        * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
        * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
        regular and a dynamic object only needs a dynamic symbol table
        regular and a dynamic object only needs a dynamic symbol table
        entry if it is externally visible.
        entry if it is externally visible.
        PR 10450
        PR 10450
        * i386.cc (class Target_i386): Initialize global_offset_table_ in
        * i386.cc (class Target_i386): Initialize global_offset_table_ in
        constructor.  Add global_offset_table_ field.
        constructor.  Add global_offset_table_ field.
        (Target_i386::got_section): Set global_offset_table_.
        (Target_i386::got_section): Set global_offset_table_.
        (Target_i386::do_finalize_sections): Set global_offset_table_
        (Target_i386::do_finalize_sections): Set global_offset_table_
        size.
        size.
        * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
        * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
        in constructor.  Add global_offset_table_ field.
        in constructor.  Add global_offset_table_ field.
        (Target_x86_64::got_section): Set global_offset_table_.
        (Target_x86_64::got_section): Set global_offset_table_.
        (Target_x86_64::do_finalize_sections): Set global_offset_table_
        (Target_x86_64::do_finalize_sections): Set global_offset_table_
        size.
        size.
        * layout.cc (Layout::Layout): Initialize increase_relro_.
        * layout.cc (Layout::Layout): Initialize increase_relro_.
        (Layout::get_output_section): Add is_relro, is_last_relro, and
        (Layout::get_output_section): Add is_relro, is_last_relro, and
        is_first_non_relro parameters.  Change all callers.
        is_first_non_relro parameters.  Change all callers.
        (Layout::choose_output_section): Likewise.
        (Layout::choose_output_section): Likewise.
        (Layout::add_output_section_data): Likewise.
        (Layout::add_output_section_data): Likewise.
        (Layout::make_output_section): Likewise.
        (Layout::make_output_section): Likewise.
        (Layout::set_segment_offsets): Clear increase_relro when using a
        (Layout::set_segment_offsets): Clear increase_relro when using a
        linker script.
        linker script.
        * layout.h (class Layout): Add increase_relro method.  Add
        * layout.h (class Layout): Add increase_relro method.  Add
        increase_relro_ field.  Update declarations.
        increase_relro_ field.  Update declarations.
        * output.cc (Output_section::Output_section): Initialize
        * output.cc (Output_section::Output_section): Initialize
        is_last_relro_ and is_first_non_relro_.
        is_last_relro_ and is_first_non_relro_.
        (Output_segment::add_output_section): Group relro sections is
        (Output_segment::add_output_section): Group relro sections is
        do_sort is true.  Handle is_last_relro and is_first_non_relro.
        do_sort is true.  Handle is_last_relro and is_first_non_relro.
        (Output_segment::maximum_alignment): Remove relro handling.
        (Output_segment::maximum_alignment): Remove relro handling.
        (Output_segment::set_section_addresses): Add increase_relro
        (Output_segment::set_section_addresses): Add increase_relro
        parameter.  Change all callers.  Add initial alignment to align
        parameter.  Change all callers.  Add initial alignment to align
        relro sections on separate page.  Remove old relro handling.
        relro sections on separate page.  Remove old relro handling.
        (Output_segment::set_section_list_addresses): Remove in_relro
        (Output_segment::set_section_list_addresses): Remove in_relro
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Output_segment::set_offset): Add increase parameter.  Change all
        (Output_segment::set_offset): Add increase parameter.  Change all
        callers.  Remove old relro handling.
        callers.  Remove old relro handling.
        * output.h (class Output_section): Add new methods: is_last_relro,
        * output.h (class Output_section): Add new methods: is_last_relro,
        set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
        set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
        Add is_last_relro_ and is_first_non_relro_ fields.
        Add is_last_relro_ and is_first_non_relro_ fields.
        * i386.cc (Target_i386::got_section): Don't call set_is_relro.
        * i386.cc (Target_i386::got_section): Don't call set_is_relro.
        Create separate .got.plt section.  Call increase_relro.
        Create separate .got.plt section.  Call increase_relro.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * testsuite/relro_script_test.t: Add .got.plt.
        * testsuite/relro_script_test.t: Add .got.plt.
        PR 10450
        PR 10450
        * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
        * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
        (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
        (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
        (Layout::finalize): Call set_dynamic_symbol_size.
        (Layout::finalize): Call set_dynamic_symbol_size.
        (Layout::set_dynamic_symbol_size): New function.
        (Layout::set_dynamic_symbol_size): New function.
        * layout.h (class Layout): Add dynamic_symbol_ field.  Declare
        * layout.h (class Layout): Add dynamic_symbol_ field.  Declare
        set_dynamic_symbol_size.
        set_dynamic_symbol_size.
        PR 10450
        PR 10450
        * output.h (class Output_section): Add is_entsize_zero_ field.
        * output.h (class Output_section): Add is_entsize_zero_ field.
        * output.cc (Output_section::Output_section): Initialize
        * output.cc (Output_section::Output_section): Initialize
        is_entsize_zero_.
        is_entsize_zero_.
        (Output_section::set_entsize): If two different entsizes are
        (Output_section::set_entsize): If two different entsizes are
        requested, force it to zero.
        requested, force it to zero.
        (Output_section::add_input_section): Set flags for .debug_str
        (Output_section::add_input_section): Set flags for .debug_str
        before updating section flags.  Set entsize.
        before updating section flags.  Set entsize.
        (Output_section::update_flags_for_input_section): Set SHF_MERGE
        (Output_section::update_flags_for_input_section): Set SHF_MERGE
        and SHF_STRING if all input sections have those flags.
        and SHF_STRING if all input sections have those flags.
2009-12-29   Rafael Espindola  
2009-12-29   Rafael Espindola  
        * main.cc (main): Fix the sys time reporting.
        * main.cc (main): Fix the sys time reporting.
        * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
        * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
        reporting.
        reporting.
2009-12-29  Sriraman Tallam  
2009-12-29  Sriraman Tallam  
        * options.cc (General_options::parse_version): Allow -v to exit
        * options.cc (General_options::parse_version): Allow -v to exit
        without an error if there is nothing to link.
        without an error if there is nothing to link.
2009-12-29  Ian Lance Taylor  
2009-12-29  Ian Lance Taylor  
        * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
        * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
        using a version of gcc before 4.1.
        using a version of gcc before 4.1.
        * configure: Rebuild.
        * configure: Rebuild.
2009-12-28  Chris Demetriou  
2009-12-28  Chris Demetriou  
        * attributes.cc (Output_attributes_section_data::do_write): Use
        * attributes.cc (Output_attributes_section_data::do_write): Use
        std::vector::front rather than std::vector::data.
        std::vector::front rather than std::vector::data.
2009-12-28  Ian Lance Taylor  
2009-12-28  Ian Lance Taylor  
        * symtab.h (class Symbol_table): Add enum Defined.
        * symtab.h (class Symbol_table): Add enum Defined.
        * resolve.cc (Symbol_table::should_override): Add defined
        * resolve.cc (Symbol_table::should_override): Add defined
        parameter.  Change all callers.  Test whether object is NULL
        parameter.  Change all callers.  Test whether object is NULL
        before calling a method on it.
        before calling a method on it.
        (Symbol_table::report_resolve_problem): Add defined parameter.
        (Symbol_table::report_resolve_problem): Add defined parameter.
        Change all callers.
        Change all callers.
        (Symbol_table::should_override_with_special): Likewise.
        (Symbol_table::should_override_with_special): Likewise.
        * symtab.cc (Symbol_table::define_in_output_data): Add defined
        * symtab.cc (Symbol_table::define_in_output_data): Add defined
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol_table::do_define_in_output_data): Likewise.
        (Symbol_table::do_define_in_output_data): Likewise.
        (Symbol_table::define_in_output_segment): Likewise.
        (Symbol_table::define_in_output_segment): Likewise.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::define_as_constant): Likewise.
        (Symbol_table::define_as_constant): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        * script.h (class Symbol_assignment): Add is_defsym parameter to
        * script.h (class Symbol_assignment): Add is_defsym parameter to
        constructor; change all callers.
        constructor; change all callers.
        * script.cc (Script_options::add_symbol_assignment): Add is_defsym
        * script.cc (Script_options::add_symbol_assignment): Add is_defsym
        parameter.  Change all callers.  Add is_defsym_ field.
        parameter.  Change all callers.  Add is_defsym_ field.
        (class Parser_closure): Add parsing_defsym parameter to
        (class Parser_closure): Add parsing_defsym parameter to
        constructor; change all callers.  Add parsing_defsym accessor
        constructor; change all callers.  Add parsing_defsym accessor
        function.  Add parsing_defsym_ field.
        function.  Add parsing_defsym_ field.
2009-12-28  Ian Lance Taylor  
2009-12-28  Ian Lance Taylor  
        * gold.cc (queue_middle_tasks): Fix formatting.
        * gold.cc (queue_middle_tasks): Fix formatting.
        * object.cc (Relobj::is_section_name_included): Likewise.
        * object.cc (Relobj::is_section_name_included): Likewise.
2009-12-23  Ian Lance Taylor  
2009-12-23  Ian Lance Taylor  
        * i386.cc (Target_i386::do_calls_non_split): Recognize
        * i386.cc (Target_i386::do_calls_non_split): Recognize
        -fsplit-stack prologue for a function with a static chain.
        -fsplit-stack prologue for a function with a static chain.
        * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
        * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
        -fsplit-stack prologue when using %r11.
        -fsplit-stack prologue when using %r11.
2009-12-21  Sriraman Tallam  
2009-12-21  Sriraman Tallam  
        * options.cc (General_options::parse_version): Make -v continue and do
        * options.cc (General_options::parse_version): Make -v continue and do
        the link like GNU ld does.
        the link like GNU ld does.
2009-12-17  Rafael Avila de Espindola  
2009-12-17  Rafael Avila de Espindola  
        * Makefile.am (CCFILES): Add timer.cc.
        * Makefile.am (CCFILES): Add timer.cc.
        (HFILES): Add timer.h.
        (HFILES): Add timer.h.
        * configure.ac: Check for sysconf and times.
        * configure.ac: Check for sysconf and times.
        * main.cc: include timer.h.
        * main.cc: include timer.h.
        (main): Use Timer instead of get_run_time.
        (main): Use Timer instead of get_run_time.
        * timer.cc: New.
        * timer.cc: New.
        * timer.h: New.
        * timer.h: New.
        * workqueue.cc: include timer.h.
        * workqueue.cc: include timer.h.
        (Workqueue::find_and_run_task):
        (Workqueue::find_and_run_task):
        Report user, sys and wall time.
        Report user, sys and wall time.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * config.in: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.
        * configure: Regenerate.
2009-12-16  Doug Kwan  
2009-12-16  Doug Kwan  
        * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
        * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
        sections.
        sections.
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
        relaxed input sections.
        relaxed input sections.
        * output.cc (Output_section::find_relaxed_input_section): Change
        * output.cc (Output_section::find_relaxed_input_section): Change
        return type to Output_relaxed_input_section pointer.  Adjust code
        return type to Output_relaxed_input_section pointer.  Adjust code
        for new type of relaxed_input_section_map_.
        for new type of relaxed_input_section_map_.
        * output.h (Output_section::find_relaxed_input_section): Change
        * output.h (Output_section::find_relaxed_input_section): Change
        return type to Output_relaxed_input_section pointer.
        return type to Output_relaxed_input_section pointer.
        (Output_section::Output_relaxed_input_section_by_input_section_map):
        (Output_section::Output_relaxed_input_section_by_input_section_map):
        New type.
        New type.
        (Output_section::relaxed_input_section_map_): Change type to
        (Output_section::relaxed_input_section_map_): Change type to
        Output_section::Output_relaxed_input_section_by_input_section_map.
        Output_section::Output_relaxed_input_section_by_input_section_map.
        * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
        * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
        input section.
        input section.
2009-12-15  Ian Lance Taylor  
2009-12-15  Ian Lance Taylor  
        * layout.cc (Layout::create_shstrtab): Only write out after input
        * layout.cc (Layout::create_shstrtab): Only write out after input
        sections if we are compressing debug sections.
        sections if we are compressing debug sections.
2009-12-15  Ian Lance Taylor  
2009-12-15  Ian Lance Taylor  
        * archive.cc (Archive::add_symbols): Only look up a symbol without
        * archive.cc (Archive::add_symbols): Only look up a symbol without
        a version if there is, in fact, a version.
        a version if there is, in fact, a version.
2009-12-14  Ian Lance Taylor  
2009-12-14  Ian Lance Taylor  
        Revert -Wshadow changes, all changes from:
        Revert -Wshadow changes, all changes from:
        2009-12-11  Doug Kwan  
        2009-12-11  Doug Kwan  
        2009-12-11  Nick Clifton  
        2009-12-11  Nick Clifton  
        * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
        * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
2009-12-11  Doug Kwan  
2009-12-11  Doug Kwan  
        * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
        * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
        due to -Wshadow.
        due to -Wshadow.
        * attributes.cc (Object_attribute::size): Ditto.
        * attributes.cc (Object_attribute::size): Ditto.
        (Attributes_section_data::size): Ditto.
        (Attributes_section_data::size): Ditto.
        (Attributes_section_data::Attributes_section_data): Ditto.
        (Attributes_section_data::Attributes_section_data): Ditto.
        (Output_attributes_section_data::do_write): Ditto.
        (Output_attributes_section_data::do_write): Ditto.
        * attributes.h (Object_attribute::set_type): Ditto.
        * attributes.h (Object_attribute::set_type): Ditto.
        * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
        * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
2009-12-11  Nick Clifton  
2009-12-11  Nick Clifton  
        * archive.cc: Fix shadowed variable warnings.
        * archive.cc: Fix shadowed variable warnings.
        * arm.cc: Likewise.
        * arm.cc: Likewise.
        * compressed_output.cc: Likewise.
        * compressed_output.cc: Likewise.
        * compressed_output.h: Likewise.
        * compressed_output.h: Likewise.
        * configure: Likewise.
        * configure: Likewise.
        * dwarf_reader.cc: Likewise.
        * dwarf_reader.cc: Likewise.
        * dynobj.cc: Likewise.
        * dynobj.cc: Likewise.
        * dynobj.h: Likewise.
        * dynobj.h: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.h: Likewise.
        * ehframe.h: Likewise.
        * errors.cc: Likewise.
        * errors.cc: Likewise.
        * expression.cc: Likewise.
        * expression.cc: Likewise.
        * fileread.cc: Likewise.
        * fileread.cc: Likewise.
        * fileread.h: Likewise.
        * fileread.h: Likewise.
        * freebsd.h: Likewise.
        * freebsd.h: Likewise.
        * i386.cc: Likewise.
        * i386.cc: Likewise.
        * icf.cc: Likewise.
        * icf.cc: Likewise.
        * incremental.h: Likewise.
        * incremental.h: Likewise.
        * layout.cc: Likewise.
        * layout.cc: Likewise.
        * layout.h: Likewise.
        * layout.h: Likewise.
        * mapfile.cc: Likewise.
        * mapfile.cc: Likewise.
        * merge.cc: Likewise.
        * merge.cc: Likewise.
        * merge.h: Likewise.
        * merge.h: Likewise.
        * object.cc: Likewise.
        * object.cc: Likewise.
        * object.h: Likewise.
        * object.h: Likewise.
        * options.h: Likewise.
        * options.h: Likewise.
        * output.cc: Likewise.
        * output.cc: Likewise.
        * output.h: Likewise.
        * output.h: Likewise.
        * parameters.cc: Likewise.
        * parameters.cc: Likewise.
        * plugin.cc: Likewise.
        * plugin.cc: Likewise.
        * powerpc.cc: Likewise.
        * powerpc.cc: Likewise.
        * reduced_debug_output.cc: Likewise.
        * reduced_debug_output.cc: Likewise.
        * reduced_debug_output.h: Likewise.
        * reduced_debug_output.h: Likewise.
        * reloc.cc: Likewise.
        * reloc.cc: Likewise.
        * reloc.h: Likewise.
        * reloc.h: Likewise.
        * resolve.cc: Likewise.
        * resolve.cc: Likewise.
        * script-sections.cc: Likewise.
        * script-sections.cc: Likewise.
        * script.cc: Likewise.
        * script.cc: Likewise.
        * script.h: Likewise.
        * script.h: Likewise.
        * sparc.cc: Likewise.
        * sparc.cc: Likewise.
        * symtab.cc: Likewise.
        * symtab.cc: Likewise.
        * symtab.h: Likewise.
        * symtab.h: Likewise.
        * target-select.cc: Likewise.
        * target-select.cc: Likewise.
        * target-select.h: Likewise.
        * target-select.h: Likewise.
        * token.h: Likewise.
        * token.h: Likewise.
        * workqueue.cc: Likewise.
        * workqueue.cc: Likewise.
        * workqueue.h: Likewise.
        * workqueue.h: Likewise.
        * x86_64.cc: Likewise.
        * x86_64.cc: Likewise.
2009-12-10  Doug Kwan  
2009-12-10  Doug Kwan  
        * arm.cc (attributes.h): New include.
        * arm.cc (attributes.h): New include.
        (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
        (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
        (Arm_relobj::~Arm_relobj): Delete object pointed by
        (Arm_relobj::~Arm_relobj): Delete object pointed by
        attributes_section_data_.
        attributes_section_data_.
        (Arm_relobj::attributes_section_data): New method definition.
        (Arm_relobj::attributes_section_data): New method definition.
        (Arm_relobj::attributes_section_data_): New data member declaration.
        (Arm_relobj::attributes_section_data_): New data member declaration.
        (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
        (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
        (Arm_dynobj::~Arm_dynobj): Delete object pointed by
        (Arm_dynobj::~Arm_dynobj): Delete object pointed by
        attributes_section_data_.
        attributes_section_data_.
        (Arm_dynobj::attributes_section_data): New method definition.
        (Arm_dynobj::attributes_section_data): New method definition.
        (Arm_dynobj::attributes_section_data_): New data member declaration.
        (Arm_dynobj::attributes_section_data_): New data member declaration.
        (Target_arm::Target_arm): Initialize attributes_section_data_.  Change
        (Target_arm::Target_arm): Initialize attributes_section_data_.  Change
        initialization value of may_use_blx_ to false.
        initialization value of may_use_blx_ to false.
        (Target_arm::using_thumb2, Target_arm::using_thumb_only,
        (Target_arm::using_thumb2, Target_arm::using_thumb_only,
        Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
        Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
        object attributes to compute results instead of hard-coding.
        object attributes to compute results instead of hard-coding.
        (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
        (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
        Target_arm::get_secondary_compatible_arch,
        Target_arm::get_secondary_compatible_arch,
        Target_arm::set_secondary_compatible_arch
        Target_arm::set_secondary_compatible_arch
        Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
        Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
        Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
        Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
        New method declarations.
        New method declarations.
        (Target_arm::get_aeabi_object_attribute): New method definition.
        (Target_arm::get_aeabi_object_attribute): New method definition.
        (Target_arm::attributes_section_data_): New data member declaration.
        (Target_arm::attributes_section_data_): New data member declaration.
        (read_arm_attributes_section): New template definition.
        (read_arm_attributes_section): New template definition.
        (Arm_relobj::do_read_symbols): Read attributes section if it exists.
        (Arm_relobj::do_read_symbols): Read attributes section if it exists.
        (Arm_dynobj::do_read_symbols): Ditto.
        (Arm_dynobj::do_read_symbols): Ditto.
        (Target_arm::do_finalize_sections): Merge attributes sections from
        (Target_arm::do_finalize_sections): Merge attributes sections from
        input.  Check for BLX use after attributes section merging.
        input.  Check for BLX use after attributes section merging.
        Fix __exidx_start and __exidx_end visibility.  Create an
        Fix __exidx_start and __exidx_end visibility.  Create an
        .ARM.attributes section if necessary.
        .ARM.attributes section if necessary.
        (Target_arm::get_secondary_compatible_arch,
        (Target_arm::get_secondary_compatible_arch,
        Target_arm::set_secondary_compatible_arch,
        Target_arm::set_secondary_compatible_arch,
        Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
        Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
        Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
        Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
        Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
        Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
        New method definitions.
        New method definitions.
2009-12-09  Ian Lance Taylor  
2009-12-09  Ian Lance Taylor  
        * plugin.cc (Plugin::load): Don't cast from void* to a function
        * plugin.cc (Plugin::load): Don't cast from void* to a function
        pointer.
        pointer.
2009-12-09  Ian Lance Taylor  
2009-12-09  Ian Lance Taylor  
        * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
        * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
        information fields.
        information fields.
2009-12-09  H.J. Lu  
2009-12-09  H.J. Lu  
        * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
        * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
        Replace two_file_shared_1.so with two_file_shared_2.so.
        Replace two_file_shared_1.so with two_file_shared_2.so.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
2009-12-08  Doug Kwan  
2009-12-08  Doug Kwan  
        * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
        * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
        (HFILES): Add attributes.h and int_encoding.h.
        (HFILES): Add attributes.h and int_encoding.h.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
        * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
        function definitions to int_encoding.cc
        function definitions to int_encoding.cc
        * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
        * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
        prototypes to int_encoding.h
        prototypes to int_encoding.h
        * reduced_debug_output.cc (int_encoding.h): New include.
        * reduced_debug_output.cc (int_encoding.h): New include.
        (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
        (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
        function definitions to int_encoding.cc
        function definitions to int_encoding.cc
        (insert_into_vector, read_from_pointer): Move template definitions to
        (insert_into_vector, read_from_pointer): Move template definitions to
        int_encoding.h
        int_encoding.h
        * attributes.cc: New file.
        * attributes.cc: New file.
        * attributes.h: New file.
        * attributes.h: New file.
        * int_encoding.cc: New file.
        * int_encoding.cc: New file.
        * int_encoding.h: New file.
        * int_encoding.h: New file.
2009-12-07  Rafael Avila de Espindola  
2009-12-07  Rafael Avila de Espindola  
        PR gold/11055
        PR gold/11055
        * incremental-dump.cc (dump_incremental_inputs): New.
        * incremental-dump.cc (dump_incremental_inputs): New.
        (main): Use dump_incremental_inputs.
        (main): Use dump_incremental_inputs.
2009-12-07  H.J. Lu  
2009-12-07  H.J. Lu  
        PR gold/10893
        PR gold/10893
        * i386.cc (Target_i386::Scan::globa): Use is_func instead of
        * i386.cc (Target_i386::Scan::globa): Use is_func instead of
        checking elfcpp::STT_FUNC.
        checking elfcpp::STT_FUNC.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        * x86_64.cc (Target_x86_64::Scan::global): Likewise.
        * x86_64.cc (Target_x86_64::Scan::global): Likewise.
        * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
        * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
        symbols from shared libraries into normal FUNC symbols.
        symbols from shared libraries into normal FUNC symbols.
        * symtab.h (Symbol): Add is_func and use it.
        * symtab.h (Symbol): Add is_func and use it.
2009-12-05  Doug Kwan  
2009-12-05  Doug Kwan  
        * arm.cc (Target_arm::arm_info): Initialize new fields
        * arm.cc (Target_arm::arm_info): Initialize new fields
        attributes_section and attributes_vendor.
        attributes_section and attributes_vendor.
        * i386.cc (Target_i386::i386_info): Same.
        * i386.cc (Target_i386::i386_info): Same.
        * object.cc (Sized_relobj::do_layout): Skip attribute section.
        * object.cc (Sized_relobj::do_layout): Skip attribute section.
        * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
        * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
        fields attributes_section and attributes_vendor.
        fields attributes_section and attributes_vendor.
        * sparc.cc (Target_sparc::sparc_info): Same.
        * sparc.cc (Target_sparc::sparc_info): Same.
        * target.h (Target::attributes_section, Target::attributes_vendor,
        * target.h (Target::attributes_section, Target::attributes_vendor,
        Target::is_attributes_section, Target::attribute_arg_type,
        Target::is_attributes_section, Target::attribute_arg_type,
        Target::attributes_order): New method definitions.
        Target::attributes_order): New method definitions.
        (Target::Target_info::attributes_section,
        (Target::Target_info::attributes_section,
        Target::Target_info::attributes_vendor): New fields.
        Target::Target_info::attributes_vendor): New fields.
        (Target::do_attribute_arg_type, Target::do_attributes_order): New
        (Target::do_attribute_arg_type, Target::do_attributes_order): New
        virtual method definitions.
        virtual method definitions.
        * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
        * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
        attributes_section and attributes_vendor.
        attributes_section and attributes_vendor.
        * testsuite/testfile.cc (Target_test::test_target_info): Same.
        * testsuite/testfile.cc (Target_test::test_target_info): Same.
2009-12-05  Doug Kwan  
2009-12-05  Doug Kwan  
        * arm.cc: Update comments about interworking and stub generation.
        * arm.cc: Update comments about interworking and stub generation.
        (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
        (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
        considered as non-PIC.
        considered as non-PIC.
        (Arm_relocate_functions::base_abs): Fix formatting.
        (Arm_relocate_functions::base_abs): Fix formatting.
        (Arm_relocate_functions::got_prel): Fix comment.  Change interface
        (Arm_relocate_functions::got_prel): Fix comment.  Change interface
        of function to use GOT entry address instead of offset.
        of function to use GOT entry address instead of offset.
        (Target_arm::Scan::global): Issue an error if a symbol would need a
        (Target_arm::Scan::global): Issue an error if a symbol would need a
        PLT does not get one because it is untyped.  Remove code to create
        PLT does not get one because it is untyped.  Remove code to create
        dynamic symbols for relative branches.
        dynamic symbols for relative branches.
        (Target_arm::Relocate::relocate: Use 0 instead of false since function
        (Target_arm::Relocate::relocate: Use 0 instead of false since function
        takes unsigned integer instead of boolean.
        takes unsigned integer instead of boolean.
2009-12-05  H.J. Lu  
2009-12-05  H.J. Lu  
        * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
        * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
        (two_file_test_LDADD): Likewise.
        (two_file_test_LDADD): Likewise.
        (common_test_1_LDADD): Likewise.
        (common_test_1_LDADD): Likewise.
        (exception_test_LDADD) Likewise.
        (exception_test_LDADD) Likewise.
        (weak_test_LDADD): Likewise.
        (weak_test_LDADD): Likewise.
        (many_sections_test_LDADD): Likewise.
        (many_sections_test_LDADD): Likewise.
        (initpri1_LDADD): Likewise.
        (initpri1_LDADD): Likewise.
        (script_test_1_LDADD): Likewise.
        (script_test_1_LDADD): Likewise.
        (script_test_2_LDADD): Likewise.
        (script_test_2_LDADD): Likewise.
        (justsyms_LDADD): Likewise.
        (justsyms_LDADD): Likewise.
        (binary_test_LDADD): Likewise.
        (binary_test_LDADD): Likewise.
        (large_LDADD): Likewise.
        (large_LDADD): Likewise.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
2009-12-04  H.J. Lu  
2009-12-04  H.J. Lu  
        * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
        * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
        (Symbol_table::override_with_special): Likewise.
        (Symbol_table::override_with_special): Likewise.
        (Symbol_table::add_from_object): Likewise.
        (Symbol_table::add_from_object): Likewise.
2009-12-04  Rafael Avila de Espindola  
2009-12-04  Rafael Avila de Espindola  
        * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
        * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
        Don't set the data_offset twice.
        Don't set the data_offset twice.
2009-12-04  Rafael Avila de Espindola  
2009-12-04  Rafael Avila de Espindola  
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-12-03  Doug Kwan  
2009-12-03  Doug Kwan  
        * arm.cc: Remove comment about missing .ARM.exidx section symbols.
        * arm.cc: Remove comment about missing .ARM.exidx section symbols.
        (Target_arm::do_finalize_sections): Add parameter for symbol table
        (Target_arm::do_finalize_sections): Add parameter for symbol table
        pointer.  Add __exidx_start and __exidx_end symbols as appropriate.
        pointer.  Add __exidx_start and __exidx_end symbols as appropriate.
        * i386.cc (Target_i386::do_finalize_sections): Add an additional
        * i386.cc (Target_i386::do_finalize_sections): Add an additional
        parameter for symbol table pointer.
        parameter for symbol table pointer.
        * layout.cc (Layout::finalize): Call Target::finalize_sections with
        * layout.cc (Layout::finalize): Call Target::finalize_sections with
        an additional parameter for a pointer to symbol table.
        an additional parameter for a pointer to symbol table.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
        * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
        parameter for a symbol table pointer.
        parameter for a symbol table pointer.
        * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
        * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
        * target.h (Target::finalize_sections, Target::do_finalize_sections):
        * target.h (Target::finalize_sections, Target::do_finalize_sections):
        Ditto.
        Ditto.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
        * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
        parameter for a symbol table pointer.
        parameter for a symbol table pointer.
2009-12-03  Rafael Avila de Espindola  
2009-12-03  Rafael Avila de Espindola  
        * incremental.cc (Incremental_inputs_header)
        * incremental.cc (Incremental_inputs_header)
        (Incremental_inputs_header_write, Incremental_inputs_entry)
        (Incremental_inputs_header_write, Incremental_inputs_entry)
        (Incremental_inputs_entry_write): Move ...
        (Incremental_inputs_entry_write): Move ...
        * incremental.h (Incremental_inputs_header)
        * incremental.h (Incremental_inputs_header)
        (Incremental_inputs_header_write, Incremental_inputs_entry)
        (Incremental_inputs_header_write, Incremental_inputs_entry)
        (Incremental_inputs_entry_write): here.
        (Incremental_inputs_entry_write): here.
2009-12-02  Rafael Avila de Espindola  
2009-12-02  Rafael Avila de Espindola  
        * incremental.cc (make_sized_incremental_binary): Set the target.
        * incremental.cc (make_sized_incremental_binary): Set the target.
        Error if it is incompatible.
        Error if it is incompatible.
        * output.h (Output_file): Add filename method.
        * output.h (Output_file): Add filename method.
2009-12-02  Rafael Avila de Espindola  
2009-12-02  Rafael Avila de Espindola  
        * incremental.cc (Incremental_inputs_entry): Remove unused argument
        * incremental.cc (Incremental_inputs_entry): Remove unused argument
        from the get_* methods.
        from the get_* methods.
2009-12-02  Rafael Avila de Espindola  
2009-12-02  Rafael Avila de Espindola  
        * incremental-dump.cc (main): Check that the offeset of a script is 0.
        * incremental-dump.cc (main): Check that the offeset of a script is 0.
        * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
        * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
        Write 0 for the data_offset of scripts.
        Write 0 for the data_offset of scripts.
2009-12-02  Rafael Avila de Espindola  
2009-12-02  Rafael Avila de Espindola  
        * testsuite/Makefile.am: Add the incremental_test.sh test.
        * testsuite/Makefile.am: Add the incremental_test.sh test.
        * testsuite/incremental_test.sh: New.
        * testsuite/incremental_test.sh: New.
        * testsuite/incremental_test_1.c: New.
        * testsuite/incremental_test_1.c: New.
        * testsuite/incremental_test_2.c: New.
        * testsuite/incremental_test_2.c: New.
2009-12-01  Rafael Avila de Espindola  
2009-12-01  Rafael Avila de Espindola  
       * incremental-dump.cc (main): Fix typos.
       * incremental-dump.cc (main): Fix typos.
2009-11-27  Rafael Avila de Espindola  
2009-11-27  Rafael Avila de Espindola  
        PR gold/11025
        PR gold/11025
        * incremental-dump.cc (main): Use llu to print 64 bit values.
        * incremental-dump.cc (main): Use llu to print 64 bit values.
2009-11-26  Per Øyvind Karlsen 
2009-11-26  Per Øyvind Karlsen 
            H.J. Lu  
            H.J. Lu  
        * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
        * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
        $(LIBDL).
        $(LIBDL).
        (incremental_dump_LDADD): Likewise.
        (incremental_dump_LDADD): Likewise.
        * Makefile.in: Regenerated.
        * Makefile.in: Regenerated.
2009-11-25  Doug Kwan  
2009-11-25  Doug Kwan  
        Revert:
        Revert:
        2009-11-25  Doug Kwan  
        2009-11-25  Doug Kwan  
                * arm.cc (Target_arm::Target_arm): Move method definition
                * arm.cc (Target_arm::Target_arm): Move method definition
                outside of class definition.  Add code to handle
                outside of class definition.  Add code to handle
                --target1-rel, --target1-abs and --target2= options.
                --target1-rel, --target1-abs and --target2= options.
                (Target_arm::get_reloc_reloc_type): Change method to be
                (Target_arm::get_reloc_reloc_type): Change method to be
                non-static and const.
                non-static and const.
                (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
                (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
                New data member declaration.
                New data member declaration.
                (Target_arm::Scan::local, Target_arm::Scan::global,
                (Target_arm::Scan::local, Target_arm::Scan::global,
                Target_arm::Relocate::relocate,
                Target_arm::Relocate::relocate,
                Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
                Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
                Adjust call to Target_arm::get_real_reloc_type.
                Adjust call to Target_arm::get_real_reloc_type.
                (Target_arm::get_real_reloc_type): Use command line options
                (Target_arm::get_real_reloc_type): Use command line options
                to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
                to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
                * options.h (--target1-rel, --target1-abs, --target2): New
                * options.h (--target1-rel, --target1-abs, --target2): New
                ARM-only options.
                ARM-only options.
2009-11-25  Doug Kwan  
2009-11-25  Doug Kwan  
        * arm.cc (Target_arm::Target_arm): Move method definition outside of
        * arm.cc (Target_arm::Target_arm): Move method definition outside of
        class definition.  Add code to handle --target1-rel, --target1-abs
        class definition.  Add code to handle --target1-rel, --target1-abs
        and --target2= options.
        and --target2= options.
        (Target_arm::get_reloc_reloc_type): Change method to be non-static
        (Target_arm::get_reloc_reloc_type): Change method to be non-static
        and const.
        and const.
        (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
        (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
        member declaration.
        member declaration.
        (Target_arm::Scan::local, Target_arm::Scan::global,
        (Target_arm::Scan::local, Target_arm::Scan::global,
        Target_arm::Relocate::relocate,
        Target_arm::Relocate::relocate,
        Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
        Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
        call to Target_arm::get_real_reloc_type.
        call to Target_arm::get_real_reloc_type.
        (Target_arm::get_real_reloc_type): Use command line options to
        (Target_arm::get_real_reloc_type): Use command line options to
        determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
        determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
        * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
        * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
        options.
        options.
2009-11-25  Doug Kwan  
2009-11-25  Doug Kwan  
        * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
        * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
        (Arm_relocate_functions::thumb_branch_common): New metod declaration.
        (Arm_relocate_functions::thumb_branch_common): New metod declaration.
        (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
        (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
        formatting.
        formatting.
        (Arm_relocate_functions::thm_call): Replace body with a call to
        (Arm_relocate_functions::thm_call): Replace body with a call to
        Arm_relocate_functions::thumb_branch_common.
        Arm_relocate_functions::thumb_branch_common.
        (Arm_relocate_functions::thm_jump24,
        (Arm_relocate_functions::thm_jump24,
        Arm_relocate_functions::thm_xpc22): New method definitions.
        Arm_relocate_functions::thm_xpc22): New method definitions.
        (Arm_relocate_functions::thumb_branch_common): New method definition.
        (Arm_relocate_functions::thumb_branch_common): New method definition.
        (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
        (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
        operator.
        operator.
        (Target_arm::Relocate::relocate): Adjust call to thm_call.
        (Target_arm::Relocate::relocate): Adjust call to thm_call.
        Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
        Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
2009-11-24  Rafael Avila de Espindola  
2009-11-24  Rafael Avila de Espindola  
        * Makefile.am: Build incremental-dump
        * Makefile.am: Build incremental-dump
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * incremental-dump.cc: New.
        * incremental-dump.cc: New.
        * incremental.cc (Incremental_inputs_header_data,
        * incremental.cc (Incremental_inputs_header_data,
        Incremental_inputs_entry_data): Move to incremental.h
        Incremental_inputs_entry_data): Move to incremental.h
        * incremental.h: (Incremental_inputs_header_data,
        * incremental.h: (Incremental_inputs_header_data,
        Incremental_inputs_entry_data): Move from incremental.cc
        Incremental_inputs_entry_data): Move from incremental.cc
2009-11-24  Rafael Avila de Espindola  
2009-11-24  Rafael Avila de Espindola  
        * incremental.cc (Incremental_inputs_header,
        * incremental.cc (Incremental_inputs_header,
        Incremental_inputs_header_write, Incremental_inputs_entry,
        Incremental_inputs_header_write, Incremental_inputs_entry,
        Incremental_inputs_entry_write): Add a typedef with the data type.
        Incremental_inputs_entry_write): Add a typedef with the data type.
2009-11-24  Rafael Avila de Espindola  
2009-11-24  Rafael Avila de Espindola  
        * incremental.cc (Incremental_inputs_header,
        * incremental.cc (Incremental_inputs_header,
        Incremental_inputs_header_write, Incremental_inputs_entry,
        Incremental_inputs_header_write, Incremental_inputs_entry,
        Incremental_inputs_entry_write): Update comment about which
        Incremental_inputs_entry_write): Update comment about which
        type has the filed descriptions.
        type has the filed descriptions.
2009-11-15  Doug Kwan  
2009-11-15  Doug Kwan  
        * arm.cc (Target_arm::may_use_arm_nop): New method definition.
        * arm.cc (Target_arm::may_use_arm_nop): New method definition.
        (Arm_relocate_functions::arm_branch_common): Change method defintion
        (Arm_relocate_functions::arm_branch_common): Change method defintion
        in class definition to a method declaration and update list of formal
        in class definition to a method declaration and update list of formal
        parameters.
        parameters.
        (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
        (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
        Arm_relocation_functions::jump24): Adjust call to
        Arm_relocation_functions::jump24): Adjust call to
        Arm_relocate_functions::arm_branch_common.  Update list of formal
        Arm_relocate_functions::arm_branch_common.  Update list of formal
        parameters.
        parameters.
        (Arm_relocate_functions::xpc25): New method definition.
        (Arm_relocate_functions::xpc25): New method definition.
        (Arm_relocate_functions::arm_branch_common): Move method defintion
        (Arm_relocate_functions::arm_branch_common): Move method defintion
        out from class definition.  Use stubs for mode-switching and extending
        out from class definition.  Use stubs for mode-switching and extending
        branch ranges.
        branch ranges.
        (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
        (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
        specially.  Change code to enable use of stubs in ARM branches.
        specially.  Change code to enable use of stubs in ARM branches.
2009-11-10  Doug Kwan  
2009-11-10  Doug Kwan  
        * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
        * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
        in method declaration.
        in method declaration.
        (Target_arm::relocate_stub): New method declaration.
        (Target_arm::relocate_stub): New method declaration.
        (Target_arm::default_target): Change to return a pointer instead of
        (Target_arm::default_target): Change to return a pointer instead of
        a const reference.
        a const reference.
        (Reloc_stub::stub_type_for_reloc): Adjust for the change in
        (Reloc_stub::stub_type_for_reloc): Adjust for the change in
        Target_arm::default_target.
        Target_arm::default_target.
        (Arm_Relobj::do_relocate_sections): Remove options paramater in
        (Arm_Relobj::do_relocate_sections): Remove options paramater in
        method definition.
        method definition.
        (Target_arm::relocate_section): Adjust view.
        (Target_arm::relocate_section): Adjust view.
        (Target_arm::relocate_stub): New method definition.
        (Target_arm::relocate_stub): New method definition.
2009-11-10  Doug Kwan  
2009-11-10  Doug Kwan  
        * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
        * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
        a format warning.
        a format warning.
        * incremental.cc (open_incremental_binary): Initialized local
        * incremental.cc (open_incremental_binary): Initialized local
        variables to avoid warnings.
        variables to avoid warnings.
        * object.cc (make_elf_object): Ditto.
        * object.cc (make_elf_object): Ditto.
        * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
        * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
        a format warning.
        a format warning.
009-11-09  H.J. Lu  
009-11-09  H.J. Lu  
        PR gold/10930
        PR gold/10930
        * testsuite/plugin_test.c: Include "config.h".
        * testsuite/plugin_test.c: Include "config.h".
2009-11-09  Doug Kwan  
2009-11-09  Doug Kwan  
        * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
        * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
        (arm_symbol_value): Remove.
        (arm_symbol_value): Remove.
        (Arm_relocate_functions::arm_branch_common,
        (Arm_relocate_functions::arm_branch_common,
        Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
        Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
        Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
        Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
        Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
        Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
        Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
        Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
        Arm_relocate_functions::call, Arm_relocate_functions::jump24,
        Arm_relocate_functions::call, Arm_relocate_functions::jump24,
        Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
        Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
        Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
        Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
        Arm_relocate_functions::thm_mobw_abs_nc,
        Arm_relocate_functions::thm_mobw_abs_nc,
        Arm_relocate_functions::thm_mov_abs,
        Arm_relocate_functions::thm_mov_abs,
        Arm_relocate_functions::movw_prel_nc,
        Arm_relocate_functions::movw_prel_nc,
        Arm_relocate_functions::thm_movt_abs,
        Arm_relocate_functions::thm_movt_abs,
        Arm_relocate_functions::movt_prel,
        Arm_relocate_functions::movt_prel,
        Arm_relocate_functions::thm_movw_prel_nc,
        Arm_relocate_functions::thm_movw_prel_nc,
        Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
        Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
        (Target_arm::Relocate::relocate): Only decompose address into two
        (Target_arm::Relocate::relocate): Only decompose address into two
        parts if relocation type uses the thumb-bit and pass the actual
        parts if relocation type uses the thumb-bit and pass the actual
        bit instead of a flag indicating that the thumb-bit is used.  Adjust
        bit instead of a flag indicating that the thumb-bit is used.  Adjust
        calls to methods in Arm_relocate_functions for this change.
        calls to methods in Arm_relocate_functions for this change.
2009-11-08  Ian Lance Taylor  
2009-11-08  Ian Lance Taylor  
        PR 10925
        PR 10925
        * reloc.cc: Instantiate
        * reloc.cc: Instantiate
        Sized_relobj::initialize_input_to_output_maps and
        Sized_relobj::initialize_input_to_output_maps and
        Sized_relobj:free_input_to_output_maps.
        Sized_relobj:free_input_to_output_maps.
2009-11-06  Ian Lance Taylor  
2009-11-06  Ian Lance Taylor  
        PR 10876
        PR 10876
        * defstd.cc (in_segment): Set only_if_ref true for "end".
        * defstd.cc (in_segment): Set only_if_ref true for "end".
2009-11-06  Doug Kwan  
2009-11-06  Doug Kwan  
        * arm.cc (class Reloc_stub): Correct a comment.
        * arm.cc (class Reloc_stub): Correct a comment.
        (Target_arm::Target_arm): Initialize arm_input_section_map_.
        (Target_arm::Target_arm): Initialize arm_input_section_map_.
        (Target_arm::scan_section_for_stubs): New method declaration.
        (Target_arm::scan_section_for_stubs): New method declaration.
        (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
        (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
        Change methods from private to protected.
        Change methods from private to protected.
        (Target_arm::do_may_relax): New method definition.
        (Target_arm::do_may_relax): New method definition.
        (Target_arm::do_relax, Target_arm::group_sections,
        (Target_arm::do_relax, Target_arm::group_sections,
        Target_arm::scan_reloc_for_stub,
        Target_arm::scan_reloc_for_stub,
        Target_arm::scan_reloc_section_for_stubs): New method declarations.
        Target_arm::scan_reloc_section_for_stubs): New method declarations.
        (Target_arm::arm_input_section_map_): New data member declaration.
        (Target_arm::arm_input_section_map_): New data member declaration.
        (Target_arm::scan_reloc_for_stub,
        (Target_arm::scan_reloc_for_stub,
        Target_arm::scan_reloc_section_for_stubs,
        Target_arm::scan_reloc_section_for_stubs,
        Target_arm::scan_section_for_stubs, Target_arm::group_sections,
        Target_arm::scan_section_for_stubs, Target_arm::group_sections,
        Target_arm::do_relax): New method definitions.
        Target_arm::do_relax): New method definitions.
2009-11-06  Mikolaj Zalewski  
2009-11-06  Mikolaj Zalewski  
        * configure.ac: Check for (struct stat)::st_mtim
        * configure.ac: Check for (struct stat)::st_mtim
        * fileread.cc (File_read::get_mtime): Use st_mtim if available.
        * fileread.cc (File_read::get_mtime): Use st_mtim if available.
        * config.in: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.
        * configure: Regenerate.
2009-11-05  Ian Lance Taylor  
2009-11-05  Ian Lance Taylor  
        PR 10910
        PR 10910
        * output.cc (Output_segment::add_output_section): Add missing
        * output.cc (Output_segment::add_output_section): Add missing
        return statement.
        return statement.
2009-11-04  Ian Lance Taylor  
2009-11-04  Ian Lance Taylor  
        PR 10880
        PR 10880
        * object.h (class Object): Add is_needed and set_is_needed
        * object.h (class Object): Add is_needed and set_is_needed
        methods.  Add is_needed_ field.  Make bool fields into bitfields.
        methods.  Add is_needed_ field.  Make bool fields into bitfields.
        * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
        * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
        defined in a dynamic object and referenced by a regular object,
        defined in a dynamic object and referenced by a regular object,
        set is_needed for the dynamic object.
        set is_needed for the dynamic object.
        * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
        * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
        if the file is marked with as_needed and it is not needed.
        if the file is marked with as_needed and it is not needed.
2009-11-04  Ian Lance Taylor  
2009-11-04  Ian Lance Taylor  
        PR 10887
        PR 10887
        * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
        * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
        tags if data is discarded by linker script.
        tags if data is discarded by linker script.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * i386.cc (Target_i386::do_finalize_sections): Likewise.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
        * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
        * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2009-11-04  Ian Lance Taylor  
2009-11-04  Ian Lance Taylor  
        * layout.cc (Layout::get_output_section): Add is_interp and
        * layout.cc (Layout::get_output_section): Add is_interp and
        is_dynamic_linker_section parameters.  Change all callers.
        is_dynamic_linker_section parameters.  Change all callers.
        (Layout::choose_output_section): Likewise.
        (Layout::choose_output_section): Likewise.
        (Layout::make_output_section): Likewise.
        (Layout::make_output_section): Likewise.
        (Layout::add_output_section_data): Add is_dynamic_linker_section
        (Layout::add_output_section_data): Add is_dynamic_linker_section
        parameter.  Change all callers.
        parameter.  Change all callers.
        * layout.h (class Layout): Update declarations.
        * layout.h (class Layout): Update declarations.
        * output.h (class Output_section): Add is_interp, set_is_interp,
        * output.h (class Output_section): Add is_interp, set_is_interp,
        is_dynamic_linker_section, set_is_dynamic_linker_section methods.
        is_dynamic_linker_section, set_is_dynamic_linker_section methods.
        Add is_interp_, is_dynamic_linker_section_ fields.  Change
        Add is_interp_, is_dynamic_linker_section_ fields.  Change
        generate_code_fills_at_write_ to a bitfield.
        generate_code_fills_at_write_ to a bitfield.
        * output.cc (Output_section::Output_sections): Initialize new
        * output.cc (Output_section::Output_sections): Initialize new
        fields.
        fields.
        (Output_segment::add_output_section): Add do_sort parameter.
        (Output_segment::add_output_section): Add do_sort parameter.
        Change all callers.
        Change all callers.
2009-11-03  Ian Lance Taylor  
2009-11-03  Ian Lance Taylor  
        PR 10860
        PR 10860
        * options.h (class General_options): Add --warn-common.
        * options.h (class General_options): Add --warn-common.
        * resolve.cc (Symbol_table::resolve): Handle --warn-common when
        * resolve.cc (Symbol_table::resolve): Handle --warn-common when
        merging two common symbols.
        merging two common symbols.
        (Symbol_table::should_override): Handle --warn-common when merging
        (Symbol_table::should_override): Handle --warn-common when merging
        a common symbol with a defined symbol.  Use report_resolve_problem
        a common symbol with a defined symbol.  Use report_resolve_problem
        for multiple definitions.
        for multiple definitions.
        (Symbol_table::report_resolve_problem): New function.
        (Symbol_table::report_resolve_problem): New function.
        * symtab.h (class Symbol_table): Declare report_resolve_problem.
        * symtab.h (class Symbol_table): Declare report_resolve_problem.
2009-11-03  Doug Kwan  
2009-11-03  Doug Kwan  
        * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
        * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
        stub_factory_.
        stub_factory_.
        (Target_arm::stub_factory): New method definition.
        (Target_arm::stub_factory): New method definition.
        (Target_arm::new_arm_input_section,
        (Target_arm::new_arm_input_section,
        Target_arm::find_arm_input_section, Target_arm::new_stub_table,
        Target_arm::find_arm_input_section, Target_arm::new_stub_table,
        Target_arm::reloc_uses_thumb_bit): New method declarations.
        Target_arm::reloc_uses_thumb_bit): New method declarations.
        (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
        (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
        New type definitions.
        New type definitions.
        (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
        (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
        member declarations.
        member declarations.
        (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
        (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
        Target_arm::find_arm_input_section, Target_arm::new_stub_table):
        Target_arm::find_arm_input_section, Target_arm::new_stub_table):
        New method definitions.
        New method definitions.
2009-11-03  Ian Lance Taylor  
2009-11-03  Ian Lance Taylor  
        * options.h (class General_options): Add --warn_constructors.
        * options.h (class General_options): Add --warn_constructors.
2009-11-03  Ian Lance Taylor  
2009-11-03  Ian Lance Taylor  
        PR 10893
        PR 10893
        * defstd.cc (in_section): Add entries for __rel_iplt_start,
        * defstd.cc (in_section): Add entries for __rel_iplt_start,
        __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
        __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
2009-11-03  Ian Lance Taylor  
2009-11-03  Ian Lance Taylor  
        PR 10895
        PR 10895
        * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
        * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
        --msgid-bugs-address.
        --msgid-bugs-address.
        (install-pdf): New target.
        (install-pdf): New target.
        (install-data_yes): Look up one directory to find mkinstalldirs.
        (install-data_yes): Look up one directory to find mkinstalldirs.
2009-11-03  H.J. Lu  
2009-11-03  H.J. Lu  
        * po/Make-in (.po.gmo): Don't generate .gmo files in source
        * po/Make-in (.po.gmo): Don't generate .gmo files in source
        tree.
        tree.
2009-10-30  Doug Kwan  
2009-10-30  Doug Kwan  
        * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
        * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
2009-10-30  Doug Kwan  
2009-10-30  Doug Kwan  
        * arm.cc (Stub_addend_reader): New struct template definition
        * arm.cc (Stub_addend_reader): New struct template definition
        and partial specializations.
        and partial specializations.
        (Stub_addend_reader::operator()): New method definition for a
        (Stub_addend_reader::operator()): New method definition for a
        partially specialized template.
        partially specialized template.
2009-10-30  Doug Kwan  
2009-10-30  Doug Kwan  
        * arm.cc (Arm_relobj::processor_specific_flags): New method
        * arm.cc (Arm_relobj::processor_specific_flags): New method
        definition.
        definition.
        (Arm_relobj::do_read_symbols): New method declaration.
        (Arm_relobj::do_read_symbols): New method declaration.
        (Arm_relobj::processor_specific_flags_): New data member declaration.
        (Arm_relobj::processor_specific_flags_): New data member declaration.
        (Arm_dynobj): New class definition.
        (Arm_dynobj): New class definition.
        (Target_arm::do_finalize_sections): Add input_objects parameter.
        (Target_arm::do_finalize_sections): Add input_objects parameter.
        (Target_arm::do_adjust_elf_header): New method declaration.
        (Target_arm::do_adjust_elf_header): New method declaration.
        (Target_arm::are_eabi_versions_compatible,
        (Target_arm::are_eabi_versions_compatible,
        (Target_arm::merge_processor_specific_flags): New method declaration.
        (Target_arm::merge_processor_specific_flags): New method declaration.
        (Target_arm::do_make_elf_object): New overloaded method definitions
        (Target_arm::do_make_elf_object): New overloaded method definitions
        and declaration.
        and declaration.
        (Arm_relobj::do_read_symbols): New method definition.
        (Arm_relobj::do_read_symbols): New method definition.
        (Arm_dynobj::do_read_symbols): Ditto.
        (Arm_dynobj::do_read_symbols): Ditto.
        (Target_arm::do_finalize_sections): Add input_objects parameters.
        (Target_arm::do_finalize_sections): Add input_objects parameters.
        Merge processor-specific flags from all input objects.
        Merge processor-specific flags from all input objects.
        (Target_arm::are_eabi_versions_compatible,
        (Target_arm::are_eabi_versions_compatible,
        Target_arm::merge_processor_specific_flags,
        Target_arm::merge_processor_specific_flags,
        Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
        Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
        New method definitions.
        New method definitions.
        * i386.cc (Target_i386::do_finalize_sections): Add unnamed
        * i386.cc (Target_i386::do_finalize_sections): Add unnamed
        Input_objects pointer type parameter.
        Input_objects pointer type parameter.
        * layout.cc (Layout::finalize): Pass input objects to target's.
        * layout.cc (Layout::finalize): Pass input objects to target's.
        finalize_sections function.
        finalize_sections function.
        * output.cc (Output_file_header::do_sized_write): Set ELF file
        * output.cc (Output_file_header::do_sized_write): Set ELF file
        header's processor-specific flags.
        header's processor-specific flags.
        * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
        * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
        Input_objects pointer type parameter.
        Input_objects pointer type parameter.
        * sparc.cc (Target_sparc::do_finalize_sections): Same.
        * sparc.cc (Target_sparc::do_finalize_sections): Same.
        * target.h (Input_objects): New forward class declaration.
        * target.h (Input_objects): New forward class declaration.
        (Target::processor_specific_flags,
        (Target::processor_specific_flags,
        Target::are_processor_specific_flags_sect): New method definitions.
        Target::are_processor_specific_flags_sect): New method definitions.
        (Target::finalize_sections): Add input_objects parameter.
        (Target::finalize_sections): Add input_objects parameter.
        (Target::Target): Initialize processor_specific_flags_ and
        (Target::Target): Initialize processor_specific_flags_ and
        are_processor_specific_flags_set_.
        are_processor_specific_flags_set_.
        (Target::do_finalize_sections): Add unnamed Input_objects pointer type
        (Target::do_finalize_sections): Add unnamed Input_objects pointer type
        parameter.
        parameter.
        (Target::set_processor_specific_flags): New method definition.
        (Target::set_processor_specific_flags): New method definition.
        (Target::processor_specific_flags_,
        (Target::processor_specific_flags_,
        Target::are_processor_specific_flags_set_): New data member
        Target::are_processor_specific_flags_set_): New data member
        declarations.
        declarations.
        * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
        * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
        Input_objects pointer type parameter.
        Input_objects pointer type parameter.
2009-10-30  Doug Kwan  
2009-10-30  Doug Kwan  
        * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
        * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
2009-10-28  Ian Lance Taylor  
2009-10-28  Ian Lance Taylor  
        * object.h (class Relobj): Drop options parameter from
        * object.h (class Relobj): Drop options parameter from
        gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
        gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
        do_scan_relocs, do_relocate.  Change all callers.
        do_scan_relocs, do_relocate.  Change all callers.
        (class Sized_relobj): Drop options parameters from
        (class Sized_relobj): Drop options parameters from
        do_gc_process_relocs, do_scan_relocs, do_relocate,
        do_gc_process_relocs, do_scan_relocs, do_relocate,
        do_relocate_sections, relocate_sections, emit_relocs_scan,
        do_relocate_sections, relocate_sections, emit_relocs_scan,
        emit_relocs_scan_reltype.  Change all callers.
        emit_relocs_scan_reltype.  Change all callers.
        (struct Relocate_info): Remove options field and all references to
        (struct Relocate_info): Remove options field and all references to
        it.
        it.
        * reloc.h (class Read_relocs): Remove options constructor
        * reloc.h (class Read_relocs): Remove options constructor
        parameter and options_ field.  Change all callers.
        parameter and options_ field.  Change all callers.
        (class Gc_process_relocs, class Scan_relocs): Likewise.
        (class Gc_process_relocs, class Scan_relocs): Likewise.
        (class Relocate_task): Likewise.
        (class Relocate_task): Likewise.
        * target-reloc.h (scan_relocs): Remove options parameter.  Change
        * target-reloc.h (scan_relocs): Remove options parameter.  Change
        all callers.
        all callers.
        (scan_relocatable_relocs): Likewise.
        (scan_relocatable_relocs): Likewise.
        * target.h (class Sized_target): Remove options parameter from
        * target.h (class Sized_target): Remove options parameter from
        gc_process_relocs, scan_relocs, scan_relocatable_relocs.  Change
        gc_process_relocs, scan_relocs, scan_relocatable_relocs.  Change
        all callers.
        all callers.
        * gc.h (gc_process_relocs): Remove options parameter.  Change all
        * gc.h (gc_process_relocs): Remove options parameter.  Change all
        callers.
        callers.
        * arm.cc: Update functions to remove options parameters.
        * arm.cc: Update functions to remove options parameters.
        * i386.cc: Likewise.
        * i386.cc: Likewise.
        * powerpc.cc: Likewise.
        * powerpc.cc: Likewise.
        * sparc.cc: Likewise.
        * sparc.cc: Likewise.
        * x86_64.cc: Likewise.
        * x86_64.cc: Likewise.
        * testsuite/testfile.cc: Likewise.
        * testsuite/testfile.cc: Likewise.
2009-10-28  Doug Kwan  
2009-10-28  Doug Kwan  
        * arm.cc (Arm_relobj): New class definition.
        * arm.cc (Arm_relobj): New class definition.
        (Arm_relobj::scan_sections_for_stubs,
        (Arm_relobj::scan_sections_for_stubs,
        Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
        Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
        New method definitions.
        New method definitions.
2009-10-28  Cary Coutant  
2009-10-28  Cary Coutant  
        * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
        * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
        (Plugin::cleanup_done_): New member.
        (Plugin::cleanup_done_): New member.
        (Plugin_manager::Plugin_manager): Remove cleanup_done_.
        (Plugin_manager::Plugin_manager): Remove cleanup_done_.
        (Plugin_manager::cleanup_done_): Remove.
        (Plugin_manager::cleanup_done_): Remove.
        (Plugin_manager::add_input_file): Edit error message.
        (Plugin_manager::add_input_file): Edit error message.
        * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
        * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
        (Plugin_manager::cleanup): Remove use of cleanup_done_.
        (Plugin_manager::cleanup): Remove use of cleanup_done_.
2009-10-27  Mikolaj Zalewski  
2009-10-27  Mikolaj Zalewski  
        * fileread.cc: (File_read::View::~View): Use the new
        * fileread.cc: (File_read::View::~View): Use the new
        data_ownership_ filed.
        data_ownership_ filed.
        (File_read::~File_read): Dispose the new whole_file_view_.
        (File_read::~File_read): Dispose the new whole_file_view_.
        (File_read::open): Mmap the whole file if needed.
        (File_read::open): Mmap the whole file if needed.
        (File_read::open): Use whole_file_view_ instead of contents_.
        (File_read::open): Use whole_file_view_ instead of contents_.
        (File_read::find_view): Use whole_file_view_ if applicable.
        (File_read::find_view): Use whole_file_view_ if applicable.
        (File_read::do_read): Use whole_file_view_ instead of contents_.
        (File_read::do_read): Use whole_file_view_ instead of contents_.
        (File_read::make_view): Use whole_file_view_ instead of contents_,
        (File_read::make_view): Use whole_file_view_ instead of contents_,
        update File_read::View::View call.
        update File_read::View::View call.
        (File_read::find_or_make_view): Update File_read::View::View
        (File_read::find_or_make_view): Update File_read::View::View
        call.
        call.
        * fileread.h: (File_read::File_read): Initialize whole_file_view_,
        * fileread.h: (File_read::File_read): Initialize whole_file_view_,
        remove contents_
        remove contents_
        (File_read::View::Data_ownership): New enum.
        (File_read::View::Data_ownership): New enum.
        (File_read::View::View): Replace bool mapped_ with Data_ownership
        (File_read::View::View): Replace bool mapped_ with Data_ownership
        argument.
        argument.
        (File_read::View::mapped_): Remove (replaced by data_ownership_).
        (File_read::View::mapped_): Remove (replaced by data_ownership_).
        (File_read::View::data_ownership_): New field.
        (File_read::View::data_ownership_): New field.
        (File_read::contents_): Remove (replaced by whole_file_view_).
        (File_read::contents_): Remove (replaced by whole_file_view_).
        (File_read::whole_file_view_): New field.
        (File_read::whole_file_view_): New field.
        * options.h (class General_options): Add --keep-files-mapped.
        * options.h (class General_options): Add --keep-files-mapped.
2009-10-27  Cary Coutant  
2009-10-27  Cary Coutant  
        * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
        * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
        * testsuite/Makefile.am (plugin_test_5): New test case.
        * testsuite/Makefile.am (plugin_test_5): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-10-25  Doug Kwan  
2009-10-25  Doug Kwan  
        * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
        * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
        from private to protected to allow access by child class.
        from private to protected to allow access by child class.
        (Sized_relobj::do_relocate_sections): New method declaration.
        (Sized_relobj::do_relocate_sections): New method declaration.
        (Sized_relobj::relocate_sections): Virtualize.
        (Sized_relobj::relocate_sections): Virtualize.
        * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
        * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
        Sized_relobj::relocate_sections.  Instantiate template explicitly
        Sized_relobj::relocate_sections.  Instantiate template explicitly
        for different target sizes and endianity.
        for different target sizes and endianity.
2009-10-24  Doug Kwan  
2009-10-24  Doug Kwan  
        * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
        * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
        (Arm_input_section::as_arm_input_section): New method.
        (Arm_input_section::as_arm_input_section): New method.
        (Arm_output_section): New class definition.
        (Arm_output_section): New class definition.
        (Arm_output_section::create_stub_group,
        (Arm_output_section::create_stub_group,
        Arm_output_section::group_sections): New method definitions.
        Arm_output_section::group_sections): New method definitions.
2009-10-22  Doug Kwan  
2009-10-22  Doug Kwan  
        * arm.cc (Arm_input_section): New class definition.
        * arm.cc (Arm_input_section): New class definition.
        (Arm_input_section::init, Arm_input_section:do_write,
        (Arm_input_section::init, Arm_input_section:do_write,
        Arm_input_section::set_final_data_size,
        Arm_input_section::set_final_data_size,
        Arm_input_section::do_reset_address_and_file_offset): New method
        Arm_input_section::do_reset_address_and_file_offset): New method
        definitions.
        definitions.
2009-10-21  Doug Kwan  
2009-10-21  Doug Kwan  
        * arm.cc (Stub_table, Arm_input_section): New forward class
        * arm.cc (Stub_table, Arm_input_section): New forward class
        declarations.
        declarations.
        (Stub_table): New class defintion.
        (Stub_table): New class defintion.
        (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
        (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
        Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
        Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
        New method definition.
        New method definition.
2009-10-21  Doug Kwan  
2009-10-21  Doug Kwan  
        * arm.cc: Update copyright comments.
        * arm.cc: Update copyright comments.
        (Target_arm): New forward class template declaration.
        (Target_arm): New forward class template declaration.
        (Arm_address): New type.
        (Arm_address): New type.
        (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
        (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
        THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
        THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
        THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
        THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
        constants.
        constants.
        (Insn_template): Same.
        (Insn_template): Same.
        (DEF_STUBS): New macro.
        (DEF_STUBS): New macro.
        (Stub_type): New enum type.
        (Stub_type): New enum type.
        (Stub_template): New class definition.
        (Stub_template): New class definition.
        (Stub): Same.
        (Stub): Same.
        (Reloc_stub): Same.
        (Reloc_stub): Same.
        (Stub_factory): Same.
        (Stub_factory): Same.
        (Target_arm::Target_arm): Initialize may_use_blx_ and
        (Target_arm::Target_arm): Initialize may_use_blx_ and
        should_force_pic_veneer_.
        should_force_pic_veneer_.
        (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
        (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
        Target_arm::should_force_pic_veneer,
        Target_arm::should_force_pic_veneer,
        Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
        Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
        Target_arm::using_thumb_only, Target_arm:;default_target): New
        Target_arm::using_thumb_only, Target_arm:;default_target): New
        method defintions.
        method defintions.
        (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
        (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
        New data member declarations.
        New data member declarations.
        (Insn_template::size, Insn_template::alignment): New method defintions.
        (Insn_template::size, Insn_template::alignment): New method defintions.
        (Stub_template::Stub_template): New method definition.
        (Stub_template::Stub_template): New method definition.
        (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
        (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
        Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
        Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
        (Stub_factory::Stub_factory): New method definition.
        (Stub_factory::Stub_factory): New method definition.
        * gold.h (string_hash): New template.
        * gold.h (string_hash): New template.
        * output.h (Input_section_specifier::hash_value): Use
        * output.h (Input_section_specifier::hash_value): Use
        gold::string_hash.
        gold::string_hash.
        (Input_section_specifier::string_hash): Remove.
        (Input_section_specifier::string_hash): Remove.
        * stringpool.cc (Stringpool_template::string_hash): Use
        * stringpool.cc (Stringpool_template::string_hash): Use
        gold::string_hash.
        gold::string_hash.
2009-10-20  Doug Kwan  
2009-10-20  Doug Kwan  
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
        symbols of relaxed input sections.
        symbols of relaxed input sections.
        * output.h (Output_section::find_relaxed_input_section): Make
        * output.h (Output_section::find_relaxed_input_section): Make
        method public.
        method public.
2009-10-16  Doug Kwan  
2009-10-16  Doug Kwan  
        * dynobj.cc (Versions::Versions): Initialize version_script_.
        * dynobj.cc (Versions::Versions): Initialize version_script_.
        Only insert base version symbol definition for a shared object
        Only insert base version symbol definition for a shared object
        if version script defines any version versions.
        if version script defines any version versions.
        (Versions::define_base_version): New method definition.
        (Versions::define_base_version): New method definition.
        (Versions::add_def): Check that base version is not needed.
        (Versions::add_def): Check that base version is not needed.
        (Versions::add_need): Define base version lazily.
        (Versions::add_need): Define base version lazily.
        * dynobj.h (Versions::define_base_version): New method declaration.
        * dynobj.h (Versions::define_base_version): New method declaration.
        (Versions::needs_base_version_): New data member declaration.
        (Versions::needs_base_version_): New data member declaration.
        * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
        * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
        (check_DATA): Add no_version_test.stdout.
        (check_DATA): Add no_version_test.stdout.
        (libno_version_test.so, no_version_test.o no_version_test.stdout):
        (libno_version_test.so, no_version_test.o no_version_test.stdout):
        New make rules.
        New make rules.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/no_version_test.c: New file.
        * testsuite/no_version_test.c: New file.
        * testsuite/no_version_test.sh: Ditto.
        * testsuite/no_version_test.sh: Ditto.
2009-10-16  Doug Kwan  
2009-10-16  Doug Kwan  
        * expression.cc (class Segment_start_expression): New class definition.
        * expression.cc (class Segment_start_expression): New class definition.
        (Segment_start_expression::value): New method definition.
        (Segment_start_expression::value): New method definition.
        (script_exp_function_segment_start): Return a new
        (script_exp_function_segment_start): Return a new
        Segment_start_expression.
        Segment_start_expression.
        * gold/script-c.h (script_saw_segment_start_expression): New function
        * gold/script-c.h (script_saw_segment_start_expression): New function
        prototype.
        prototype.
        * script-sections.cc (Script_sections::Script_sections): Initialize
        * script-sections.cc (Script_sections::Script_sections): Initialize
        SAW_SEGMENT_START_EXPRESSION_ to false.
        SAW_SEGMENT_START_EXPRESSION_ to false.
        (Script_sections::set_section_addresses): Use -Ttext, -Tdata
        (Script_sections::set_section_addresses): Use -Ttext, -Tdata
        and -Tbbs options to specify section addresses if given in
        and -Tbbs options to specify section addresses if given in
        command line and no SEGMENT_START expression is seen in a script.
        command line and no SEGMENT_START expression is seen in a script.
        * script-sections.h (Script_sections::saw_segment_start_expression,
        * script-sections.h (Script_sections::saw_segment_start_expression,
        Script_sections::set_saw_segment_start_expression): New method
        Script_sections::set_saw_segment_start_expression): New method
        definition.
        definition.
        (Script_sections::saw_segment_start_expression_): New data member
        (Script_sections::saw_segment_start_expression_): New data member
        declaration.
        declaration.
        * script.cc (script_saw_segment_start_expression): New function.
        * script.cc (script_saw_segment_start_expression): New function.
        * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
        * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
        * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
        * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
        script_test_7.sh and script_test_8.sh.
        script_test_7.sh and script_test_8.sh.
        (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
        (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
        script_test_8.stdout.
        script_test_8.stdout.
        (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
        (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
        (script_test_6, script_test_6.stdout, script_test_7,
        (script_test_6, script_test_6.stdout, script_test_7,
        script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
        script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/script_test_6.sh: New file.
        * testsuite/script_test_6.sh: New file.
        * testsuite/script_test_6.t: Same.
        * testsuite/script_test_6.t: Same.
        * testsuite/script_test_7.sh: Same.
        * testsuite/script_test_7.sh: Same.
        * testsuite/script_test_7.t: Same.
        * testsuite/script_test_7.t: Same.
        * testsuite/script_test_8.sh: Same.
        * testsuite/script_test_8.sh: Same.
2009-10-16  Doug Kwan  
2009-10-16  Doug Kwan  
        * output.cc (Output_segment::set_section_list_address): Cast
        * output.cc (Output_segment::set_section_list_address): Cast
        expressions to unsigned long long type to avoid format warnings.
        expressions to unsigned long long type to avoid format warnings.
2009-10-15  Ian Lance Taylor  
2009-10-15  Ian Lance Taylor  
        * script.cc (Script_options::add_symbol_assignment): Always add a
        * script.cc (Script_options::add_symbol_assignment): Always add a
        dot assignment to script_sections_.
        dot assignment to script_sections_.
        * script-sections.cc (Script_sections::add_dot_assignment):
        * script-sections.cc (Script_sections::add_dot_assignment):
        Initialize if necessary.
        Initialize if necessary.
        * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
        * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
        program headers with no load segment if there is a linker script.
        program headers with no load segment if there is a linker script.
        * layout.cc (Layout::set_segment_offsets): Align the file offset
        * layout.cc (Layout::set_segment_offsets): Align the file offset
        to the segment aligment for -N or -n with no load segment.
        to the segment aligment for -N or -n with no load segment.
        * output.cc (Output_segment::add_output_section): Don't crash if
        * output.cc (Output_segment::add_output_section): Don't crash if
        the first section is a TLS section.
        the first section is a TLS section.
        (Output_segment::set_section_list_addresses): Print an error
        (Output_segment::set_section_list_addresses): Print an error
        message if the address moves backward in a linker script.
        message if the address moves backward in a linker script.
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_input::set_section_addresses): Don't
        (Output_section_element_input::set_section_addresses): Don't
        increase *dot_value for a SHF_TLS/SHT_NOBITS section.
        increase *dot_value for a SHF_TLS/SHT_NOBITS section.
        (Orphan_output_section::set_section_addresses): Likewise.
        (Orphan_output_section::set_section_addresses): Likewise.
2009-10-15  Doug Kwan  
2009-10-15  Doug Kwan  
        * layout.cc (Layout::finish_dynamic_section): Generate tags
        * layout.cc (Layout::finish_dynamic_section): Generate tags
        DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
        DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
        DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
        DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
        used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
        used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
2009-10-14  Ian Lance Taylor  
2009-10-14  Ian Lance Taylor  
        * object.h (class Relocate_info): Add reloc_shdr and data_shdr
        * object.h (class Relocate_info): Add reloc_shdr and data_shdr
        fields.
        fields.
        * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
        * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
        data_shdr fields of relinfo.
        data_shdr fields of relinfo.
        * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
        * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
        (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo.  For
        (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo.  For
        R_386_TLS_LDO_32, adjust based on section flags.
        R_386_TLS_LDO_32, adjust based on section flags.
        (Target_i386::Relocate::fix_up_ldo): Remove.
        (Target_i386::Relocate::fix_up_ldo): Remove.
2009-10-13  Ian Lance Taylor  
2009-10-13  Ian Lance Taylor  
        Add support for -pie.
        Add support for -pie.
        * options.h (class General_options): Add -pie and
        * options.h (class General_options): Add -pie and
        --pic-executable.
        --pic-executable.
        (General_options::output_is_position_independent): Test -pie.
        (General_options::output_is_position_independent): Test -pie.
        (General_options::output_is_executable): Return true if not shared
        (General_options::output_is_executable): Return true if not shared
        and not relocatable.
        and not relocatable.
        (General_options::output_is_pie): Remove.
        (General_options::output_is_pie): Remove.
        * options.cc (General_options::finalize): Reject incompatible uses
        * options.cc (General_options::finalize): Reject incompatible uses
        of -pie.
        of -pie.
        * gold.cc (queue_middle_tasks): A -pie link is not static.
        * gold.cc (queue_middle_tasks): A -pie link is not static.
        * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
        * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
        * symtab.cc (Symbol::final_value_is_known): Return false if
        * symtab.cc (Symbol::final_value_is_known): Return false if
        output_is_position_independent.
        output_is_position_independent.
        * layout.cc (Layout::set_segment_offsets): Start at address 0 if
        * layout.cc (Layout::set_segment_offsets): Start at address 0 if
        output_is_position_independent.
        output_is_position_independent.
        * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
        * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
        output_is_position_independent.
        output_is_position_independent.
        * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
        * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
        output_is_position_independent.
        output_is_position_independent.
        * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
        * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
        two_file_pie_test.
        two_file_pie_test.
        (basic_pie_test.o, basic_pie_test): New targets.
        (basic_pie_test.o, basic_pie_test): New targets.
        (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
        (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
        (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
        (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
        (two_file_pie_test): New target.
        (two_file_pie_test): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * README: Remove note saying that -pie is not supported.
        * README: Remove note saying that -pie is not supported.
2009-10-13  Bernhard Reutner-Fischer  
2009-10-13  Bernhard Reutner-Fischer  
        * options.h (class General_options): Add -init and -fini.
        * options.h (class General_options): Add -init and -fini.
        * layout.cc (Layout::finish_dynamic_section): Emit
        * layout.cc (Layout::finish_dynamic_section): Emit
        given init and fini functions.
        given init and fini functions.
2009-10-13  Sriraman Tallam  
2009-10-13  Sriraman Tallam  
        * gc.h (gc_process_relocs): Check if icf is enabled using new
        * gc.h (gc_process_relocs): Check if icf is enabled using new
        function.
        function.
        * gold.cc (queue_initial_tasks): Likewise.
        * gold.cc (queue_initial_tasks): Likewise.
        (queue_middle_tasks): Likewise.
        (queue_middle_tasks): Likewise.
        * object.cc (do_layout): Likewise.
        * object.cc (do_layout): Likewise.
        * symtab.cc (is_section_folded): Likewise.
        * symtab.cc (is_section_folded): Likewise.
        * main.cc (main): Likewise.
        * main.cc (main): Likewise.
        * reloc.cc (Read_relocs::run): Likewise.
        * reloc.cc (Read_relocs::run): Likewise.
        (Sized_relobj::do_scan_relocs): Likewise.
        (Sized_relobj::do_scan_relocs): Likewise.
        * icf.cc (is_function_ctor_or_dtor): New function.
        * icf.cc (is_function_ctor_or_dtor): New function.
        (Icf::find_identical_sections): Check if function is ctor or dtor when
        (Icf::find_identical_sections): Check if function is ctor or dtor when
        safe icf is chosen.
        safe icf is chosen.
        * options.h (General_options::icf): Change option to be an enum.
        * options.h (General_options::icf): Change option to be an enum.
        (Icf_status): New enum.
        (Icf_status): New enum.
        (icf_enabled): New method.
        (icf_enabled): New method.
        (icf_safe_folding): New method.
        (icf_safe_folding): New method.
        (set_icf_status): New method.
        (set_icf_status): New method.
        (icf_status_): New variable.
        (icf_status_): New variable.
        * (options.cc) (General_options::finalize): Set icf_status_.
        * (options.cc) (General_options::finalize): Set icf_status_.
        * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
        * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
        icf_test and icf_keep_unique_test to use the --icf enum flag.
        icf_test and icf_keep_unique_test to use the --icf enum flag.
        * testsuite/icf_safe_test.sh: New file.
        * testsuite/icf_safe_test.sh: New file.
        * testsuite/icf_safe_test.cc: New file.
        * testsuite/icf_safe_test.cc: New file.
2009-10-12  Sriraman Tallam  
2009-10-12  Sriraman Tallam  
        * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
        * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
        includes to gc.h and icf.h.
        includes to gc.h and icf.h.
        * arm.cc: Include gc.h.
        * arm.cc: Include gc.h.
        * gold.cc: Likewise.
        * gold.cc: Likewise.
        * i386.cc: Likewise.
        * i386.cc: Likewise.
        * powerpc.cc: Likewise.
        * powerpc.cc: Likewise.
        * sparc.cc: Likewise.
        * sparc.cc: Likewise.
        * x86_64.cc: Likewise.
        * x86_64.cc: Likewise.
        * gc.h: Include icf.h.
        * gc.h: Include icf.h.
2009-10-11  Ian Lance Taylor  
2009-10-11  Ian Lance Taylor  
        * plugin.cc: Include "gold.h" before other header files.
        * plugin.cc: Include "gold.h" before other header files.
2009-10-10  Chris Demetriou  
2009-10-10  Chris Demetriou  
        * options.h (Input_file_argument::Input_file_type): New enum.
        * options.h (Input_file_argument::Input_file_type): New enum.
        (Input_file_argument::is_lib_): Replace with...
        (Input_file_argument::is_lib_): Replace with...
        (Input_file_argument::type_): New member.
        (Input_file_argument::type_): New member.
        (Input_file_argument::Input_file_argument): Take Input_file_type
        (Input_file_argument::Input_file_argument): Take Input_file_type
        'type' rather than boolean 'is_lib' as second argument.
        'type' rather than boolean 'is_lib' as second argument.
        (Input_file_argument::is_lib): Use type_.
        (Input_file_argument::is_lib): Use type_.
        (Input_file_argument::is_searched_file): New function.
        (Input_file_argument::is_searched_file): New function.
        (Input_file_argument::may_need_search): Handle is_searched_file.
        (Input_file_argument::may_need_search): Handle is_searched_file.
        * options.cc (General_options::parse_library): Support -l:filename.
        * options.cc (General_options::parse_library): Support -l:filename.
        (General_options::parse_just_symbols): Update for Input_file_argument
        (General_options::parse_just_symbols): Update for Input_file_argument
        changes.
        changes.
        (Command_line::process): Likewise.
        (Command_line::process): Likewise.
        * archive.cc (Archive::get_file_and_offset): Likewise.
        * archive.cc (Archive::get_file_and_offset): Likewise.
        * plugin.cc (Plugin_manager::release_input_file): Likewise.
        * plugin.cc (Plugin_manager::release_input_file): Likewise.
        * script.cc (read_script_file, script_add_file): Likewise.
        * script.cc (read_script_file, script_add_file): Likewise.
        * fileread.cc (Input_file::Input_file): Likewise.
        * fileread.cc (Input_file::Input_file): Likewise.
        (Input_file::will_search_for): Handle is_searched_file.
        (Input_file::will_search_for): Handle is_searched_file.
        (Input_file::open): Likewise.
        (Input_file::open): Likewise.
        * readsyms.cc (Read_symbols::get_name): Likewise.
        * readsyms.cc (Read_symbols::get_name): Likewise.
        * testsuite/Makefile.am (searched_file_test): New test.
        * testsuite/Makefile.am (searched_file_test): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/searched_file_test.cc: New file.
        * testsuite/searched_file_test.cc: New file.
        * testsuite/searched_file_test_lib.cc: New file.
        * testsuite/searched_file_test_lib.cc: New file.
2009-10-09  Andrew Pinski  
2009-10-09  Andrew Pinski  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * descriptor.cc: Include  and "binary-io.h".
        * descriptor.cc: Include  and "binary-io.h".
        (Descriptors::open): Open the files in binary mode always.
        (Descriptors::open): Open the files in binary mode always.
        * script.cc (Lex::get_token): Treat \r as whitespace.
        * script.cc (Lex::get_token): Treat \r as whitespace.
2009-10-09  Ian Lance Taylor  
2009-10-09  Ian Lance Taylor  
        * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
        * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
2009-10-09  Andrew Pinski  
2009-10-09  Andrew Pinski  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * configure.ac: Check for readv function also.
        * configure.ac: Check for readv function also.
        * fileread.cc (readv): Define if not HAVE_READV.
        * fileread.cc (readv): Define if not HAVE_READV.
        * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
        * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
        does not exist.
        does not exist.
        * config.in: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.
        * configure: Regenerate.
2009-10-09  Doug Kwan  
2009-10-09  Doug Kwan  
        * layout.cc (Layout::make_output_section): Call target hook to make
        * layout.cc (Layout::make_output_section): Call target hook to make
        ordinary output section.
        ordinary output section.
        (Layout::finalize): Adjust parameter list of call the
        (Layout::finalize): Adjust parameter list of call the
        Target::may_relax().
        Target::may_relax().
        * layout.h (class Layout::section_list): New method.
        * layout.h (class Layout::section_list): New method.
        * merge.h (Output_merge_base::entsize): Change visibility to public.
        * merge.h (Output_merge_base::entsize): Change visibility to public.
        (Output_merge_base::is_string, Output_merge_base::do_is_string):
        (Output_merge_base::is_string, Output_merge_base::do_is_string):
        New methods.
        New methods.
        (Output_merge_string::do_is_string): New method.
        (Output_merge_string::do_is_string): New method.
        * object.cc (Sized_relobj::do_setup): renamed from
        * object.cc (Sized_relobj::do_setup): renamed from
        Sized_relobj::set_up.
        Sized_relobj::set_up.
        * object.h (Sized_relobj::adjust_shndx,
        * object.h (Sized_relobj::adjust_shndx,
        Sized_relobj::initializ_input_to_output_maps,
        Sized_relobj::initializ_input_to_output_maps,
        Sized_relobj::free_input_to_output_maps): Change visibilities to
        Sized_relobj::free_input_to_output_maps): Change visibilities to
        protected.
        protected.
        (Sized_relobj::setup): Virtualize.
        (Sized_relobj::setup): Virtualize.
        (Sized_relobj::do_setup): New method declaration.
        (Sized_relobj::do_setup): New method declaration.
        (Sized_relobj::invalidate_section_offset,
        (Sized_relobj::invalidate_section_offset,
        Sized_relobj::do_invalidate_section_offset): New method decfinitions.
        Sized_relobj::do_invalidate_section_offset): New method decfinitions.
        (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
        (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
        * options.cc (parse_int): New function.
        * options.cc (parse_int): New function.
        * options.h (parse_int): New declaration.
        * options.h (parse_int): New declaration.
        (DEFINE_int): New macro.
        (DEFINE_int): New macro.
        (stub_group_size): New option.
        (stub_group_size): New option.
        * output.cc (Output_section::Output_section): Initialize memebers
        * output.cc (Output_section::Output_section): Initialize memebers
        merge_section_map_, merge_section_by_properties_map_,
        merge_section_map_, merge_section_by_properties_map_,
        relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
        relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
        (Output_section::add_input_section): Handled deferred code-fill
        (Output_section::add_input_section): Handled deferred code-fill
        generation and remove an old comment.
        generation and remove an old comment.
        (Output_section::add_relaxed_input_section): New method definition.
        (Output_section::add_relaxed_input_section): New method definition.
        (Output_section::add_merge_input_section): Use merge section by
        (Output_section::add_merge_input_section): Use merge section by
        properties map to speed to search.  Update merge section maps
        properties map to speed to search.  Update merge section maps
        as appropriate.
        as appropriate.
        (Output_section::build_relaxation_map): New method definition.
        (Output_section::build_relaxation_map): New method definition.
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        (Output_section::convert_input_sections_in_list_to_relaxed_sections):
        Same.
        Same.
        (Output_section::relax_input_section): Renamed to
        (Output_section::relax_input_section): Renamed to
        Output_section::convert_input_sections_to_relaxed_sections and change
        Output_section::convert_input_sections_to_relaxed_sections and change
        interface to take a vector of pointers to relaxed sections.
        interface to take a vector of pointers to relaxed sections.
        (Output_section::find_merge_section,
        (Output_section::find_merge_section,
        Output_section::find_relaxed_input_section): New method definitions.
        Output_section::find_relaxed_input_section): New method definitions.
        (Output_section::is_input_address_mapped,
        (Output_section::is_input_address_mapped,
        Output_section::output_offset, Output_section::output_address):
        Output_section::output_offset, Output_section::output_address):
        Use output section data maps to speed up searching.
        Use output section data maps to speed up searching.
        (Output_section::find_starting_output_address): Add comments.
        (Output_section::find_starting_output_address): Add comments.
        (Output_section::do_write,
        (Output_section::do_write,
        Output_section::write_to_postprocessing_buffer): Do code-fill
        Output_section::write_to_postprocessing_buffer): Do code-fill
        generation as appropriate.
        generation as appropriate.
        (Output_section::get_input_sections): Invalidate relaxed input section
        (Output_section::get_input_sections): Invalidate relaxed input section
        map.
        map.
        (Output_section::restore_states): Adjust type of checkpoint .
        (Output_section::restore_states): Adjust type of checkpoint .
        Invalidate relaxed input section map.
        Invalidate relaxed input section map.
        * output.h (Output_merge_base): New class declaration.
        * output.h (Output_merge_base): New class declaration.
        (Input_section_specifier): New class defintion.
        (Input_section_specifier): New class defintion.
        (class Output_relaxed_input_section) Change base class to
        (class Output_relaxed_input_section) Change base class to
        Output_section_data_build.
        Output_section_data_build.
        (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
        (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
        base class initializer.
        base class initializer.
        (Output_section::add_relaxed_input_section): New method declaration.
        (Output_section::add_relaxed_input_section): New method declaration.
        (Output_section::Input_section): Change visibility to protected.
        (Output_section::Input_section): Change visibility to protected.
        (Output_section::Input_section::relobj,
        (Output_section::Input_section::relobj,
        Output_section::Input_section::shndx): Handle relaxed input sections.
        Output_section::Input_section::shndx): Handle relaxed input sections.
        Output_section::input_sections) Change visibility to protected.  Also
        Output_section::input_sections) Change visibility to protected.  Also
        define overload to return a non-const pointer.
        define overload to return a non-const pointer.
        (Output_section::Merge_section_properties): New class defintion.
        (Output_section::Merge_section_properties): New class defintion.
        (Output_section::Merge_section_by_properties_map,
        (Output_section::Merge_section_by_properties_map,
        Output_section::Output_section_data_by_input_section_map,
        Output_section::Output_section_data_by_input_section_map,
        Output_section::Relaxation_map): New types.
        Output_section::Relaxation_map): New types.
        (Output_section::relax_input_section): Rename method to
        (Output_section::relax_input_section): Rename method to
        Output_section::convert_input_sections_to_relaxed_sections and change
        Output_section::convert_input_sections_to_relaxed_sections and change
        interface to take a vector of relaxed section pointers.
        interface to take a vector of relaxed section pointers.
        (Output_section::find_merge_section,
        (Output_section::find_merge_section,
        Output_section::find_relaxed_input_section,
        Output_section::find_relaxed_input_section,
        Output_section::build_relaxation_map,
        Output_section::build_relaxation_map,
        Output_section::convert_input_sections_in_list_to_relaxed_sections):
        Output_section::convert_input_sections_in_list_to_relaxed_sections):
        New method declarations.
        New method declarations.
        (Output_section::merge_section_map_
        (Output_section::merge_section_map_
        Output_section::merge_section_by_properties_map_,
        Output_section::merge_section_by_properties_map_,
        Output_section::relaxed_input_section_map_,
        Output_section::relaxed_input_section_map_,
        Output_section::is_relaxed_input_section_map_valid_,
        Output_section::is_relaxed_input_section_map_valid_,
        Output_section::generate_code_fills_at_write_): New data members.
        Output_section::generate_code_fills_at_write_): New data members.
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_input::set_section_addresses): Call
        (Output_section_element_input::set_section_addresses): Call
        current_data_size and addralign methods of relaxed input sections.
        current_data_size and addralign methods of relaxed input sections.
        (Orphan_output_section::set_section_addresses): Call current_data_size
        (Orphan_output_section::set_section_addresses): Call current_data_size
        and addralign methods of relaxed input sections.
        and addralign methods of relaxed input sections.
        * symtab.cc (Symbol_table::compute_final_value): Extract template
        * symtab.cc (Symbol_table::compute_final_value): Extract template
        from the body of Symbol_table::sized_finalize_symbol.
        from the body of Symbol_table::sized_finalize_symbol.
        (Symbol_table::sized_finalized_symbol): Call
        (Symbol_table::sized_finalized_symbol): Call
        Symbol_table::compute_final_value.
        Symbol_table::compute_final_value.
        * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
        * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
        (Symbol_table::compute_final_value): New templated method declaration.
        (Symbol_table::compute_final_value): New templated method declaration.
        * target.cc (Target::do_make_output_section): New method defintion.
        * target.cc (Target::do_make_output_section): New method defintion.
        * target.h (Target::make_output_section): New method declaration.
        * target.h (Target::make_output_section): New method declaration.
        (Target::relax): Add more parameters for input objects, symbol table
        (Target::relax): Add more parameters for input objects, symbol table
        and layout.  Adjust call to do_relax.
        and layout.  Adjust call to do_relax.
        (Target::do_make_output_section): New method declaration.
        (Target::do_make_output_section): New method declaration.
        (Target::do_relax): Add parameters for input objects, symbol table
        (Target::do_relax): Add parameters for input objects, symbol table
        and layout.
        and layout.
2009-10-09  Andrew Pinski  
2009-10-09  Andrew Pinski  
        * pread.c: Include stdio.h.
        * pread.c: Include stdio.h.
2009-10-09  Andrew Pinski  
2009-10-09  Andrew Pinski  
        * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
        * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
        defined.
        defined.
2009-10-09  Andrew Pinski  
2009-10-09  Andrew Pinski  
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        Change read_shndx type to unsigned int.
        Change read_shndx type to unsigned int.
        (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
        (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
        int.
        int.
        (Sized_dwarf_line_info::read_line_mappings): Likewise.
        (Sized_dwarf_line_info::read_line_mappings): Likewise.
        * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
        * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
        Change read_shndx type to unsigned int.
        Change read_shndx type to unsigned int.
        (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
        (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
        int.
        int.
        (Sized_dwarf_line_info::read_line_mappings): Likewise.
        (Sized_dwarf_line_info::read_line_mappings): Likewise.
        * layout.cc (Layout::create_symtab_sections): Cast the result of
        * layout.cc (Layout::create_symtab_sections): Cast the result of
        local_symcount * symsize to off_t in the gold_assert.
        local_symcount * symsize to off_t in the gold_assert.
2009-10-09  Viktor Kutuzov  
2009-10-09  Viktor Kutuzov  
        * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
        * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
        R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
        R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
        R_ARM_BASE_ABS.
        R_ARM_BASE_ABS.
        (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
        (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
        (Arm_relocate_functions::thm_abs5): New function.
        (Arm_relocate_functions::thm_abs5): New function.
        (Arm_relocate_functions::abs12): New function.
        (Arm_relocate_functions::abs12): New function.
        (Arm_relocate_functions::abs16): New function.
        (Arm_relocate_functions::abs16): New function.
        (Arm_relocate_functions::base_abs): New function.
        (Arm_relocate_functions::base_abs): New function.
        (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
        (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
        (Scan::local): Remove special handling of R_ARM_ABS8.  Handle
        (Scan::local): Remove special handling of R_ARM_ABS8.  Handle
        R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
        R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
        R_ARM_BASE_ABS.
        R_ARM_BASE_ABS.
        (Scan::global): Likewise.
        (Scan::global): Likewise.
        (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
        (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
        R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
        R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
        (Relocatable_size_for_reloc::get_size_for_reloc): Handle
        (Relocatable_size_for_reloc::get_size_for_reloc): Handle
        R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
        R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
        R_ARM_BASE_ABS.
        R_ARM_BASE_ABS.
2009-10-09  Viktor Kutuzov  
2009-10-09  Viktor Kutuzov  
        * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
        * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
        (Arm_relocate_functions::movt_prel): New function.
        (Arm_relocate_functions::movt_prel): New function.
        (Arm_relocate_functions::thm_movw_prel_nc): New function.
        (Arm_relocate_functions::thm_movw_prel_nc): New function.
        (Arm_relocate_functions::thm_movt_prel): New function.
        (Arm_relocate_functions::thm_movt_prel): New function.
        (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
        (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
        R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
        R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
        (Scan::global, Relocate::relocate): Likewise.
        (Scan::global, Relocate::relocate): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2009-10-09  Mikolaj Zalewski  
2009-10-09  Mikolaj Zalewski  
        * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
        * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
        Incremental_checker.
        Incremental_checker.
        * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
        * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
        unsigned int.
        unsigned int.
        (class Incremental_inputs_header): New class.
        (class Incremental_inputs_header): New class.
        (Incremental_inputs_header_writer): Edit comment.
        (Incremental_inputs_header_writer): Edit comment.
        (Incremental_inputs_entry): New class.
        (Incremental_inputs_entry): New class.
        (Incremental_inputs_entry_writer): Edit comment.
        (Incremental_inputs_entry_writer): Edit comment.
        (Sized_incremental_binary::do_find_incremental_inputs_section):
        (Sized_incremental_binary::do_find_incremental_inputs_section):
        Add *strtab_shndx parameter, fill it.
        Add *strtab_shndx parameter, fill it.
        (Sized_incremental_binary::do_check_inputs): New method.
        (Sized_incremental_binary::do_check_inputs): New method.
        (Incremental_checker::can_incrementally_link_output_file): Use
        (Incremental_checker::can_incrementally_link_output_file): Use
        Sized_incremental_binary::check_inputs.
        Sized_incremental_binary::check_inputs.
        (Incremental_inputs::report_command_line): Save command line in
        (Incremental_inputs::report_command_line): Save command line in
        command_line_.
        command_line_.
        * incremental.h:
        * incremental.h:
        (Incremental_binary::find_incremental_inputs_section): New
        (Incremental_binary::find_incremental_inputs_section): New
        method.
        method.
        (Incremental_binary::do_find_incremental_inputs_section): Add
        (Incremental_binary::do_find_incremental_inputs_section): Add
        strtab_shndx parameter.
        strtab_shndx parameter.
        (Incremental_binary::do_check_inputs): New pure virtual method.
        (Incremental_binary::do_check_inputs): New pure virtual method.
        (Sized_incremental_binary::do_check_inputs): Declare.
        (Sized_incremental_binary::do_check_inputs): Declare.
        (Incremental_checker::Incremental_checker): Add incremental_inputs
        (Incremental_checker::Incremental_checker): Add incremental_inputs
        parameter, use it to initialize incremental_inputs_.
        parameter, use it to initialize incremental_inputs_.
        (Incremental_checker::incremental_inputs_): New field.
        (Incremental_checker::incremental_inputs_): New field.
        (Incremental_checker::command_line): New method.
        (Incremental_checker::command_line): New method.
        (Incremental_checker::inputs): New method.
        (Incremental_checker::inputs): New method.
        (Incremental_checker::command_line_): New field.
        (Incremental_checker::command_line_): New field.
2009-10-09  Mikolaj Zalewski  
2009-10-09  Mikolaj Zalewski  
        * incremental.cc: Include  and "target-select.h".
        * incremental.cc: Include  and "target-select.h".
        (vexplain_no_incremental): New function.
        (vexplain_no_incremental): New function.
        (explain_no_incremental): New function.
        (explain_no_incremental): New function.
        (Incremental_binary::error): New method.
        (Incremental_binary::error): New method.
        (Sized_incremental_binary::do_find_incremental_inputs_section): New
        (Sized_incremental_binary::do_find_incremental_inputs_section): New
        method.
        method.
        (make_sized_incremental_binary): New function.
        (make_sized_incremental_binary): New function.
        (open_incremental_binary): New function.
        (open_incremental_binary): New function.
        (can_incrementally_link_file): Add checks if output is ELF and has
        (can_incrementally_link_file): Add checks if output is ELF and has
        inputs section.
        inputs section.
        * incremental.h: Include "elfcpp_file.h" and "output.h".
        * incremental.h: Include "elfcpp_file.h" and "output.h".
        (Incremental_binary): New class.
        (Incremental_binary): New class.
        (Sized_incremental_binary): New class.
        (Sized_incremental_binary): New class.
        (open_incremental_binary): Declare.
        (open_incremental_binary): Declare.
        * object.cc (is_elf_object): Use
        * object.cc (is_elf_object): Use
        elfcpp::Elf_recognizer::is_elf_file.
        elfcpp::Elf_recognizer::is_elf_file.
        (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
        (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
        * output.h (Output_file::filesize): New method.
        * output.h (Output_file::filesize): New method.
2009-10-07  Viktor Kutuzov  
2009-10-07  Viktor Kutuzov  
        * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
        * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
        New function.
        New function.
        (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
        (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
        (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
        (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
        function.
        function.
        (Arm_relocate_functions::insert_val_thumb_movw_movt): New
        (Arm_relocate_functions::insert_val_thumb_movw_movt): New
        function.
        function.
        (Arm_relocate_functions::movw_abs_nc): New function.
        (Arm_relocate_functions::movw_abs_nc): New function.
        (Arm_relocate_functions::movt_abs): New function.
        (Arm_relocate_functions::movt_abs): New function.
        (Arm_relocate_functions::thm_movw_abs_nc): New function.
        (Arm_relocate_functions::thm_movw_abs_nc): New function.
        (Arm_relocate_functions::thm_movt_abs): New function.
        (Arm_relocate_functions::thm_movt_abs): New function.
        (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
        (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
        R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
        R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
        (Scan::global): Likewise.
        (Scan::global): Likewise.
        (Relocate::relocate): Likewise.
        (Relocate::relocate): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2009-10-07  Viktor Kutuzov  
2009-10-07  Viktor Kutuzov  
        * arm.cc (Arm_relocate_functions::got_prel) New function.
        * arm.cc (Arm_relocate_functions::got_prel) New function.
        (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
        (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
        (Relocate::relocate): Likewise.
        (Relocate::relocate): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
        (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2009-10-06  Ian Lance Taylor  
2009-10-06  Ian Lance Taylor  
        * options.h (class General_options): Define
        * options.h (class General_options): Define
        split_stack_adjust_size parameter.
        split_stack_adjust_size parameter.
        * object.h (class Object): Add uses_split_stack_ and
        * object.h (class Object): Add uses_split_stack_ and
        has_no_split_stack_ fields.  Add uses_split_stack and
        has_no_split_stack_ fields.  Add uses_split_stack and
        has_no_split_stack accessor functions.  Declare
        has_no_split_stack accessor functions.  Declare
        handle_split_stack_section.
        handle_split_stack_section.
        (class Reloc_symbol_changes): Define.
        (class Reloc_symbol_changes): Define.
        (class Sized_relobj): Define Function_offsets.  Declare
        (class Sized_relobj): Define Function_offsets.  Declare
        split_stack_adjust, split_stack_adjust_reltype, and
        split_stack_adjust, split_stack_adjust_reltype, and
        find_functions.
        find_functions.
        * object.cc (Object::handle_split_stack_section): New function.
        * object.cc (Object::handle_split_stack_section): New function.
        (Sized_relobj::do_layout): Call handle_split_stack_section.
        (Sized_relobj::do_layout): Call handle_split_stack_section.
        * dynobj.cc (Sized_dynobj::do_layout): Call
        * dynobj.cc (Sized_dynobj::do_layout): Call
        handle_split_stack_section.
        handle_split_stack_section.
        * reloc.cc (Sized_relobj::relocate_sections): Call
        * reloc.cc (Sized_relobj::relocate_sections): Call
        split_stack_adjust for executable sections in split_stack
        split_stack_adjust for executable sections in split_stack
        objects.  Pass reloc_map to relocate_section.
        objects.  Pass reloc_map to relocate_section.
        (Sized_relobj::split_stack_adjust): New function.
        (Sized_relobj::split_stack_adjust): New function.
        (Sized_relobj::split_stack_adjust_reltype): New function.
        (Sized_relobj::split_stack_adjust_reltype): New function.
        (Sized_relobj::find_functions): New function.
        (Sized_relobj::find_functions): New function.
        * target-reloc.h: Include "object.h".
        * target-reloc.h: Include "object.h".
        (relocate_section): Add reloc_symbol_changes parameter.  Change
        (relocate_section): Add reloc_symbol_changes parameter.  Change
        all callers.
        all callers.
        * target.h (class Target): Add calls_non_split method.  Declare
        * target.h (class Target): Add calls_non_split method.  Declare
        do_calls_non_split virtual method.  Declare match_view and
        do_calls_non_split virtual method.  Declare match_view and
        set_view_to_nop.
        set_view_to_nop.
        * target.cc: Include "elfcpp.h".
        * target.cc: Include "elfcpp.h".
        (Target::do_calls_non_split): New function.
        (Target::do_calls_non_split): New function.
        (Target::match_view): New function.
        (Target::match_view): New function.
        (Target::set_view_to_nop): New function.
        (Target::set_view_to_nop): New function.
        * gold.cc (queue_middle_tasks): Give an error if mixing
        * gold.cc (queue_middle_tasks): Give an error if mixing
        split-stack and non-split-stack objects with -r.
        split-stack and non-split-stack objects with -r.
        * i386.cc (Target_i386::relocate_section): Add
        * i386.cc (Target_i386::relocate_section): Add
        reloc_symbol_changes parameter.
        reloc_symbol_changes parameter.
        (Target_i386::do_calls_non_split): New function.
        (Target_i386::do_calls_non_split): New function.
        * x86_64.cc (Target_x86_64::relocate_section): Add
        * x86_64.cc (Target_x86_64::relocate_section): Add
        reloc_symbol_changes parameter.
        reloc_symbol_changes parameter.
        (Target_x86_64::do_calls_non_split): New function.
        (Target_x86_64::do_calls_non_split): New function.
        * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
        * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
        parameter.
        parameter.
        * powerpc.cc (Target_powerpc::relocate_section): Add
        * powerpc.cc (Target_powerpc::relocate_section): Add
        reloc_symbol_changes parameter.
        reloc_symbol_changes parameter.
        * sparc.cc (Target_sparc::relocate_section): Add
        * sparc.cc (Target_sparc::relocate_section): Add
        reloc_symbol_changes parameter.
        reloc_symbol_changes parameter.
        * configure.ac: Call AM_CONDITIONAL for the default target.
        * configure.ac: Call AM_CONDITIONAL for the default target.
        * configure: Rebuild.
        * configure: Rebuild.
        * testsuite/Makefile.am (TEST_AS): New variable.
        * testsuite/Makefile.am (TEST_AS): New variable.
        (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
        (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
        (check_DATA): Add split_i386 and split_x86_64 files.
        (check_DATA): Add split_i386 and split_x86_64 files.
        (SPLIT_DEFSYMS): Define.
        (SPLIT_DEFSYMS): Define.
        (split_i386_[1234n].o): New targets.
        (split_i386_[1234n].o): New targets.
        (split_i386_[124]): New targets.
        (split_i386_[124]): New targets.
        (split_i386_[1234r].stdout): New targets.
        (split_i386_[1234r].stdout): New targets.
        (split_x86_64_[1234n].o): New targets.
        (split_x86_64_[1234n].o): New targets.
        (split_x86_64_[124]): New targets.
        (split_x86_64_[124]): New targets.
        (split_x86_64_[1234r].stdout): New targets.
        (split_x86_64_[1234r].stdout): New targets.
        (MOSTLYCLEANFILES): Add new executables.
        (MOSTLYCLEANFILES): Add new executables.
        * testsuite/split_i386.sh: New file.
        * testsuite/split_i386.sh: New file.
        * testsuite/split_x86_64.sh: New file.
        * testsuite/split_x86_64.sh: New file.
        * testsuite/split_i386_1.s: New file.
        * testsuite/split_i386_1.s: New file.
        * testsuite/split_i386_2.s: New file.
        * testsuite/split_i386_2.s: New file.
        * testsuite/split_i386_3.s: New file.
        * testsuite/split_i386_3.s: New file.
        * testsuite/split_i386_4.s: New file.
        * testsuite/split_i386_4.s: New file.
        * testsuite/split_i386_n.s: New file.
        * testsuite/split_i386_n.s: New file.
        * testsuite/split_x86_64_1.s: New file.
        * testsuite/split_x86_64_1.s: New file.
        * testsuite/split_x86_64_2.s: New file.
        * testsuite/split_x86_64_2.s: New file.
        * testsuite/split_x86_64_3.s: New file.
        * testsuite/split_x86_64_3.s: New file.
        * testsuite/split_x86_64_4.s: New file.
        * testsuite/split_x86_64_4.s: New file.
        * testsuite/split_x86_64_n.s: New file.
        * testsuite/split_x86_64_n.s: New file.
        * testsuite/testfile.cc (Target_test): Update relocation_section
        * testsuite/testfile.cc (Target_test): Update relocation_section
        function.
        function.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2009-10-06  Ian Lance Taylor  
2009-10-06  Ian Lance Taylor  
        * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
        * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
        (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
        (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
        changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE.  When
        changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE.  When
        handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
        handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
        the address on ldo_addrs_.
        the address on ldo_addrs_.
        (Target_i386::Relocate::fix_up_ldo): New function.
        (Target_i386::Relocate::fix_up_ldo): New function.
2009-10-06   Rafael Espindola  
2009-10-06   Rafael Espindola  
        * plugin.cc (add_input_library): New.
        * plugin.cc (add_input_library): New.
        (Plugin::load): Add add_input_library to tv.
        (Plugin::load): Add add_input_library to tv.
        (Plugin_manager::add_input_file): Add the is_lib argument.
        (Plugin_manager::add_input_file): Add the is_lib argument.
        (add_input_file): Update call to Plugin_manager::add_input_file.
        (add_input_file): Update call to Plugin_manager::add_input_file.
        (add_input_library): New.
        (add_input_library): New.
        * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
        * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
2009-09-30  Doug Kwan  
2009-09-30  Doug Kwan  
        * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
        * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
        symbol and call Symbol::may_need_copy_reloc to determine if
        symbol and call Symbol::may_need_copy_reloc to determine if
        a copy reloc is needed.
        a copy reloc is needed.
        * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
        * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
        nocopyreloc is given in command line.
        nocopyreloc is given in command line.
        (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
        (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
        given in command line.
        given in command line.
        * i386.cc (Target_i386::may_need_copy_reloc): Remove.
        * i386.cc (Target_i386::may_need_copy_reloc): Remove.
        (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
        (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
        of the removed Target_i386::may_need_copy_reloc.
        of the removed Target_i386::may_need_copy_reloc.
        * options.h (copyreloc): New option with default value false.
        * options.h (copyreloc): New option with default value false.
        * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
        * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
        (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
        (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
        instead of the removed Target_powerpc::may_need_copy_reloc.
        instead of the removed Target_powerpc::may_need_copy_reloc.
        * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
        * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
        (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
        (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
        instead of the removed Target_sparc::may_need_copy_reloc.
        instead of the removed Target_sparc::may_need_copy_reloc.
        * symtab.h (Symbol::may_need_copy_reloc): New method definition.
        * symtab.h (Symbol::may_need_copy_reloc): New method definition.
        * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
        * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
        (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
        (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
        instead of the removed Target_x86_64::may_need_copy_reloc.
        instead of the removed Target_x86_64::may_need_copy_reloc.
2009-09-30  Ian Lance Taylor  
2009-09-30  Ian Lance Taylor  
        * object.h (class Object): Remove target_ field, and target,
        * object.h (class Object): Remove target_ field, and target,
        sized_target, and set_target methods.
        sized_target, and set_target methods.
        (Object::sized_target): Remove.
        (Object::sized_target): Remove.
        (class Sized_relobj): Update declarations.  Remove sized_target.
        (class Sized_relobj): Update declarations.  Remove sized_target.
        * object.cc (Sized_relobj::setup): Remove target parameter.
        * object.cc (Sized_relobj::setup): Remove target parameter.
        Change all callers.
        Change all callers.
        (Input_objects::add_object): Don't do anything with the target.
        (Input_objects::add_object): Don't do anything with the target.
        (make_elf_sized_object): Add punconfigured parameter.  Change all
        (make_elf_sized_object): Add punconfigured parameter.  Change all
        callers.  Set or test parameter target.
        callers.  Set or test parameter target.
        * dynobj.cc (Sized_dynobj::target): Remove target parameter.
        * dynobj.cc (Sized_dynobj::target): Remove target parameter.
        Change all callers.
        Change all callers.
        * parameters.cc (Parameters::set_target): Change parameter type to
        * parameters.cc (Parameters::set_target): Change parameter type to
        be non-const.
        be non-const.
        (Parameters::default_target): Remove.
        (Parameters::default_target): Remove.
        (set_parameters_target): Change parameter type to be non-const.
        (set_parameters_target): Change parameter type to be non-const.
        (parameters_force_valid_target): New function.
        (parameters_force_valid_target): New function.
        (parameters_clear_target): New function.
        (parameters_clear_target): New function.
        * parameters.h (class Parameters): Update declarations.  Remove
        * parameters.h (class Parameters): Update declarations.  Remove
        default_target method.  Add sized_target and clear_target
        default_target method.  Add sized_target and clear_target
        methods.  Change target_ to be non-const.
        methods.  Change target_ to be non-const.
        (set_parameters_target): Update declaration.
        (set_parameters_target): Update declaration.
        (parameters_force_valid_target): Declare.
        (parameters_force_valid_target): Declare.
        (parameters_clear_target): Declare.
        (parameters_clear_target): Declare.
        * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
        * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
        as NULL if we aren't searching.
        as NULL if we aren't searching.
        (Add_symbols::run): Don't check for compatible target.
        (Add_symbols::run): Don't check for compatible target.
        * fileread.cc (Input_file::open_binary): Call
        * fileread.cc (Input_file::open_binary): Call
        parameters_force_valid_target.
        parameters_force_valid_target.
        * gold.cc (queue_middle_tasks): Likewise.
        * gold.cc (queue_middle_tasks): Likewise.
        * plugin.cc (make_sized_plugin_object): Likewise.  Don't call
        * plugin.cc (make_sized_plugin_object): Likewise.  Don't call
        set_target on object.
        set_target on object.
        * dynobj.h (class Sized_dynobj): Update declarations.
        * dynobj.h (class Sized_dynobj): Update declarations.
        * archive.cc (Archive::get_elf_object_for_member): Return NULL if
        * archive.cc (Archive::get_elf_object_for_member): Return NULL if
        make_elf_object returns NULL.
        make_elf_object returns NULL.
        (Archive::include_member): Don't check whether object target is
        (Archive::include_member): Don't check whether object target is
        compatible.
        compatible.
        * output.cc (Output_section::add_input_section): Get target from
        * output.cc (Output_section::add_input_section): Get target from
        parameters.
        parameters.
        (Output_section::relax_input_section): Likewise.
        (Output_section::relax_input_section): Likewise.
        * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
        * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
        parameters.
        parameters.
        (Sized_relobj::do_scan_relocs): Likewise.
        (Sized_relobj::do_scan_relocs): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        * resolve.cc (Symbol_table::resolve): Likewise.
        * resolve.cc (Symbol_table::resolve): Likewise.
        * symtab.cc (Symbol_table::wrap_symbol): Likewise.  Remove object
        * symtab.cc (Symbol_table::wrap_symbol): Likewise.  Remove object
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol_table::add_from_object): Get target from parameters.
        (Symbol_table::add_from_object): Get target from parameters.
        (Symbol_table::add_from_relobj): Don't check object target.
        (Symbol_table::add_from_relobj): Don't check object target.
        (Symbol_table::add_from_dynobj): Likewise.
        (Symbol_table::add_from_dynobj): Likewise.
        (Symbol_table::define_special_symbol): Get target from
        (Symbol_table::define_special_symbol): Get target from
        parameters.
        parameters.
        * symtab.h (class Symbol_table): Update declaration.
        * symtab.h (class Symbol_table): Update declaration.
        * testsuite/binary_unittest.cc (gold_testsuite): Remove target
        * testsuite/binary_unittest.cc (gold_testsuite): Remove target
        parameter.  Change all callers.  Clear parameter target.
        parameter.  Change all callers.  Clear parameter target.
        (Binary_test): Test target here.
        (Binary_test): Test target here.
        * testsuite/object_unittest.cc (gold_testsuite): Remove
        * testsuite/object_unittest.cc (gold_testsuite): Remove
        target_test_pointer parameter.  Change all callers.
        target_test_pointer parameter.  Change all callers.
        (Object_test): Test target here.
        (Object_test): Test target here.
2009-09-26  Ian Lance Taylor  
2009-09-26  Ian Lance Taylor  
        * testsuite/initpri1.c: Don't try to use constructor priorities if
        * testsuite/initpri1.c: Don't try to use constructor priorities if
        compiling with gcc before 4.3.
        compiling with gcc before 4.3.
2009-09-22  Mikolaj Zalewski  
2009-09-22  Mikolaj Zalewski  
        * testsuite/retain_symbols_file_test.sh (check_present): Change
        * testsuite/retain_symbols_file_test.sh (check_present): Change
        output file name to retain_symbols_file_test.stdout.
        output file name to retain_symbols_file_test.stdout.
        (check_absent): Likewise.
        (check_absent): Likewise.
2009-09-18  Craig Silverstein  
2009-09-18  Craig Silverstein  
        * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
        * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
        * options.cc: Include  and .
        * options.cc: Include  and .
        (General_options::finalize): Parse -retain-symbols-file tag.
        (General_options::finalize): Parse -retain-symbols-file tag.
        * options.h: New flag.
        * options.h: New flag.
        (General_options): New method should_retain_symbol, new
        (General_options): New method should_retain_symbol, new
        variable symbols_to_retain.
        variable symbols_to_retain.
        * symtab.cc (Symbol_table::sized_finalize_symbol): Test
        * symtab.cc (Symbol_table::sized_finalize_symbol): Test
        should_retain_symbol map.
        should_retain_symbol map.
        * testsuite/Makefile.am (retain_symbols_file_test): New test.
        * testsuite/Makefile.am (retain_symbols_file_test): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/retain_symbols_file_test.sh: New file.
        * testsuite/retain_symbols_file_test.sh: New file.
2009-09-18  Nick Clifton  
2009-09-18  Nick Clifton  
        * po/es.po: Updated Spanish translation.
        * po/es.po: Updated Spanish translation.
2009-09-17  Doug Kwan  
2009-09-17  Doug Kwan  
        * debug.h (DEBUG_RELAXATION): New constant.
        * debug.h (DEBUG_RELAXATION): New constant.
        (DEBUG_ALL): Add DEBUG_RELAXATION.
        (DEBUG_ALL): Add DEBUG_RELAXATION.
        (debug_string_to_enum): Add relaxation debug option.
        (debug_string_to_enum): Add relaxation debug option.
        * layout.cc
        * layout.cc
        (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
        (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
        Layout::Relaxation_debug_check::read_sections,
        Layout::Relaxation_debug_check::read_sections,
        Layout::Relaxation_debug_check::read_sections): New method definitions.
        Layout::Relaxation_debug_check::read_sections): New method definitions.
        (Layout::Layout): Initialize data members
        (Layout::Layout): Initialize data members
        record_output_section_data_from_scrips_,
        record_output_section_data_from_scrips_,
        script_output_section_data_list_ and relaxation_debug_check_.
        script_output_section_data_list_ and relaxation_debug_check_.
        (Layout::save_segments, Layout::restore_segments,
        (Layout::save_segments, Layout::restore_segments,
        Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
        Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
        Layout::relaxation_loop_body): New method definitions.
        Layout::relaxation_loop_body): New method definitions.
        (Layout::finalize): Support relaxation.  Move section layout code to
        (Layout::finalize): Support relaxation.  Move section layout code to
        Layout::relaxation_loop_body.
        Layout::relaxation_loop_body.
        (Layout::set_asection_address_from_script): Move code for orphan
        (Layout::set_asection_address_from_script): Move code for orphan
        section placement out.
        section placement out.
        (Layout::place_orphan_sections_in_script): New method definition.
        (Layout::place_orphan_sections_in_script): New method definition.
        * layout.h (Output_segment_headers, Output_file_header):
        * layout.h (Output_segment_headers, Output_file_header):
        New forward class declarations.
        New forward class declarations.
        (Layout::~Layout): Define.
        (Layout::~Layout): Define.
        (Layout::new_output_section_data_from_script): New method definition.
        (Layout::new_output_section_data_from_script): New method definition.
        (Layout::place_orphan_sections_in_script): New method declaration.
        (Layout::place_orphan_sections_in_script): New method declaration.
        (Layout::Segment_states): New type declaration.
        (Layout::Segment_states): New type declaration.
        (Layout::save_segments, Layout::restore_segments,
        (Layout::save_segments, Layout::restore_segments,
        Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
        Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
        Layout::relaxation_loop_body): New method declarations.
        Layout::relaxation_loop_body): New method declarations.
        (Layout::Output_section_data_list): New type declaration.
        (Layout::Output_section_data_list): New type declaration.
        (Layout::Relaxation_debug_check): New class definition.
        (Layout::Relaxation_debug_check): New class definition.
        (Layout::record_output_section_data_from_script_,
        (Layout::record_output_section_data_from_script_,
        Layout::script_output_section_data_list_, Layout::segment_states_,
        Layout::script_output_section_data_list_, Layout::segment_states_,
        Layout::relaxation_debug_check_): New data members.
        Layout::relaxation_debug_check_): New data members.
        * output.cc: (Output_section_headers::do_size): New method definition.
        * output.cc: (Output_section_headers::do_size): New method definition.
        (Output_section_headers::Output_section_headers): Move size
        (Output_section_headers::Output_section_headers): Move size
        computation to Output_section_headers::do_size.
        computation to Output_section_headers::do_size.
        (Output_segment_headers::do_size): New method definition.
        (Output_segment_headers::do_size): New method definition.
        (Output_file_header::Output_file_header): Move size computation to
        (Output_file_header::Output_file_header): Move size computation to
        Output_file_header::do_size and call it.
        Output_file_header::do_size and call it.
        (Output_file_header::do_size): New method definition.
        (Output_file_header::do_size): New method definition.
        (Output_data_group::Output_data_group): Adjust call to
        (Output_data_group::Output_data_group): Adjust call to
        Output_section_data.
        Output_section_data.
        (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
        (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
        (Output_symtab_xindex::do_write): Add array bound check.
        (Output_symtab_xindex::do_write): Add array bound check.
        (Output_section::Input_section::print_to_mapfile): Handle
        (Output_section::Input_section::print_to_mapfile): Handle
        RELAXED_INPUT_SECTION_CODE.
        RELAXED_INPUT_SECTION_CODE.
        (Output_section::Output_section): Initialize data member checkpoint_.
        (Output_section::Output_section): Initialize data member checkpoint_.
        (Output_section::~Output_section): Delete checkpoint object pointed
        (Output_section::~Output_section): Delete checkpoint object pointed
        by checkpoint_.
        by checkpoint_.
        (Output_section::add_input_section): Always add an Input_section if
        (Output_section::add_input_section): Always add an Input_section if
        relaxing.
        relaxing.
        (Output_section::add_merge_input_section): Add assert.
        (Output_section::add_merge_input_section): Add assert.
        (Output_section::relax_input_section): New method definition.
        (Output_section::relax_input_section): New method definition.
        (Output_section::set_final_data_size): Set load address to zero for
        (Output_section::set_final_data_size): Set load address to zero for
        an unallocated section.
        an unallocated section.
        (Output_section::do_address_and_file_offset_have_reset_values):
        (Output_section::do_address_and_file_offset_have_reset_values):
        New method definition.
        New method definition.
        (Output_section::Input_section_sort_enty::Input_section_sort_enty):
        (Output_section::Input_section_sort_enty::Input_section_sort_enty):
        Handle relaxed input section.
        Handle relaxed input section.
        (Output_section::sort_attached_input_sections): Checkpoint input
        (Output_section::sort_attached_input_sections): Checkpoint input
        section list lazily.
        section list lazily.
        (Output_section::get_input_sections): Change type of input_sections to
        (Output_section::get_input_sections): Change type of input_sections to
        list of Simple_input_section pointers.  Checkpoint input section list
        list of Simple_input_section pointers.  Checkpoint input section list
        lazily.  Also handle relaxed input sections.
        lazily.  Also handle relaxed input sections.
        (Output_section::add_input_section_for_script): Take a reference to
        (Output_section::add_input_section_for_script): Take a reference to
        a Simple_input_section object instead of Relobj pointer and section
        a Simple_input_section object instead of Relobj pointer and section
        index as parameter.  Handle relaxed input sections.
        index as parameter.  Handle relaxed input sections.
        (Output_section::save_states, Output_section::restore_states): New
        (Output_section::save_states, Output_section::restore_states): New
        method definitions.
        method definitions.
        * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
        * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
        (Output_data::is_data_size_fixed): New method definition.
        (Output_data::is_data_size_fixed): New method definition.
        (Output_data::reset_addresss_and_file_offset): Do not reset data size
        (Output_data::reset_addresss_and_file_offset): Do not reset data size
        if it is fixed.
        if it is fixed.
        (Output_data::address_and_file_offset_have_reset_values): New method
        (Output_data::address_and_file_offset_have_reset_values): New method
        definition.
        definition.
        (Output_data::do_address_and_file_offset_have_reset_values): New method
        (Output_data::do_address_and_file_offset_have_reset_values): New method
        definition.
        definition.
        (Output_data::set_data_size): Check that data size is not fixed.
        (Output_data::set_data_size): Check that data size is not fixed.
        (Output_data::fix_data_size): New method definition.
        (Output_data::fix_data_size): New method definition.
        (Output_data::is_data_size_fixed_): New data member.
        (Output_data::is_data_size_fixed_): New data member.
        (Output_section_headers::set_final_data_size): New method definition.
        (Output_section_headers::set_final_data_size): New method definition.
        (Output_section_headers::do_size): New method declaration.
        (Output_section_headers::do_size): New method declaration.
        (Output_segment_headers::set_final_data_size): New method definition.
        (Output_segment_headers::set_final_data_size): New method definition.
        (Output_segment_headers::do_size): New method declaration.
        (Output_segment_headers::do_size): New method declaration.
        (Output_file_header::set_final_data_size)::New method definition.
        (Output_file_header::set_final_data_size)::New method definition.
        (Output_file_header::do_size)::New method declaration.
        (Output_file_header::do_size)::New method declaration.
        (Output_section_data::Output_section_data): Add new parameter
        (Output_section_data::Output_section_data): Add new parameter
        is_data_size_fixed and use it to fix data size.
        is_data_size_fixed and use it to fix data size.
        (Output_data_const::Output_data_const): Adjust call to base class
        (Output_data_const::Output_data_const): Adjust call to base class
        constructor and fix data size.
        constructor and fix data size.
        (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
        (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
        base class constructor and fix data size.
        base class constructor and fix data size.
        (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
        (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
        base class constructor and fix data size.
        base class constructor and fix data size.
        (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
        (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
        class constructor and fix data size.
        class constructor and fix data size.
        (Output_data_group::set_final_data_size): New method definition.
        (Output_data_group::set_final_data_size): New method definition.
        (Output_data_dynamic::Dynamic_entry::tag): New method definition.
        (Output_data_dynamic::Dynamic_entry::tag): New method definition.
        (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
        (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
        class constructor and fix data size.
        class constructor and fix data size.
        (Output_relaxed_input_section): New class definition.
        (Output_relaxed_input_section): New class definition.
        (Output_section::Simple_input_section): New class definition.
        (Output_section::Simple_input_section): New class definition.
        (Output_section::get_input_sections): Adjust parameter list.
        (Output_section::get_input_sections): Adjust parameter list.
        (Output_section::add_input_section_for_script): Same.
        (Output_section::add_input_section_for_script): Same.
        (Output_section::save_states, Output_section::restore_states,
        (Output_section::save_states, Output_section::restore_states,
        Output_section::do_address_and_file_offset_have_reset_values,
        Output_section::do_address_and_file_offset_have_reset_values,
        (Output_section::Input_section::Input_section): Handle
        (Output_section::Input_section::Input_section): Handle
        RELAXED_INPUT_SECTION_CODE.  Add new overload for
        RELAXED_INPUT_SECTION_CODE.  Add new overload for
        Output_relaxed_input_section.
        Output_relaxed_input_section.
        (Output_section::Input_section::is_input_section,
        (Output_section::Input_section::is_input_section,
        Output_section::Input_section::set_output_section): Handle relaxed
        Output_section::Input_section::set_output_section): Handle relaxed
        input section.
        input section.
        (Output_section::Input_section::is_relaxed_input_section,
        (Output_section::Input_section::is_relaxed_input_section,
        Output_section::Input_section::output_section_data,
        Output_section::Input_section::output_section_data,
        Output_section::Input_section::relaxed_input_section): New method
        Output_section::Input_section::relaxed_input_section): New method
        definitions.
        definitions.
        (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
        (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
        value.
        value.
        (Output_section::Input_section::u1_): Update comments.
        (Output_section::Input_section::u1_): Update comments.
        (Output_section::Input_section::u2_): Add new union member poris.
        (Output_section::Input_section::u2_): Add new union member poris.
        (Output_section::Checkpoint_output_section): New classs definition.
        (Output_section::Checkpoint_output_section): New classs definition.
        (Output_section::relax_input_section): New method declaration.
        (Output_section::relax_input_section): New method declaration.
        (Output_section::checkpoint_): New data member.
        (Output_section::checkpoint_): New data member.
        (Output_segment): Update comments.
        (Output_segment): Update comments.
        (Output_segment::Output_segment): Un-privatize copy constructor.
        (Output_segment::Output_segment): Un-privatize copy constructor.
        (Output_segment::operator=): Un-privatize.
        (Output_segment::operator=): Un-privatize.
        * script-sections.cc (Output_section_element::Input_section_list):
        * script-sections.cc (Output_section_element::Input_section_list):
        Change element type to Output_section::Simple_input_section.
        Change element type to Output_section::Simple_input_section.
        (Output_section_element_dot_assignment::set_section_addresses):
        (Output_section_element_dot_assignment::set_section_addresses):
        Register output section data for relaxation clean up.
        Register output section data for relaxation clean up.
        (Output_data_exression::Output_data_expression): Adjust call to base
        (Output_data_exression::Output_data_expression): Adjust call to base
        constructor to fix data size.
        constructor to fix data size.
        (Output_section_element_data::set_section_addresses): Register
        (Output_section_element_data::set_section_addresses): Register
        Output_data_expression object for relaxation clean up.
        Output_data_expression object for relaxation clean up.
        (struct Input_section_info): Replace Relobj pointer and section index
        (struct Input_section_info): Replace Relobj pointer and section index
        pair with Output_section::Simple_input_section and Convert struct to a
        pair with Output_section::Simple_input_section and Convert struct to a
        class.
        class.
        (Input_section_sorter::operator()): Adjust access to
        (Input_section_sorter::operator()): Adjust access to
        Input_section_info data member to use accessors.
        Input_section_info data member to use accessors.
        (Output_section_element_input::set_section_addresses): Use layout
        (Output_section_element_input::set_section_addresses): Use layout
        parameter.  Adjust code to use Output_section::Simple_input_section
        parameter.  Adjust code to use Output_section::Simple_input_section
        and Input_secction_info classes.  Register filler for relaxation
        and Input_secction_info classes.  Register filler for relaxation
        clean up.
        clean up.
        (Orphan_output_section::set_section_addresses): Replace Relobj pointer
        (Orphan_output_section::set_section_addresses): Replace Relobj pointer
        and section index pair with Output_section::Simple_input_section
        and section index pair with Output_section::Simple_input_section
        class.  Adjust code accordingly.
        class.  Adjust code accordingly.
        (Phdrs_element::release_segment): New method definition.
        (Phdrs_element::release_segment): New method definition.
        (Script_sections::attach_sections_using_phdrs_clause): Do not modify
        (Script_sections::attach_sections_using_phdrs_clause): Do not modify
        segment list.
        segment list.
        (Script_sections::release_segments): New method definition.
        (Script_sections::release_segments): New method definition.
        * gold/script-sections.h (Script_sections::release_segments): New
        * gold/script-sections.h (Script_sections::release_segments): New
        method declaration.
        method declaration.
        * gold/target.h (Target::may_relax, Target::relax,
        * gold/target.h (Target::may_relax, Target::relax,
        Target::do_may_relax, Target::do_relax): New method definitions.
        Target::do_may_relax, Target::do_relax): New method definitions.
2009-09-17  Viktor Kutuzov  
2009-09-17  Viktor Kutuzov  
        * arm.cc (has_signed_unsigned_overflow): New function.
        * arm.cc (has_signed_unsigned_overflow): New function.
        (Arm_relocate_functions::abs8): New function.
        (Arm_relocate_functions::abs8): New function.
        (Target_arm::Scan::local): Handle R_ARM_ABS8.
        (Target_arm::Scan::local): Handle R_ARM_ABS8.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::Scan::global): Likewise.
        (Target_arm::relocate::relocate): Likewise.
        (Target_arm::relocate::relocate): Likewise.
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
        Likewise.
        Likewise.
2009-09-16  Cary Coutant  
2009-09-16  Cary Coutant  
        * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
        * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-09-11  Nick Clifton  
2009-09-11  Nick Clifton  
        * po/gold.pot: Updated by the Translation project.
        * po/gold.pot: Updated by the Translation project.
2009-09-08  Cary Coutant  
2009-09-08  Cary Coutant  
        * output.cc (Output_file::open): Add execute permission to empty file.
        * output.cc (Output_file::open): Add execute permission to empty file.
        * testsuite/Makefile.am (permission_test): New test.
        * testsuite/Makefile.am (permission_test): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-09-02  Ian Lance Taylor  
2009-09-02  Ian Lance Taylor  
        * output.cc (Output_file::resize): Call map_no_anonymous rather
        * output.cc (Output_file::resize): Call map_no_anonymous rather
        than map.
        than map.
2009-09-01  Mikolaj Zalewski  
2009-09-01  Mikolaj Zalewski  
        * gold.cc: Include "incremental.h".
        * gold.cc: Include "incremental.h".
        (queue_initial_tasks): Call Incremental_checker methods.
        (queue_initial_tasks): Call Incremental_checker methods.
        * incremental.cc: Include "output.h".
        * incremental.cc: Include "output.h".
        (Incremental_checker::can_incrementally_link_output_file): New
        (Incremental_checker::can_incrementally_link_output_file): New
        method.
        method.
        * incremental.h (Incremental_checker): New class.
        * incremental.h (Incremental_checker): New class.
        * output.cc (Output_file::open_for_modification): New method.
        * output.cc (Output_file::open_for_modification): New method.
        (Output_file::map_anonymous): Changed return type to bool.  Record
        (Output_file::map_anonymous): Changed return type to bool.  Record
        map in base_ field.
        map in base_ field.
        (Output_file::map_no_anonymous): New method, broken out of map.
        (Output_file::map_no_anonymous): New method, broken out of map.
        (Output_file::map): Use map_no_anonymous and map_anonymous.
        (Output_file::map): Use map_no_anonymous and map_anonymous.
        * output.h (class Output_file): Update declarations.
        * output.h (class Output_file): Update declarations.
2009-08-24  Cary Coutant  
2009-08-24  Cary Coutant  
        * options.h (Command_line::Pre_options): New class.
        * options.h (Command_line::Pre_options): New class.
        (Command_line::pre_options): New member.
        (Command_line::pre_options): New member.
        * options.cc (gold::options::ready_to_register): New variable.
        * options.cc (gold::options::ready_to_register): New variable.
        (One_option::register_option): Do nothing if not registering options.
        (One_option::register_option): Do nothing if not registering options.
        Assert if same short option registered twice.
        Assert if same short option registered twice.
        (General_options::General_options): Turn off option registration when
        (General_options::General_options): Turn off option registration when
        done constructing.
        done constructing.
        (Command_line::Pre_options::Pre_options): New constructor.
        (Command_line::Pre_options::Pre_options): New constructor.
2009-08-24  Cary Coutant  
2009-08-24  Cary Coutant  
        * options.h (General_options::no_keep_memory): Remove incorrect
        * options.h (General_options::no_keep_memory): Remove incorrect
        short option.
        short option.
2009-08-24  Ralf Wildenhues  
2009-08-24  Ralf Wildenhues  
        * Makefile.am (am__skiplex, am__skipyacc): New.
        * Makefile.am (am__skiplex, am__skipyacc): New.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
2009-08-22  Ralf Wildenhues  
2009-08-22  Ralf Wildenhues  
        * Makefile.am (AM_CPPFLAGS): Renamed from ...
        * Makefile.am (AM_CPPFLAGS): Renamed from ...
        (INCLUDES): ... this.
        (INCLUDES): ... this.
        * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
        * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
        (AM_CPPFLAGS): Renamed from ...
        (AM_CPPFLAGS): Renamed from ...
        (INCLUDE): ... this.
        (INCLUDE): ... this.
        * Makefile.in, testsuite/Makefile.in: Regenerate.
        * Makefile.in, testsuite/Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * aclocal.m4: Likewise.
        * aclocal.m4: Likewise.
        * config.in: Likewise.
        * config.in: Likewise.
        * configure: Likewise.
        * configure: Likewise.
        * testsuite/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.
        * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
        * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
        * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
        * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-08-19  Cary Coutant  
2009-08-19  Cary Coutant  
        * resolve.cc (Symbol_table::resolve): Don't complain about defined
        * resolve.cc (Symbol_table::resolve): Don't complain about defined
        symbols in shared libraries overridden by hidden or internal symbols
        symbols in shared libraries overridden by hidden or internal symbols
        in the main program.
        in the main program.
2009-08-19  Chris Demetriou  
2009-08-19  Chris Demetriou  
        * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
        * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
        checking source file names in error messages.
        checking source file names in error messages.
2009-08-18  Doug Kwan  
2009-08-18  Doug Kwan  
        * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
        * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
        an elcpp::Ehdr as parameter.  Adjust call to set_target.
        an elcpp::Ehdr as parameter.  Adjust call to set_target.
        * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
        * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
        an elfcpp::Ehdr as parameter.
        an elfcpp::Ehdr as parameter.
        * object.cc (Object::set_target): Remove the version that looks up
        * object.cc (Object::set_target): Remove the version that looks up
        a target and sets it.
        a target and sets it.
        (Sized_relobj::setup): Take a Target object instead of
        (Sized_relobj::setup): Take a Target object instead of
        an elfcpp::Ehdr as parameter.  Adjust call to set_target.
        an elfcpp::Ehdr as parameter.  Adjust call to set_target.
        (make_elf_sized_object): Find target and ask target to
        (make_elf_sized_object): Find target and ask target to
        make an ELF object.
        make an ELF object.
        * object.h: (Object::set_target): Remove the version that looks up
        * object.h: (Object::set_target): Remove the version that looks up
        a target and sets it.
        a target and sets it.
        (Sized_relobj::setup): Take a Target object instead of
        (Sized_relobj::setup): Take a Target object instead of
        an elfcpp:Ehdr as parameter.
        an elfcpp:Ehdr as parameter.
        * target.cc: Include dynobj.h.
        * target.cc: Include dynobj.h.
        (Target::do_make_elf_object_implementation): New.
        (Target::do_make_elf_object_implementation): New.
        (Target::do_make_elf_object): New.
        (Target::do_make_elf_object): New.
        * target.h (Target::make_elf_object): New template declaration.
        * target.h (Target::make_elf_object): New template declaration.
        (Target::do_make_elf_object): New method declarations.
        (Target::do_make_elf_object): New method declarations.
        (Target::do_make_elf_object_implementation): New template declaration.
        (Target::do_make_elf_object_implementation): New template declaration.
2009-08-14  Ian Lance Taylor  
2009-08-14  Ian Lance Taylor  
        * gold.h (FUNCTION_NAME): Define.
        * gold.h (FUNCTION_NAME): Define.
        (gold_unreachable): Use FUNCTION_NAME.
        (gold_unreachable): Use FUNCTION_NAME.
2009-08-12  Sriraman Tallam  
2009-08-12  Sriraman Tallam  
        * icf.cc (Icf::find_identical_sections): Issue a warning when a
        * icf.cc (Icf::find_identical_sections): Issue a warning when a
        symbol in the --keep-unique list is not found.
        symbol in the --keep-unique list is not found.
2009-08-12  Sriraman Tallam  
2009-08-12  Sriraman Tallam  
        * icf.cc (Icf::find_identical_sections): Unfold symbols that have
        * icf.cc (Icf::find_identical_sections): Unfold symbols that have
        been maked as --keep-unique.
        been maked as --keep-unique.
        (Icf::unfold_section): New function.
        (Icf::unfold_section): New function.
        * icf.h (Icf::unfold_section): New function.
        * icf.h (Icf::unfold_section): New function.
        * options.h (General_options::keep_unique): New option.
        * options.h (General_options::keep_unique): New option.
        * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
        * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/icf_keep_unique_test.sh: New file.
        * testsuite/icf_keep_unique_test.sh: New file.
        * testsuite/icf_keep_unique_test.cc: New file.
        * testsuite/icf_keep_unique_test.cc: New file.
2009-08-12  Cary Coutant  
2009-08-12  Cary Coutant  
        PR 10471
        PR 10471
        * resolve.cc (Symbol_table::resolve): Check for references from
        * resolve.cc (Symbol_table::resolve): Check for references from
        dynamic objects to hidden and internal symbols.
        dynamic objects to hidden and internal symbols.
        * testsuite/Makefile.am (hidden_test.sh): New test.
        * testsuite/Makefile.am (hidden_test.sh): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/hidden_test.sh: New script.
        * testsuite/hidden_test.sh: New script.
        * testsuite/hidden_test_1.c: New test source.
        * testsuite/hidden_test_1.c: New test source.
        * testsuite/hidden_test_main.c: New test source.
        * testsuite/hidden_test_main.c: New test source.
2009-08-11  Doug Kwan  
2009-08-11  Doug Kwan  
        * arm.cc: Update comments.
        * arm.cc: Update comments.
        (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
        (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
        segment to locate the .ARM.exidx section if present.
        segment to locate the .ARM.exidx section if present.
2009-08-09  Doug Kwan  
2009-08-09  Doug Kwan  
        * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
        * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
        patch.
        patch.
2009-08-07  Sriraman Tallam  
2009-08-07  Sriraman Tallam  
        * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
        * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
        compiler warnings.
        compiler warnings.
2009-08-06  Sriraman Tallam  
2009-08-06  Sriraman Tallam  
        * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
        * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
        valid tls_segment only for non-debug-section relocations.
        valid tls_segment only for non-debug-section relocations.
        * testsuite/Makefile.am: Add gc_tls_test.
        * testsuite/Makefile.am: Add gc_tls_test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/gc_tls_test.cc: New file.
        * testsuite/gc_tls_test.cc: New file.
        * testsuite/gc_tls_test.sh: New file.
        * testsuite/gc_tls_test.sh: New file.
2009-08-05  Sriraman Tallam  
2009-08-05  Sriraman Tallam  
        * icf.cc: New file.
        * icf.cc: New file.
        * icf.h: New file.
        * icf.h: New file.
        * Makefile.am (CCFILES): Add icf.cc.
        * Makefile.am (CCFILES): Add icf.cc.
        (HFILES): Add icf.h
        (HFILES): Add icf.h
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * dynobj.h (Sized_dynobj::do_section_entsize): New function.
        * dynobj.h (Sized_dynobj::do_section_entsize): New function.
        * gc.h (gc_process_relocs): Populate lists used by icf to contain
        * gc.h (gc_process_relocs): Populate lists used by icf to contain
        section, symbol and addend information for the relocs.
        section, symbol and addend information for the relocs.
        * gold.cc (queue_middle_tasks): Call identical code folding.
        * gold.cc (queue_middle_tasks): Call identical code folding.
        * gold.h: Add defines for multimap.
        * gold.h: Add defines for multimap.
        * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
        * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
        to the call of finalize_local_symbols.
        to the call of finalize_local_symbols.
        * main.cc (main): Create object of class Icf.
        * main.cc (main): Create object of class Icf.
        * object.cc (Sized_relobj::do_layout): Allow this function to be
        * object.cc (Sized_relobj::do_layout): Allow this function to be
        called twice during icf.
        called twice during icf.
        (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
        (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
        to sections marked as identical by icf.
        to sections marked as identical by icf.
        (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
        (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
        when available.
        when available.
        (Sized_relobj::do_section_entsize): New function.
        (Sized_relobj::do_section_entsize): New function.
        * object.h (Object::section_entsize): New function.
        * object.h (Object::section_entsize): New function.
        (Object::do_section_entsize): New pure virtual function.
        (Object::do_section_entsize): New pure virtual function.
        (Relobj::finalize_local_symbols): Add new parameter.
        (Relobj::finalize_local_symbols): Add new parameter.
        (Relobj::do_section_entsize): New function.
        (Relobj::do_section_entsize): New function.
        * options.h (General_options::icf): New option.
        * options.h (General_options::icf): New option.
        (General_options::icf_iterations): New option.
        (General_options::icf_iterations): New option.
        (General_options::print_icf_sections): New option.
        (General_options::print_icf_sections): New option.
        * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
        * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
        * plugin.h (Sized_pluginobj::do_section_entsize): New function.
        * plugin.h (Sized_pluginobj::do_section_entsize): New function.
        * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
        * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
        icf.
        icf.
        * symtab.cc (Symbol_table::is_section_folded): New function.
        * symtab.cc (Symbol_table::is_section_folded): New function.
        (Symbol_table::sized_finalize_symbol):  Fold symbols corresponding
        (Symbol_table::sized_finalize_symbol):  Fold symbols corresponding
        to sections marked as identical by icf.
        to sections marked as identical by icf.
        * symtab.h (Symbol_table::set_icf): New function.
        * symtab.h (Symbol_table::set_icf): New function.
        (Symbol_table::icf): New function.
        (Symbol_table::icf): New function.
        (Symbol_table::is_section_folded): New function.
        (Symbol_table::is_section_folded): New function.
        (Symbol_table::icf_): New data member.
        (Symbol_table::icf_): New data member.
        * target-reloc.h (relocate_section): Ignore sections folded by icf.
        * target-reloc.h (relocate_section): Ignore sections folded by icf.
        * testsuite/Makefile.am: Add commands to build icf_test.
        * testsuite/Makefile.am: Add commands to build icf_test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/icf_test.sh: New file.
        * testsuite/icf_test.sh: New file.
        * testsuite/icf_test.cc: New file.
        * testsuite/icf_test.cc: New file.
2009-07-24  Chris Demetriou  
2009-07-24  Chris Demetriou  
        * layout.cc (is_compressible_debug_section): Fix incorrect
        * layout.cc (is_compressible_debug_section): Fix incorrect
        comment about compressed section names.
        comment about compressed section names.
2009-07-20  Ian Lance Taylor  
2009-07-20  Ian Lance Taylor  
        PR 10419
        PR 10419
        * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
        * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
2009-07-16  Ian Lance Taylor  
2009-07-16  Ian Lance Taylor  
        PR 10400
        PR 10400
        * layout.h: #include .
        * layout.h: #include .
        (class Kept_section): Change from struct to class.  Add accessors
        (class Kept_section): Change from struct to class.  Add accessors
        and setters.  Add section size to Comdat_group mapping.  Change
        and setters.  Add section size to Comdat_group mapping.  Change
        Comdat_group to std::map.  Add is_comdat_ field.  Add
        Comdat_group to std::map.  Add is_comdat_ field.  Add
        linkonce_size field in union.
        linkonce_size field in union.
        (class Layout): Update declaration of find_or_add_kept_section.
        (class Layout): Update declaration of find_or_add_kept_section.
        Don't declare find_kept_object.
        Don't declare find_kept_object.
        * layout.cc (Layout::find_or_add_kept_section): Remove candidate
        * layout.cc (Layout::find_or_add_kept_section): Remove candidate
        parameter.  Add object, shndx, is_comdat, and is_group_name
        parameter.  Add object, shndx, is_comdat, and is_group_name
        parameters.  Change all callers.  Adjust for new Kept_section.
        parameters.  Change all callers.  Adjust for new Kept_section.
        (Layout::find_kept_object): Remove.
        (Layout::find_kept_object): Remove.
        * object.cc (Sized_relobj::include_section_group): Update use of
        * object.cc (Sized_relobj::include_section_group): Update use of
        Kept_section.  Rename secnum to shndx.  Only record
        Kept_section.  Rename secnum to shndx.  Only record
        Kept_comdat_section if sections are the same size.
        Kept_comdat_section if sections are the same size.
        (Sized_relobj::include_linkonce_section): Update use of
        (Sized_relobj::include_linkonce_section): Update use of
        Kept_section.  Only record Kept_comdat_section if sections are the
        Kept_section.  Only record Kept_comdat_section if sections are the
        same size.  Set size of linkonce section.
        same size.  Set size of linkonce section.
        (Sized_relobj::map_to_kept_section): Update call to
        (Sized_relobj::map_to_kept_section): Update call to
        get_kept_comdat_section.
        get_kept_comdat_section.
        * object.h (class Sized_relobj): Rename fields in
        * object.h (class Sized_relobj): Rename fields in
        Kept_comdat_section to drop trailing underscores; change object
        Kept_comdat_section to drop trailing underscores; change object
        field to Relobj*.  Change Kept_comdat_section_table to store
        field to Relobj*.  Change Kept_comdat_section_table to store
        struct rather than pointer.
        struct rather than pointer.
        (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
        (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
        Add kept_object and kept_shndx parameters.  Change all callers.
        Add kept_object and kept_shndx parameters.  Change all callers.
        (Sized_relobj::get_kept_comdat_section): Change return type to
        (Sized_relobj::get_kept_comdat_section): Change return type to
        bool.  Add kept_object and kept_shndx parameters.  Change all
        bool.  Add kept_object and kept_shndx parameters.  Change all
        callers.
        callers.
        * plugin.cc (Pluginobj::include_comdat_group): Update call to
        * plugin.cc (Pluginobj::include_comdat_group): Update call to
        Layout::find_or_add_kept_section.
        Layout::find_or_add_kept_section.
2009-07-09  Ian Lance Taylor  
2009-07-09  Ian Lance Taylor  
        * merge.cc (Object_merge_map::initialize_input_to_output_map):
        * merge.cc (Object_merge_map::initialize_input_to_output_map):
        Reserve space in the hash table.
        Reserve space in the hash table.
2009-07-06  Mikolaj Zalewski  
2009-07-06  Mikolaj Zalewski  
        * fileread.cc (File_read::get_mtime): New method.
        * fileread.cc (File_read::get_mtime): New method.
        * fileread.h (Timespec): New structure.
        * fileread.h (Timespec): New structure.
        (File_read::get_mtime): New method.
        (File_read::get_mtime): New method.
        * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
        * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
        Renamed from timestamp_nsec.
        Renamed from timestamp_nsec.
        (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
        (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
        Elf_Xword.
        Elf_Xword.
        (Incremental_inputs_entry_write::timestamp_usec): Renamed from
        (Incremental_inputs_entry_write::timestamp_usec): Renamed from
        timestamp_nsec.
        timestamp_nsec.
        (Incremental_inputs::report_archive): Save mtime; style fix.
        (Incremental_inputs::report_archive): Save mtime; style fix.
        (Incremental_inputs::report_obejct): Save mtime; style fix.
        (Incremental_inputs::report_obejct): Save mtime; style fix.
        (Incremental_inputs::report_script): Save mtime; style fix.
        (Incremental_inputs::report_script): Save mtime; style fix.
        (Incremental_inputs::finalize_inputs): Style fix.
        (Incremental_inputs::finalize_inputs): Style fix.
        (Incremental_inputs::finalize): Style fix.
        (Incremental_inputs::finalize): Style fix.
        (Incremental_inputs::create_input_section_data): Store inputs
        (Incremental_inputs::create_input_section_data): Store inputs
        mtime.
        mtime.
        * incremental.h (Incremental_inputs::report_script): Add mtime
        * incremental.h (Incremental_inputs::report_script): Add mtime
        argument.
        argument.
        (Incremental_inputs::Input_info::Input_info): Intialize only one
        (Incremental_inputs::Input_info::Input_info): Intialize only one
        union member.
        union member.
        (Incremental_inputs::Input_info::archive): Move to nameless
        (Incremental_inputs::Input_info::archive): Move to nameless
        union.
        union.
        (Incremental_inputs::Input_info::obejct): Move to nameless union.
        (Incremental_inputs::Input_info::obejct): Move to nameless union.
        (Incremental_inputs::Input_info::script): Move to nameless union.
        (Incremental_inputs::Input_info::script): Move to nameless union.
        (Incremental_inputs::mtime): New field.
        (Incremental_inputs::mtime): New field.
        * script.cc (read_input_script): Pass file mtime to
        * script.cc (read_input_script): Pass file mtime to
        Incremental_input.
        Incremental_input.
        * script.h (Script_info::inputs): Style fix.
        * script.h (Script_info::inputs): Style fix.
2009-07-01  Ian Lance Taylor  
2009-07-01  Ian Lance Taylor  
        * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
        * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
        instead of 32.
        instead of 32.
2009-06-24  Ian Lance Taylor  
2009-06-24  Ian Lance Taylor  
        PR 10156
        PR 10156
        * layout.cc (Layout::choose_output_section): If we find an
        * layout.cc (Layout::choose_output_section): If we find an
        existing section, update the flags.
        existing section, update the flags.
        (Layout::create_notes): New function, broken out of
        (Layout::create_notes): New function, broken out of
        Layout::finalize.
        Layout::finalize.
        (Layout::finalize): Don't create note sections.
        (Layout::finalize): Don't create note sections.
        (Layout::create_note): Don't crash if linker script discards
        (Layout::create_note): Don't crash if linker script discards
        section.
        section.
        (Layout::create_gold_note): Likewise.
        (Layout::create_gold_note): Likewise.
        (Layout::create_build_id): Likewise.  Don't set
        (Layout::create_build_id): Likewise.  Don't set
        after_input_sections on the section.
        after_input_sections on the section.
        (Layout::create_executable_stack_info): Remove target parameter.
        (Layout::create_executable_stack_info): Remove target parameter.
        Change caller.
        Change caller.
        * layout.h (class Layout): Declare create_notes.  Update
        * layout.h (class Layout): Declare create_notes.  Update
        declaration of create_executable_stack_info.
        declaration of create_executable_stack_info.
        * gold.cc (queue_middle_tasks): Call create_notes.
        * gold.cc (queue_middle_tasks): Call create_notes.
        * output.cc (Output_section::update_flags_for_input_section): Move
        * output.cc (Output_section::update_flags_for_input_section): Move
        here from output.h.  If SHF_ALLOC flag is newly set, mark address
        here from output.h.  If SHF_ALLOC flag is newly set, mark address
        invalid.
        invalid.
        * output.h (Output_data::mark_address_invalid): New function.
        * output.h (Output_data::mark_address_invalid): New function.
        (class Output_section): Only declare, not define,
        (class Output_section): Only declare, not define,
        update_flags_for_input_section.  Remove set_flags.
        update_flags_for_input_section.  Remove set_flags.
2009-06-24  Ian Lance Taylor  
2009-06-24  Ian Lance Taylor  
        * script-sections.cc (Output_section_definition::
        * script-sections.cc (Output_section_definition::
        set_section_addresses): Rename shadowing local load_address to
        set_section_addresses): Rename shadowing local load_address to
        laddr.
        laddr.
2009-06-24  Ian Lance Taylor  
2009-06-24  Ian Lance Taylor  
        PR 10244
        PR 10244
        * reloc.cc (relocate_sections): Skip empty relocation sections.
        * reloc.cc (relocate_sections): Skip empty relocation sections.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        PR 10156
        PR 10156
        * layout.cc (Layout::create_note): Use choose_output_section
        * layout.cc (Layout::create_note): Use choose_output_section
        rather than make_output_section.
        rather than make_output_section.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        PR 10237
        PR 10237
        * options.cc (General_options::parse_V): Set printed_version_.
        * options.cc (General_options::parse_V): Set printed_version_.
        (General_options::General_options): Initialize printed_version_.
        (General_options::General_options): Initialize printed_version_.
        * options.h (class General_options): Add printed_version_ field.
        * options.h (class General_options): Add printed_version_ field.
        * gold.cc (queue_initial_tasks): If there are no input files,
        * gold.cc (queue_initial_tasks): If there are no input files,
        don't give a fatal error if we printed the version information.
        don't give a fatal error if we printed the version information.
        (queue_middle_tasks): If using -r with a shared object, give a
        (queue_middle_tasks): If using -r with a shared object, give a
        fatal error rather than an ordinary error.
        fatal error rather than an ordinary error.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        PR 10219
        PR 10219
        * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
        * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
        (Layout::make_output_section): Set have_stabstr_section_ if we see
        (Layout::make_output_section): Set have_stabstr_section_ if we see
        a .stab*str section.
        a .stab*str section.
        (Layout::finalize): Call link_stabs_sections.
        (Layout::finalize): Call link_stabs_sections.
        (Layout::link_stabs_sections): New file.
        (Layout::link_stabs_sections): New file.
        * layout.h (class Layout): Add have_stabstr_section_ field.
        * layout.h (class Layout): Add have_stabstr_section_ field.
        Declare link_stabs_sections.
        Declare link_stabs_sections.
2009-06-23  Doug Kwan  
2009-06-23  Doug Kwan  
        * Makefile.am (libgold_a_LIBADD): New.
        * Makefile.am (libgold_a_LIBADD): New.
        (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
        (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
        * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
        * configure: Regenerate.
        * configure: Regenerate.
        * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
        * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
        * fileread.cc: Include sys/state.h
        * fileread.cc: Include sys/state.h
        * gold.h: Declare memmem and strndup if found missing.
        * gold.h: Declare memmem and strndup if found missing.
        * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
        * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        * configure.ac: Call AC_CHECK_DECLS using C, not C++.
        * configure.ac: Call AC_CHECK_DECLS using C, not C++.
        * configure: Rebuild.
        * configure: Rebuild.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        PR 10147
        PR 10147
        * object.cc (Object::section_contents): Don't try to get a view if
        * object.cc (Object::section_contents): Don't try to get a view if
        the section has length zero.
        the section has length zero.
        (Object::handle_gnu_warning_section): If the section is empty, use
        (Object::handle_gnu_warning_section): If the section is empty, use
        the name of the section as the warning.
        the name of the section as the warning.
2009-06-23  Ian Lance Taylor  
2009-06-23  Ian Lance Taylor  
        PR 10133
        PR 10133
        * stringpool.h (class Stringpool_template): Add optimize_ field.
        * stringpool.h (class Stringpool_template): Add optimize_ field.
        (Stringpool_template::set_optimize): New function.
        (Stringpool_template::set_optimize): New function.
        * stringpool.cc (Stringpool_template::Stringpool_template):
        * stringpool.cc (Stringpool_template::Stringpool_template):
        Initialize optimize_ field.
        Initialize optimize_ field.
        (Stringpool_template::set_string_offsets): Test local optimize
        (Stringpool_template::set_string_offsets): Test local optimize
        fild rather than parameter.
        fild rather than parameter.
        * layout.cc (Layout::Layout): Call set_optimize on the section
        * layout.cc (Layout::Layout): Call set_optimize on the section
        name stringpool.
        name stringpool.
2009-06-22  Ian Lance Taylor  
2009-06-22  Ian Lance Taylor  
        PR 10030
        PR 10030
        * yyscript.y: Parse TARGET.
        * yyscript.y: Parse TARGET.
        * script.cc (script_set_target): New function.
        * script.cc (script_set_target): New function.
        * script-c.h (script_set_target): Declare.
        * script-c.h (script_set_target): Declare.
        * options.cc (General_options::string_to_object_format): Rename
        * options.cc (General_options::string_to_object_format): Rename
        from string_to_object_format in anonymous namespace.  Change
        from string_to_object_format in anonymous namespace.  Change
        callers.
        callers.
        * options.h (class General_options): Declare
        * options.h (class General_options): Declare
        string_to_object_format.
        string_to_object_format.
2009-06-22  Ian Lance Taylor  
2009-06-22  Ian Lance Taylor  
        * script-sections.cc (Script_sections::create_segments): Don't put
        * script-sections.cc (Script_sections::create_segments): Don't put
        program headers in a PT_LOAD segment if -n or -N.
        program headers in a PT_LOAD segment if -n or -N.
2009-06-22  Ian Lance Taylor  
2009-06-22  Ian Lance Taylor  
        PR 10141
        PR 10141
        * options.h (class General_options): Add -z lazy and -z now.  Sort
        * options.h (class General_options): Add -z lazy and -z now.  Sort
        -z options into alphabetical order.
        -z options into alphabetical order.
        * layout.cc (Layout::finish_dynamic_section): Handle -z now.
        * layout.cc (Layout::finish_dynamic_section): Handle -z now.
2009-06-21  Ian Lance Taylor  
2009-06-21  Ian Lance Taylor  
        * layout.cc (Layout::make_output_section): Call
        * layout.cc (Layout::make_output_section): Call
        Target::new_output_section.
        Target::new_output_section.
        (Layout::attach_allocated_section_to_segment): Put large section
        (Layout::attach_allocated_section_to_segment): Put large section
        sections in a separate load segment with the large segment flag
        sections in a separate load segment with the large segment flag
        set.
        set.
        (Layout::segment_precedes): Sort large data segments after other
        (Layout::segment_precedes): Sort large data segments after other
        load segments.
        load segments.
        (align_file_offset): New static function.
        (align_file_offset): New static function.
        (Layout::set_segment_offsets): Use align_file_offset.
        (Layout::set_segment_offsets): Use align_file_offset.
        * output.h (class Output_section): Add is_small_section_ and
        * output.h (class Output_section): Add is_small_section_ and
        is_large_section_ fields.
        is_large_section_ fields.
        (Output_section::is_small_section): New function.
        (Output_section::is_small_section): New function.
        (Output_section::set_is_small_section):  New function.
        (Output_section::set_is_small_section):  New function.
        (Output_section::is_large_section): New function.
        (Output_section::is_large_section): New function.
        (Output_section::set_is_large_section): New function.
        (Output_section::set_is_large_section): New function.
        (Output_section::is_large_data_section): New function.
        (Output_section::is_large_data_section): New function.
        (class Output_segment): Add is_large_data_segment_ field.
        (class Output_segment): Add is_large_data_segment_ field.
        (Output_segment::is_large_data_segment): New function.
        (Output_segment::is_large_data_segment): New function.
        (Output_segment::set_is_large_data_segment): New function.
        (Output_segment::set_is_large_data_segment): New function.
        * output.cc (Output_section::Output_section): Initialize new
        * output.cc (Output_section::Output_section): Initialize new
        fields.
        fields.
        (Output_segment::Output_segment): Likewise.
        (Output_segment::Output_segment): Likewise.
        (Output_segment::add_output_section): Add assertion that large
        (Output_segment::add_output_section): Add assertion that large
        data sections always go in large data segments.  Force small data
        data sections always go in large data segments.  Force small data
        sections to the end of the list of data sections.  Force small BSS
        sections to the end of the list of data sections.  Force small BSS
        sections to the start of the list of BSS sections.  For large BSS
        sections to the start of the list of BSS sections.  For large BSS
        sections to the end of the list of BSS sections.
        sections to the end of the list of BSS sections.
        * symtab.h (class Symbol): Declare is_common_shndx.
        * symtab.h (class Symbol): Declare is_common_shndx.
        (Symbol::is_defined): Check Symbol::is_common_shndx.
        (Symbol::is_defined): Check Symbol::is_common_shndx.
        (Symbol::is_common): Likewise.
        (Symbol::is_common): Likewise.
        (class Symbol_table): Define enum Commons_section_type.  Update
        (class Symbol_table): Define enum Commons_section_type.  Update
        declarations.  Add small_commons_ and large_commons_ fields.
        declarations.  Add small_commons_ and large_commons_ fields.
        * symtab.cc (Symbol::is_common_shndx): New function.
        * symtab.cc (Symbol::is_common_shndx): New function.
        (Symbol_table::Symbol_table): Initialize new fields.
        (Symbol_table::Symbol_table): Initialize new fields.
        (Symbol_table::add_from_object): Put small and large common
        (Symbol_table::add_from_object): Put small and large common
        symbols in the right list.
        symbols in the right list.
        (Symbol_table::sized_finalized_symbol): Check
        (Symbol_table::sized_finalized_symbol): Check
        Symbol::is_common_shndx.
        Symbol::is_common_shndx.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::sized_write_globals): Likewise.
        * common.cc (Symbol_table::do_allocate_commons): Allocate new
        * common.cc (Symbol_table::do_allocate_commons): Allocate new
        common symbol lists.  Don't call do_allocate_commons_list if the
        common symbol lists.  Don't call do_allocate_commons_list if the
        list is empty.
        list is empty.
        (Symbol_table::do_allocate_commons_list): Remove is_tls
        (Symbol_table::do_allocate_commons_list): Remove is_tls
        parameter.  Add comons_section_type parameter.  Change all
        parameter.  Add comons_section_type parameter.  Change all
        callers.  Handle small and large common symbols.
        callers.  Handle small and large common symbols.
        * object.cc (Sized_relobj::do_finalize_local_symbols): Check
        * object.cc (Sized_relobj::do_finalize_local_symbols): Check
        Symbol::is_common_shndx.
        Symbol::is_common_shndx.
        * resolve.cc (symbol_to_bits): Likewise.
        * resolve.cc (symbol_to_bits): Likewise.
        * target.h (Target::small_common_shndx): New function.
        * target.h (Target::small_common_shndx): New function.
        (Target::small_common_section_flags): New function.
        (Target::small_common_section_flags): New function.
        (Target::large_common_shndx): New function.
        (Target::large_common_shndx): New function.
        (Target::large_common_section_flags): New function.
        (Target::large_common_section_flags): New function.
        (Target::new_output_section): New function.
        (Target::new_output_section): New function.
        (Target::Target_info): Add small_common_shndx, large_common_shndx,
        (Target::Target_info): Add small_common_shndx, large_common_shndx,
        small_common_section_flags, and large_common_section_flags
        small_common_section_flags, and large_common_section_flags
        fields.
        fields.
        (Target::do_new_output_section): New virtual function.
        (Target::do_new_output_section): New virtual function.
        * arm.cc (Target_arm::arm_info): Initialize new fields.
        * arm.cc (Target_arm::arm_info): Initialize new fields.
        * i386.cc (Target_i386::i386_info): Likewise.
        * i386.cc (Target_i386::i386_info): Likewise.
        * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
        * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
        Likewise.
        Likewise.
        * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
        * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
        * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
        * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
        (Target_x86_64::do_new_output_section): New function.
        (Target_x86_64::do_new_output_section): New function.
        * configure.ac: Define conditional MCMODEL_MEDIUM.
        * configure.ac: Define conditional MCMODEL_MEDIUM.
        * testsuite/Makefile.am (check_PROGRAMS): Add large.
        * testsuite/Makefile.am (check_PROGRAMS): Add large.
        (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
        (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
        (large_LDFLAGS): Define.
        (large_LDFLAGS): Define.
        * testsuite/large.c: New file.
        * testsuite/large.c: New file.
        * testsuite/testfile.cc (Target_test::test_target_info):
        * testsuite/testfile.cc (Target_test::test_target_info):
        Initialize new fields.
        Initialize new fields.
        * configure, testsuite/Makefile.in: Rebuild.
        * configure, testsuite/Makefile.in: Rebuild.
2009-06-05  Doug Kwan  
2009-06-05  Doug Kwan  
        * Makefile.am (CCFILES): Add target.cc.
        * Makefile.am (CCFILES): Add target.cc.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * i386.cc (class Target_i386): Define new virtual method to
        * i386.cc (class Target_i386): Define new virtual method to
        override do_is_local_label_name in parent.
        override do_is_local_label_name in parent.
        * object.cc (Sized_relobj::do_count_local_symbols): Discard
        * object.cc (Sized_relobj::do_count_local_symbols): Discard
        local symbols if --discard-locals or -X is given.
        local symbols if --discard-locals or -X is given.
        * options.h (class General_options): Declare new options
        * options.h (class General_options): Declare new options
        '--discard-locals' and '-X' for discarding locals.
        '--discard-locals' and '-X' for discarding locals.
        * target.h (class Target): Define new methods is_local_label_name.
        * target.h (class Target): Define new methods is_local_label_name.
        Declare new virtual method do_is_local_label_name.
        Declare new virtual method do_is_local_label_name.
        * target.cc: New file.
        * target.cc: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
        (check_SCRIPTS): Add discard_locals_test.sh.
        (check_SCRIPTS): Add discard_locals_test.sh.
        (check_DATA): Add discard_local_tests.syms.
        (check_DATA): Add discard_local_tests.syms.
        (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
        (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
        (discard_local_tests.syms, discard_locals_test.o): New make rules.
        (discard_local_tests.syms, discard_locals_test.o): New make rules.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/discard_locals_test.c: New file.
        * testsuite/discard_locals_test.c: New file.
        * testsuite/discard_locals_test.sh: Same.
        * testsuite/discard_locals_test.sh: Same.
2009-06-05  Doug Kwan  
2009-06-05  Doug Kwan  
        * object.cc (Sized_relobj::Sized_relobj): Initialize
        * object.cc (Sized_relobj::Sized_relobj): Initialize
        discarded_eh_frame_shndx_ to -1U.
        discarded_eh_frame_shndx_ to -1U.
        (Sized_relobj::do_layout): Record index of a discard .eh_frame
        (Sized_relobj::do_layout): Record index of a discard .eh_frame
        section.
        section.
        (Sized_relobj::do_count_local_symbols): Skip local symbols in
        (Sized_relobj::do_count_local_symbols): Skip local symbols in
        a discarded .eh_frame section.
        a discarded .eh_frame section.
        (Sized_relobj::do_finalize_local_symbols): Ditto.
        (Sized_relobj::do_finalize_local_symbols): Ditto.
        * object.h (class Sized_relobj): Declare new member
        * object.h (class Sized_relobj): Declare new member
        discarded_eh_frame_shndx_.
        discarded_eh_frame_shndx_.
        * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
        (local_labels_test.o, local_labels_test): New rules.
        (local_labels_test.o, local_labels_test): New rules.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2009-06-04  Doug Kwan  
2009-06-04  Doug Kwan  
        * layout.cc (Layout::section_name_mapping): Add mapping for
        * layout.cc (Layout::section_name_mapping): Add mapping for
        special ARM sections.
        special ARM sections.
2009-06-03  Doug Kwan  
2009-06-03  Doug Kwan  
        * arm.cc (utils::sign_extend): Reverse test in gold_assert.
        * arm.cc (utils::sign_extend): Reverse test in gold_assert.
        (utils::has_overflow): Same.
        (utils::has_overflow): Same.
2009-06-03  Ian Lance Taylor  
2009-06-03  Ian Lance Taylor  
        * layout.cc (Layout::section_name_mapping): New array, replacing
        * layout.cc (Layout::section_name_mapping): New array, replacing
        Layout::linkonce_mapping.
        Layout::linkonce_mapping.
        (Layout::section_name_mapping_count): New variable, replacing
        (Layout::section_name_mapping_count): New variable, replacing
        Layout::linkonce_mapping_count.
        Layout::linkonce_mapping_count.
        (Layout::linkonce_output_name): Remove.
        (Layout::linkonce_output_name): Remove.
        (Layout::output_section_name): Rewrite.
        (Layout::output_section_name): Rewrite.
        * layout.h (class Layout): Rename Linkonce_mapping to
        * layout.h (class Layout): Rename Linkonce_mapping to
        Section_name_mapping, linkonce_mapping to section_name_mapping,
        Section_name_mapping, linkonce_mapping to section_name_mapping,
        linkonce_mapping_count to section_name_mapping_count.  Don't
        linkonce_mapping_count to section_name_mapping_count.  Don't
        declare linkonce_output_name.
        declare linkonce_output_name.
2009-06-03  Doug Kwan  
2009-06-03  Doug Kwan  
        * gold/arm.cc (namespace utils): New.
        * gold/arm.cc (namespace utils): New.
        (Target_arm::reloc_is_non_pic): Define new method.
        (Target_arm::reloc_is_non_pic): Define new method.
        (class Arm_relocate_functions): New.
        (class Arm_relocate_functions): New.
        (Target_arm::Relocate::relocate): Handle relocation types used by
        (Target_arm::Relocate::relocate): Handle relocation types used by
        Android.
        Android.
2009-06-03  Ian Lance Taylor  
2009-06-03  Ian Lance Taylor  
        * arm.cc (Target_arm::scan::global): Use || instead of |.
        * arm.cc (Target_arm::scan::global): Use || instead of |.
2009-06-02  Doug Kwan  
2009-06-02  Doug Kwan  
        * gold/arm.cc (Target_arm::Scan::Scan):  Initialize
        * gold/arm.cc (Target_arm::Scan::Scan):  Initialize
        issued_non_pic_error_.
        issued_non_pic_error_.
        (class Target_arm::Scan): Declare new method check_non_pic.
        (class Target_arm::Scan): Declare new method check_non_pic.
        Define new method symbol_needs_plt_entry.
        Define new method symbol_needs_plt_entry.
        Declare new data member issued_non_pic_error_.
        Declare new data member issued_non_pic_error_.
        (class Target_arm::Relocate): Declare new method
        (class Target_arm::Relocate): Declare new method
        should_apply_static_reloc.
        should_apply_static_reloc.
        (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
        (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
        (Target_arm::Scan::check_non_pic): Define new method.
        (Target_arm::Scan::check_non_pic): Define new method.
        (Target_arm::Scan::local): Handle a small subset of reloc types used
        (Target_arm::Scan::local): Handle a small subset of reloc types used
        by Android.
        by Android.
        (Target_arm::Scan::local): Same.
        (Target_arm::Scan::local): Same.
        (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
        (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
2009-05-31  Mikolaj Zalewski  
2009-05-31  Mikolaj Zalewski  
        * incremental.cc (Incremental_inputs::report_command_line): Filter
        * incremental.cc (Incremental_inputs::report_command_line): Filter
        out --incremental-* options.
        out --incremental-* options.
2009-05-29  Doug Kwan  
2009-05-29  Doug Kwan  
        * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
        * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
        template class.
        template class.
        (class Target_arm): Update comment.
        (class Target_arm): Update comment.
        (Target_arm::Target_arm): Initialize new data members GOT_,
        (Target_arm::Target_arm): Initialize new data members GOT_,
        PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
        PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
        Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
        Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
        and Target_arm::rel_dyn_section.
        and Target_arm::rel_dyn_section.
        Declare new_enum Target_arm::Got_type.
        Declare new_enum Target_arm::Got_type.
        Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
        Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
        and DYNBSS_.
        and DYNBSS_.
        Update commments for member do_dynsym_value.
        Update commments for member do_dynsym_value.
        (Target_arm::got_size, Target_arm::plt_section,
        (Target_arm::got_size, Target_arm::plt_section,
        Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
        Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
        new methods inside class defintion.
        new methods inside class defintion.
        (Target_arm::got_section): Define new method.
        (Target_arm::got_section): Define new method.
        (Target_arm::rel_dyn_section): Same.
        (Target_arm::rel_dyn_section): Same.
        (Output_data_plt_arm): New template class.
        (Output_data_plt_arm): New template class.
        (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
        (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
        (Output_data_plt_arm:do_adjust_output_section): Define new method.
        (Output_data_plt_arm:do_adjust_output_section): Define new method.
        (Output_data_plt_arm::add_entry): Same.
        (Output_data_plt_arm::add_entry): Same.
        (Output_data_plt_arm::first_plt_entry): Define new
        (Output_data_plt_arm::first_plt_entry): Define new
        static data member for PLT instruction template.
        static data member for PLT instruction template.
        (Output_data_plt_arm::plt_entry): Same.
        (Output_data_plt_arm::plt_entry): Same.
        (Output_data_plt_arm::do_write): Define new method.
        (Output_data_plt_arm::do_write): Define new method.
        (Target_arm::make_plt_entry): Same.
        (Target_arm::make_plt_entry): Same.
        (Target_arm::do_finalize_sections): Same.
        (Target_arm::do_finalize_sections): Same.
        (Target_arm::do_dynsym_value): Same.
        (Target_arm::do_dynsym_value): Same.
2009-05-28  Doug Kwan  
2009-05-28  Doug Kwan  
        * Makefile.am (TARGETSOURCES): Add arm.cc.
        * Makefile.am (TARGETSOURCES): Add arm.cc.
        (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
        (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * arm.cc: New file.
        * arm.cc: New file.
        * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
        * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
2009-05-26  Doug Kwan  
2009-05-26  Doug Kwan  
        * options.cc (General_options::parse_exclude_libs).  Fix a comment.
        * options.cc (General_options::parse_exclude_libs).  Fix a comment.
        (General_options::check_excluded_libs): Strip off directories in
        (General_options::check_excluded_libs): Strip off directories in
        archive name before matching like GNU ld does.
        archive name before matching like GNU ld does.
        * testsuite/Makefile.am (MOSTLYCLEANFILES,
        * testsuite/Makefile.am (MOSTLYCLEANFILES,
        exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
        exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
        (exclude_libs_test_LDFLAGS): Add linker option
        (exclude_libs_test_LDFLAGS): Add linker option
        -Wl,--exclude-libs,libexclude_libs_test_3
        -Wl,--exclude-libs,libexclude_libs_test_3
        (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
        (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
        an explicit archive without using -l.
        an explicit archive without using -l.
        (alt/libexclude_libs_test_3.a): New make rule.
        (alt/libexclude_libs_test_3.a): New make rule.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/exclude_libs_test.c : Declare lib3_default().
        * testsuite/exclude_libs_test.c : Declare lib3_default().
        (main): Call it.
        (main): Call it.
        * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
        * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
        * exclude_libs_test_3.c: New file.
        * exclude_libs_test_3.c: New file.
2009-05-26  Nick Clifton  
2009-05-26  Nick Clifton  
        * po/id.po: New Indonesian translation.
        * po/id.po: New Indonesian translation.
        * po/gold.pot: Updated template file.
        * po/gold.pot: Updated template file.
2009-05-22  Sriraman Tallam  
2009-05-22  Sriraman Tallam  
        * testsuite/Makefile.am: Add -ffunction-sections to compile
        * testsuite/Makefile.am: Add -ffunction-sections to compile
        gc_comdat_test files.  Add -Wl,--gc-sections to build
        gc_comdat_test files.  Add -Wl,--gc-sections to build
        gc_comdat_test.
        gc_comdat_test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/gc_comdat_test.sh: Fix the condition around grep.
        * testsuite/gc_comdat_test.sh: Fix the condition around grep.
2009-05-21  Sriraman Tallam  
2009-05-21  Sriraman Tallam  
        * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
        * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
        kept comdat section was garbage collected.
        kept comdat section was garbage collected.
        * testsuite/Makefile.am: Add test gc_comdat_test.sh.
        * testsuite/Makefile.am: Add test gc_comdat_test.sh.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/gc_comdat_test.sh: New file.
        * testsuite/gc_comdat_test.sh: New file.
        * testsuite/gc_comdat_test_1.cc: New file.
        * testsuite/gc_comdat_test_1.cc: New file.
        * testsuite/gc_comdat_test_2.cc: New file.
        * testsuite/gc_comdat_test_2.cc: New file.
2009-05-19  Doug Kwan  
2009-05-19  Doug Kwan  
        * archive.cc (Archive::Archive): Move constructor from archive.h
        * archive.cc (Archive::Archive): Move constructor from archive.h
        to here.  Initialize no_export_.
        to here.  Initialize no_export_.
        (Archive::get_elf_object_for_member): Set no_export flag of object.
        (Archive::get_elf_object_for_member): Set no_export flag of object.
        * archive.h (Archive::Archive): Move constructor body to
        * archive.h (Archive::Archive): Move constructor body to
        archive.cc.
        archive.cc.
        (Archive::no_export): New method.
        (Archive::no_export): New method.
        (Archive::no_export_): New field.
        (Archive::no_export_): New field.
        * object.h (Object::Object): Initialize no_export_ to false.
        * object.h (Object::Object): Initialize no_export_ to false.
        (Object::no_export, Object::set_no_export): New methods.
        (Object::no_export, Object::set_no_export): New methods.
        (Object::no_export_): New field.
        (Object::no_export_): New field.
        * options.cc (General_options::parse_exclude_libs): New method.
        * options.cc (General_options::parse_exclude_libs): New method.
        (General_options::check_excluded_libs) Same.
        (General_options::check_excluded_libs) Same.
        * options.h (exclude_libs): New option.
        * options.h (exclude_libs): New option.
        (General_options::check_excluded_libs): New method declaration.
        (General_options::check_excluded_libs): New method declaration.
        (General_options::excluded_libs_): New field.
        (General_options::excluded_libs_): New field.
        * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
        * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
        default or protected visibility if an object has no-export flag set.
        default or protected visibility if an object has no-export flag set.
        testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
        testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
        (check_SCRIPTS): Add exclude_libs_test.sh.
        (check_SCRIPTS): Add exclude_libs_test.sh.
        (check_DATA): Add exclude_libs_test.syms.
        (check_DATA): Add exclude_libs_test.syms.
        (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
        (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
        libexclude_libs_test_1.a and libexclude_libs_test_2.a.
        libexclude_libs_test_1.a and libexclude_libs_test_2.a.
        (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
        (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
        exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
        exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
        (exclude_libs_test.syms, libexclude_libs_test_1.a,
        (exclude_libs_test.syms, libexclude_libs_test_1.a,
        libexclude_libs_test_2.a): New rules.
        libexclude_libs_test_2.a): New rules.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/exclude_libs_test.c: New file.
        * testsuite/exclude_libs_test.c: New file.
        * testsuite/exclude_libs_test.sh: Ditto.
        * testsuite/exclude_libs_test.sh: Ditto.
        * testsuite/exclude_libs_test_1.c: Ditto.
        * testsuite/exclude_libs_test_1.c: Ditto.
        * testsuite/exclude_libs_test_2.c: Ditto.
        * testsuite/exclude_libs_test_2.c: Ditto.
2009-05-15  Ian Lance Taylor  
2009-05-15  Ian Lance Taylor  
        * configure.ac: Check for declarations for cases where libiberty.h
        * configure.ac: Check for declarations for cases where libiberty.h
        checks HAVE_DECL_xxx.
        checks HAVE_DECL_xxx.
        * configure, config.in: Rebuild.
        * configure, config.in: Rebuild.
2009-05-15  Mikolaj Zalewski  
2009-05-15  Mikolaj Zalewski  
        * gold.h (Incremental_argument_list): Remove (invalid) forward
        * gold.h (Incremental_argument_list): Remove (invalid) forward
        declaration.
        declaration.
        * incremental.cc (Incremental_inputs::report_achive): New method.
        * incremental.cc (Incremental_inputs::report_achive): New method.
        (Incremental_inputs::report_object): New method.
        (Incremental_inputs::report_object): New method.
        (Incremental_inputs::report_script): New method.
        (Incremental_inputs::report_script): New method.
        (Incremental_inputs::finalize_inputs): New method.
        (Incremental_inputs::finalize_inputs): New method.
        (Incremental_inputs::finalize): Call finalize_inputs().
        (Incremental_inputs::finalize): Call finalize_inputs().
        (Incremental_inputs::sized_create_incremental_inputs_section_data):
        (Incremental_inputs::sized_create_incremental_inputs_section_data):
        Create inputs entries.
        Create inputs entries.
        * incremental.h (Incremental_input_type): New enum.
        * incremental.h (Incremental_input_type): New enum.
        (Incremental_inputs::Incremental_input): Initialize new fields.
        (Incremental_inputs::Incremental_input): Initialize new fields.
        (Incremental_inputs::report_inputs): New method.
        (Incremental_inputs::report_inputs): New method.
        (Incremental_inputs::report_achive): New method.
        (Incremental_inputs::report_achive): New method.
        (Incremental_inputs::report_object): New method.
        (Incremental_inputs::report_object): New method.
        (Incremental_inputs::report_script): New method.
        (Incremental_inputs::report_script): New method.
        (Incremental_inputs::finalize_inputs): New method.
        (Incremental_inputs::finalize_inputs): New method.
        (Incremental_inputs::Input_info): New struct.
        (Incremental_inputs::Input_info): New struct.
        (Incremental_inputs::Input_info_map): New typedef.
        (Incremental_inputs::Input_info_map): New typedef.
        (Incremental_inputs::lock_): New field.
        (Incremental_inputs::lock_): New field.
        (Incremental_inputs::Inputs_): New field.
        (Incremental_inputs::Inputs_): New field.
        (Incremental_inputs::Inputs_map): New field.
        (Incremental_inputs::Inputs_map): New field.
        * main.cc (main): Call Incremental_input::report_inputs.
        * main.cc (main): Call Incremental_input::report_inputs.
        * options.h (Input_argument_list): Typedef moved from
        * options.h (Input_argument_list): Typedef moved from
        Input_arguments.
        Input_arguments.
        (Input_file_group::Files): Remove, use ::Input_argument_list.
        (Input_file_group::Files): Remove, use ::Input_argument_list.
        (Input_file_group::Input_argument_list): Remove, use
        (Input_file_group::Input_argument_list): Remove, use
        ::Input_argument_list.
        ::Input_argument_list.
        * plugin.cc (Plugin_manager::add_input_file): Add error in
        * plugin.cc (Plugin_manager::add_input_file): Add error in
        incremental build.
        incremental build.
        * read_syms.cc (do_read_syms): Call Incremental_input::report_*
        * read_syms.cc (do_read_syms): Call Incremental_input::report_*
        functions.
        functions.
        * script.cc (read_input_script): Call
        * script.cc (read_input_script): Call
        Incremental_input::report_script.
        Incremental_input::report_script.
        * script.h (Script_info): New class.
        * script.h (Script_info): New class.
2009-04-27  Ian Lance Taylor  
2009-04-27  Ian Lance Taylor  
        * x86_64.cc (do_adjust_output_section): Set entsize to
        * x86_64.cc (do_adjust_output_section): Set entsize to
        plt_entry_size.
        plt_entry_size.
2009-04-23  Elliott Hughes  
2009-04-23  Elliott Hughes  
        * output.cc (Output_file::close): After short writes, continue
        * output.cc (Output_file::close): After short writes, continue
        writing from the correct offset in the buffer being written.
        writing from the correct offset in the buffer being written.
2009-04-23  Chris Demetriou  
2009-04-23  Chris Demetriou  
        * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
        * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
        * configure: Regenerate.
        * configure: Regenerate.
        * config.in: Regenerate.
        * config.in: Regenerate.
        * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
        * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
        if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
        if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
2009-04-21  Mikolaj Zalewski  
2009-04-21  Mikolaj Zalewski  
        * incremental.cc (Incremental_inputs_header_data): Renamed from
        * incremental.cc (Incremental_inputs_header_data): Renamed from
        Incremental_input_header_data.
        Incremental_input_header_data.
        (Incremental_inputs_header_data::data_size): New field.
        (Incremental_inputs_header_data::data_size): New field.
        (Incremental_inputs_header_data::put_input_file_count): Renamed
        (Incremental_inputs_header_data::put_input_file_count): Renamed
        from input_file_count.
        from input_file_count.
        (Incremental_inputs_header_data::put_command_line_offset): Renamed
        (Incremental_inputs_header_data::put_command_line_offset): Renamed
        from command_line_offset.
        from command_line_offset.
        (Incremental_inputs_header_data::put_reserved): Renamed from
        (Incremental_inputs_header_data::put_reserved): Renamed from
        put_reserved.
        put_reserved.
        (Incremental_inputs_entry_data): Renamed from
        (Incremental_inputs_entry_data): Renamed from
        Incremental_input_entry_data.
        Incremental_input_entry_data.
        (Incremental_inputs_entry_data::data_size): New field.
        (Incremental_inputs_entry_data::data_size): New field.
        (Incremental_inputs::report_command_line): New method.
        (Incremental_inputs::report_command_line): New method.
        (Incremental_inputs::finalize): New method.
        (Incremental_inputs::finalize): New method.
        (Incremental_inputs::create_incremental_inputs_data): New method.
        (Incremental_inputs::create_incremental_inputs_data): New method.
        (Incremental_inputs::sized_create_incremental_inputs_data): New method.
        (Incremental_inputs::sized_create_incremental_inputs_data): New method.
        * incremental.h: New file.
        * incremental.h: New file.
        * layout.cc (Layout::Layout): Handle new incremental_inputs_.
        * layout.cc (Layout::Layout): Handle new incremental_inputs_.
       (Layout::finalize): Create incremental inputs section in
       (Layout::finalize): Create incremental inputs section in
        incremental builds.
        incremental builds.
       (Layout::create_incremental_info_sections): New method.
       (Layout::create_incremental_info_sections): New method.
        * layout.h (Layout::incremental_inputs): New method.
        * layout.h (Layout::incremental_inputs): New method.
       (Layout::create_incremental_info_sections): New method.
       (Layout::create_incremental_info_sections): New method.
       (Layout::incremental_inputs_): New field.
       (Layout::incremental_inputs_): New field.
        * main.cc (main): Notify Incremental_input of the command line.
        * main.cc (main): Notify Incremental_input of the command line.
2009-04-01  Ian Lance Taylor  
2009-04-01  Ian Lance Taylor  
            Mikolaj Zalewski  
            Mikolaj Zalewski  
        * gold.h (reserve_unordered_map): Define, three versions, one for
        * gold.h (reserve_unordered_map): Define, three versions, one for
        each version of Unordered_map.
        each version of Unordered_map.
        * layout.cc (Layout::Layout): Remove options parameter.  Add
        * layout.cc (Layout::Layout): Remove options parameter.  Add
        number_of_input_files parameter.  Don't initialize options_.
        number_of_input_files parameter.  Don't initialize options_.
        Initialize number_of_input_files_ and resized_signatures_.  Move
        Initialize number_of_input_files_ and resized_signatures_.  Move
        sections_are_attached_.
        sections_are_attached_.
        (Layout::layout_group): Reserve space for group_signatures_.
        (Layout::layout_group): Reserve space for group_signatures_.
        (Layout::find_or_add_kept_section): Change name parameter to be a
        (Layout::find_or_add_kept_section): Change name parameter to be a
        reference.  Resize signatures_ map when it gets large enough.
        reference.  Resize signatures_ map when it gets large enough.
        (Layout::layout_eh_frame): Use parameters->options() instead of
        (Layout::layout_eh_frame): Use parameters->options() instead of
        this->options_.
        this->options_.
        (Layout::make_output_section): Likewise.
        (Layout::make_output_section): Likewise.
        (Layout::attach_allocated_section_to_segment): Likewise.
        (Layout::attach_allocated_section_to_segment): Likewise.
        (Layout::finalize, Layout::create_executable_stack): Likewise.
        (Layout::finalize, Layout::create_executable_stack): Likewise.
        (Layout::set_segment_offsets, Layout::create_interp): Likewise.
        (Layout::set_segment_offsets, Layout::create_interp): Likewise.
        (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
        (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
        * layout.h (class Layout): Update declarations.  Remove options_
        * layout.h (class Layout): Update declarations.  Remove options_
        field.  Add number_of_input_files_ and resized_signatures_
        field.  Add number_of_input_files_ and resized_signatures_
        fields.  Move sections_are_attached_ field.
        fields.  Move sections_are_attached_ field.
        * main.cc (main): Pass number of input files to Layout
        * main.cc (main): Pass number of input files to Layout
        constructor.  Don't pass options.
        constructor.  Don't pass options.
2009-03-30  Ian Lance Taylor  
2009-03-30  Ian Lance Taylor  
        * ffsll.c (ffsll): Correct implementation.
        * ffsll.c (ffsll): Correct implementation.
2009-03-27  Ian Lance Taylor  
2009-03-27  Ian Lance Taylor  
        * ffsll.c: New file.
        * ffsll.c: New file.
        * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
        * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
        * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
        * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
        * ftruncate.c (ftruncate): Declare before definition.
        * ftruncate.c (ftruncate): Declare before definition.
        * mremap.c (mremap): Likewise.
        * mremap.c (mremap): Likewise.
        * pread.c (pread): Likewise.
        * pread.c (pread): Likewise.
        * configure, Makefile.in, config.in: Rebuild.
        * configure, Makefile.in, config.in: Rebuild.
        * mremap.c: New file.
        * mremap.c: New file.
        * configure.ac: Call AC_REPLACE_FUNCS on mremap.
        * configure.ac: Call AC_REPLACE_FUNCS on mremap.
        * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
        * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
        (mremap): Declare if HAVE_MREMAP is not defined.
        (mremap): Declare if HAVE_MREMAP is not defined.
        * configure, Makefile.in, config.in: Rebuild.
        * configure, Makefile.in, config.in: Rebuild.
2009-03-27  Cary Coutant  
2009-03-27  Cary Coutant  
        * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
        * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
        position independent.
        position independent.
        * sparc.cc (Target_sparc::check_non_pic): Likewise.
        * sparc.cc (Target_sparc::check_non_pic): Likewise.
        * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
        * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
2009-03-24  Cary Coutant  
2009-03-24  Cary Coutant  
        * symtab.h (needs_plt_entry): Check for unsatisfied reference from
        * symtab.h (needs_plt_entry): Check for unsatisfied reference from
        an executable.
        an executable.
        (needs_dynamic_reloc): Likewise.
        (needs_dynamic_reloc): Likewise.
2009-03-24  Ian Lance Taylor  
2009-03-24  Ian Lance Taylor  
        * yyscript.y (file_cmd): Recognize EXTERN.
        * yyscript.y (file_cmd): Recognize EXTERN.
        (extern_name_list, extern_name_list_body): New nonterminals.
        (extern_name_list, extern_name_list_body): New nonterminals.
        * script.cc (script_add_extern): Define.
        * script.cc (script_add_extern): Define.
        * script-c.h (script_add_extern): Declare.
        * script-c.h (script_add_extern): Declare.
2009-03-24  Rafael Avila de Espindola  
2009-03-24  Rafael Avila de Espindola  
        * object.cc (is_elf_object): Define.
        * object.cc (is_elf_object): Define.
        * object.h (is_elf_object): Declare.
        * object.h (is_elf_object): Declare.
        * archive.cc (Archive::get_elf_object_for_member): Call
        * archive.cc (Archive::get_elf_object_for_member): Call
        is_elf_object.
        is_elf_object.
        * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
        * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
2009-03-24  Elliott Hughes  
2009-03-24  Elliott Hughes  
        * output.cc (Output_file::map_anonymous): Define.
        * output.cc (Output_file::map_anonymous): Define.
        (Output_file::map): Use map_anonymous.  If the regular mmap fails,
        (Output_file::map): Use map_anonymous.  If the regular mmap fails,
        try an anonymous one.  Report the size if the mmap fails.
        try an anonymous one.  Report the size if the mmap fails.
        * output.h (class Output_file): Declare map_anonymous.
        * output.h (class Output_file): Declare map_anonymous.
2009-03-24  Ian Lance Taylor  
2009-03-24  Ian Lance Taylor  
        * target-select.cc (instantiate_target): Don't acquire the lock if
        * target-select.cc (instantiate_target): Don't acquire the lock if
        the instantiated_target_ field has already been set.
        the instantiated_target_ field has already been set.
2009-03-23  Ian Lance Taylor  
2009-03-23  Ian Lance Taylor  
        * gold-threads.h (class Initialize_lock): Define.
        * gold-threads.h (class Initialize_lock): Define.
        * gold-threads.cc (class Initialize_lock_once): Define.
        * gold-threads.cc (class Initialize_lock_once): Define.
        (initialize_lock_control): New static variable.
        (initialize_lock_control): New static variable.
        (initialize_lock_pointer): New static variable.
        (initialize_lock_pointer): New static variable.
        (initialize_lock_once): New static function.
        (initialize_lock_once): New static function.
        (Initialize_lock::Initialize_lock): Define.
        (Initialize_lock::Initialize_lock): Define.
        (Initialize_lock::initialize): Define.
        (Initialize_lock::initialize): Define.
        * target-select.h: Include "gold-threads.h".
        * target-select.h: Include "gold-threads.h".
        (class Target_selector): Add lock_ and initialize_lock_ fields.
        (class Target_selector): Add lock_ and initialize_lock_ fields.
        Don't define instantiate_target, just declare it.
        Don't define instantiate_target, just declare it.
        * target-select.cc (Target_selector::Target_selector): Initialize
        * target-select.cc (Target_selector::Target_selector): Initialize
        new fields.
        new fields.
        (Target_selector::instantiate_target): Define.
        (Target_selector::instantiate_target): Define.
        * descriptors.h: Include "gold-threads.h".
        * descriptors.h: Include "gold-threads.h".
        (class Descriptors): Add initialize_lock_ field.
        (class Descriptors): Add initialize_lock_ field.
        * descriptors.cc (Descriptors::Descriptors): Initialize new
        * descriptors.cc (Descriptors::Descriptors): Initialize new
        field.
        field.
        (Descriptors::open): Use initialize_lock_ field
        (Descriptors::open): Use initialize_lock_ field
        * errors.h (class Errors): Add initialize_lock_ field.
        * errors.h (class Errors): Add initialize_lock_ field.
        * errors.cc (Errors::Errors): Initialize new field.
        * errors.cc (Errors::Errors): Initialize new field.
        (Errors::initialize_lock): Use initialize_lock_ field.
        (Errors::initialize_lock): Use initialize_lock_ field.
        * powerpc.cc (class Target_selector_powerpc): Remove
        * powerpc.cc (class Target_selector_powerpc): Remove
        instantiated_target_ field.  In do_recognize call
        instantiated_target_ field.  In do_recognize call
        instantiate_target rather than do_instantiate_target.  In
        instantiate_target rather than do_instantiate_target.  In
        do_instantiate_target just allocate a new target.
        do_instantiate_target just allocate a new target.
        * sparc.cc (class Target_selector_sparc): Likewise.
        * sparc.cc (class Target_selector_sparc): Likewise.
        * freebsd.h: New file.
        * freebsd.h: New file.
        * i386.cc: Include "freebsd.h".
        * i386.cc: Include "freebsd.h".
        (Target_i386): Derive from Target_freebsd rather than
        (Target_i386): Derive from Target_freebsd rather than
        Sized_target.
        Sized_target.
        (Target_selector_i386): Derive from Target_selector_freebsd rather
        (Target_selector_i386): Derive from Target_selector_freebsd rather
        than Target_selector.
        than Target_selector.
        * x86_64.cc: Include "freebsd.h".
        * x86_64.cc: Include "freebsd.h".
        (Target_x86_64): Derive from Target_freebsd rather than
        (Target_x86_64): Derive from Target_freebsd rather than
        Sized_target.
        Sized_target.
        (Target_selector_x86_64): Derive from Target_selector_freebsd
        (Target_selector_x86_64): Derive from Target_selector_freebsd
        rather than Target_selector.
        rather than Target_selector.
        * target.h (class Target): Add adjust_elf_header and
        * target.h (class Target): Add adjust_elf_header and
        do_adjust_elf_header.
        do_adjust_elf_header.
        * output.cc (Output_file_header:: do_sized_write): Call target
        * output.cc (Output_file_header:: do_sized_write): Call target
        adjust_elf_header routine.
        adjust_elf_header routine.
        * configure.tgt: Set targ_osabi.
        * configure.tgt: Set targ_osabi.
        * configure.ac: Define GOLD_DEFAULT_OSABI.
        * configure.ac: Define GOLD_DEFAULT_OSABI.
        * parameters.cc (Parameters::default_target): Pass
        * parameters.cc (Parameters::default_target): Pass
        GOLD_DEFAULT_OSABI to select_target.
        GOLD_DEFAULT_OSABI to select_target.
        * target-select.h (class Target_selector): Make instantiate_target
        * target-select.h (class Target_selector): Make instantiate_target
        protected rather than private.
        protected rather than private.
        * Makefile.am (HFILES): Add freebsd.h.
        * Makefile.am (HFILES): Add freebsd.h.
        * configure, Makefile.in, config.in: Rebuild.
        * configure, Makefile.in, config.in: Rebuild.
        * merge.cc (do_add_input_section): Correct pend value.  Change
        * merge.cc (do_add_input_section): Correct pend value.  Change
        message about last entry not being null terminated from error to
        message about last entry not being null terminated from error to
        warning.
        warning.
2009-03-20  Mikolaj Zalewski  
2009-03-20  Mikolaj Zalewski  
        * incremental.cc: New file.
        * incremental.cc: New file.
        * Makefile.am (CCFILES): Add incremental.cc.
        * Makefile.am (CCFILES): Add incremental.cc.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2009-03-19  Paul Pluzhnikov  
2009-03-19  Paul Pluzhnikov  
        * layout.cc (Layout::output_section_name): Preserve names
        * layout.cc (Layout::output_section_name): Preserve names
        of '.note.' sections.
        of '.note.' sections.
2009-03-19  Ian Lance Taylor  
2009-03-19  Ian Lance Taylor  
        * descriptors.cc (Descriptors::open): Check that the options are
        * descriptors.cc (Descriptors::open): Check that the options are
        valid before using them.
        valid before using them.
2009-03-18  Ian Lance Taylor  
2009-03-18  Ian Lance Taylor  
        * script-sections.h: Include .
        * script-sections.h: Include .
        (class Script_sections): Change Sections_elements from std::vector
        (class Script_sections): Change Sections_elements from std::vector
        to std::list.  Typedef public Elements_iterator.  Add
        to std::list.  Typedef public Elements_iterator.  Add
        orphan_section_placement_, data_segment_align_start_, and
        orphan_section_placement_, data_segment_align_start_, and
        saw_data_segment_align_ fields.  Remove data_segment_align_index_
        saw_data_segment_align_ fields.  Remove data_segment_align_index_
        field.
        field.
        * script-sections.cc (class Orphan_section_placement): New class.
        * script-sections.cc (class Orphan_section_placement): New class.
        (class Sections_element): Add virtual functions is_relro and
        (class Sections_element): Add virtual functions is_relro and
        orphan_section_init.  Remove virtual function place_orphan_here.
        orphan_section_init.  Remove virtual function place_orphan_here.
        (class Output_section_definition): Add is_relro and
        (class Output_section_definition): Add is_relro and
        orphan_section_init.  Remove place_orphan_here.
        orphan_section_init.  Remove place_orphan_here.
        (class Orphan_output_section): Likewise.
        (class Orphan_output_section): Likewise.
        (Script_sections::Script_sections): Update for field changes.
        (Script_sections::Script_sections): Update for field changes.
        (Script_sections::data_segment_align): Set saw_data_segment_align_
        (Script_sections::data_segment_align): Set saw_data_segment_align_
        and data_segment_align_start_, not data_segment_align_index.
        and data_segment_align_start_, not data_segment_align_index.
        (Script_sections::data_segment_relro_end): Check
        (Script_sections::data_segment_relro_end): Check
        saw_data_segment_align_.  Use data_segment_align_start_ rather
        saw_data_segment_align_.  Use data_segment_align_start_ rather
        than data_segment_align_index_.
        than data_segment_align_index_.
        (Script_sections::place_orphan): Rewrite to use
        (Script_sections::place_orphan): Rewrite to use
        Orphan_section_placement.
        Orphan_section_placement.
2009-03-17  Ian Lance Taylor  
2009-03-17  Ian Lance Taylor  
        * archive.cc (Archive::add_symbols): Check for a version attached
        * archive.cc (Archive::add_symbols): Check for a version attached
        to the symbol name in the archive map.
        to the symbol name in the archive map.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
        (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
        (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
        (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
        (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
        (ver_test_11.a): New target.
        (ver_test_11.a): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * configure.ac: Check for chsize and posix_fallocate.  Replace
        * configure.ac: Check for chsize and posix_fallocate.  Replace
        ftruncate.
        ftruncate.
        * ftruncate.c: New file, from gnulib.
        * ftruncate.c: New file, from gnulib.
        * output.cc (posix_fallocate): Define dummy version if not
        * output.cc (posix_fallocate): Define dummy version if not
        HAVE_POSIX_FALLOCATE.
        HAVE_POSIX_FALLOCATE.
        (Output_file::map): Call posix_fallocate rather than lseek and
        (Output_file::map): Call posix_fallocate rather than lseek and
        write.
        write.
        * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
        * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
        * configure, Makefile.in, config.in: Rebuild.
        * configure, Makefile.in, config.in: Rebuild.
2009-03-17  Paul Pluzhnikov  
2009-03-17  Paul Pluzhnikov  
        * layout.h (Layout::create_note): Add section_name parameter.
        * layout.h (Layout::create_note): Add section_name parameter.
        * layout.cc (Layout::create_note): Likewise.
        * layout.cc (Layout::create_note): Likewise.
        (Layout::create_build_id, Layout::create_gold_note): Fix callers.
        (Layout::create_build_id, Layout::create_gold_note): Fix callers.
2009-03-17  Ian Lance Taylor  
2009-03-17  Ian Lance Taylor  
        * descriptors.cc: Include "options.h".
        * descriptors.cc: Include "options.h".
        (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
        (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
        (Descriptors::open): Always use O_CLOEXEC when opening a new
        (Descriptors::open): Always use O_CLOEXEC when opening a new
        descriptor.  If we have a plugin, and O_CLOEXEC was not defined,
        descriptor.  If we have a plugin, and O_CLOEXEC was not defined,
        then set FD_CLOEXEC.
        then set FD_CLOEXEC.
        * sparc.cc (class Target_sparc): Add has_got_section.
        * sparc.cc (class Target_sparc): Add has_got_section.
        (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
        (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
        make sure we have a GOT section.
        make sure we have a GOT section.
        * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
        * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
        (Target_sparc::Scan::local): Likewise.
        (Target_sparc::Scan::local): Likewise.
        (Target_sparc::Scan::global): Likewise.
        (Target_sparc::Scan::global): Likewise.
        (Target_sparc::Relocate::relocate): Likewise.
        (Target_sparc::Relocate::relocate): Likewise.
        (Target_sparc::Relocate::relocate_tls): Likewise.
        (Target_sparc::Relocate::relocate_tls): Likewise.
        * symtab.cc (Symbol_table::define_default_version): New function,
        * symtab.cc (Symbol_table::define_default_version): New function,
        broken out of add_from_object.
        broken out of add_from_object.
        (Symbol_table::add_from_object): Call define_default_version.
        (Symbol_table::add_from_object): Call define_default_version.
        (Symbol_table::define_special_symbol): Add resolve_oldsym
        (Symbol_table::define_special_symbol): Add resolve_oldsym
        parameter.  Change all callers.  If the version for a symbol comes
        parameter.  Change all callers.  If the version for a symbol comes
        from a version script, resolve it with the symbol with the same
        from a version script, resolve it with the symbol with the same
        name with no version.  Also add the symbol without a version if
        name with no version.  Also add the symbol without a version if
        appropriate.
        appropriate.
        (do_define_in_output_data): If resolving with oldsym, don't delete
        (do_define_in_output_data): If resolving with oldsym, don't delete
        sym.
        sym.
        (do_define_in_output_segment): Likewise.
        (do_define_in_output_segment): Likewise.
        (do_define_as_constant): Likewise.
        (do_define_as_constant): Likewise.
        * symtab.h (class Symbol_table): Update declarations.
        * symtab.h (class Symbol_table): Update declarations.
2009-03-13  Ian Lance Taylor  
2009-03-13  Ian Lance Taylor  
        * readsyms.cc (Read_symbols::incompatible_warning): New function.
        * readsyms.cc (Read_symbols::incompatible_warning): New function.
        (Read_symbols::requeue): New function.
        (Read_symbols::requeue): New function.
        (Read_symbols::do_read_symbols): If make_elf_object fails because
        (Read_symbols::do_read_symbols): If make_elf_object fails because
        the target type is not configured, and the file was searched for,
        the target type is not configured, and the file was searched for,
        issue a warning and retry with the next directory.
        issue a warning and retry with the next directory.
        (Add_symbols::run): If the file has an incompatible format, and
        (Add_symbols::run): If the file has an incompatible format, and
        it was searched for, requeue the Read_symbols task.  On error,
        it was searched for, requeue the Read_symbols task.  On error,
        release the object.
        release the object.
        * readsyms.h (class Read_symbols): Add dirindex_ field.  Add
        * readsyms.h (class Read_symbols): Add dirindex_ field.  Add
        dirindex parameter to constructor.  Change all callers.  Declare
        dirindex parameter to constructor.  Change all callers.  Declare
        incompatible_warning and requeue.
        incompatible_warning and requeue.
        (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
        (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
        input_argument_ and input_group_ fields.  Add them to
        input_argument_ and input_group_ fields.  Add them to
        constructor.  Change all callers.
        constructor.  Change all callers.
        (class Read_script): Add dirindex_ field.  Add it to constructor.
        (class Read_script): Add dirindex_ field.  Add it to constructor.
        Change all callers.
        Change all callers.
        * archive.cc (Archive::setup): Remove input_objects parameter.
        * archive.cc (Archive::setup): Remove input_objects parameter.
        Change all callers.
        Change all callers.
        (Archive::get_file_and_offset): Likewise.
        (Archive::get_file_and_offset): Likewise.
        (Archive::read_all_symbols): Likewise.
        (Archive::read_all_symbols): Likewise.
        (Archive::read_symbols): Likewise.
        (Archive::read_symbols): Likewise.
        (Archive::get_elf_object_for_member): Remove input_objects
        (Archive::get_elf_object_for_member): Remove input_objects
        parameter.  Add punconfigured parameter.  Change all callers.
        parameter.  Add punconfigured parameter.  Change all callers.
        (Archive::add_symbols): Change return type to bool.  Check return
        (Archive::add_symbols): Change return type to bool.  Check return
        value of include_member.
        value of include_member.
        (Archive::include_all_members): Likewise.
        (Archive::include_all_members): Likewise.
        (Archive::include_member): Change return type to bool.  Return
        (Archive::include_member): Change return type to bool.  Return
        false if first included object has incompatible target.  Set
        false if first included object has incompatible target.  Set
        included_member_ field.
        included_member_ field.
        (Add_archive_symbols::run): If add_symbols returns false, requeue
        (Add_archive_symbols::run): If add_symbols returns false, requeue
        Read_symbols task.
        Read_symbols task.
        * archive.h (class Archive): Add included_member_ field.
        * archive.h (class Archive): Add included_member_ field.
        Initialize it in constructor.  Add input_file and searched_for
        Initialize it in constructor.  Add input_file and searched_for
        methods.  Update declarations.
        methods.  Update declarations.
        (class Add_archive_symbols): Add dirpath_, dirindex_, and
        (class Add_archive_symbols): Add dirpath_, dirindex_, and
        input_argument_ fields.  Add them to constructor.  Change all
        input_argument_ fields.  Add them to constructor.  Change all
        callers.
        callers.
        * script.cc: Include "target-select.h".
        * script.cc: Include "target-select.h".
        (class Parser_closure): Add skip_on_incompatible_target_ and
        (class Parser_closure): Add skip_on_incompatible_target_ and
        found_incompatible_target_ fields.  Add
        found_incompatible_target_ fields.  Add
        skip_on_incompatible_target parameter to constructor.  Change all
        skip_on_incompatible_target parameter to constructor.  Change all
        callers.  Add methods skip_on_incompatible_target,
        callers.  Add methods skip_on_incompatible_target,
        clear_skip_on_incompatible_target, found_incompatible_target, and
        clear_skip_on_incompatible_target, found_incompatible_target, and
        set_found_incompatible_target.
        set_found_incompatible_target.
        (read_input_script): Add dirindex parameter.  Change all callers.
        (read_input_script): Add dirindex parameter.  Change all callers.
        If parser finds an incompatible target, requeue Read_symbols
        If parser finds an incompatible target, requeue Read_symbols
        task.
        task.
        (script_set_symbol): Clear skip_on_incompatible_target in
        (script_set_symbol): Clear skip_on_incompatible_target in
        closure.
        closure.
        (script_add_assertion, script_parse_option): Likewise.
        (script_add_assertion, script_parse_option): Likewise.
        (script_start_sections, script_add_phdr): Likewise.
        (script_start_sections, script_add_phdr): Likewise.
        (script_check_output_format): New function.
        (script_check_output_format): New function.
        * script.h (read_input_script): Update declaration.
        * script.h (read_input_script): Update declaration.
        * script-c.h (script_check_output_format): Declare.
        * script-c.h (script_check_output_format): Declare.
        * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
        * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
        (ignore_cmd): Remove OUTPUT_FORMAT.
        (ignore_cmd): Remove OUTPUT_FORMAT.
        * fileread.cc (Input_file::Input_file): Add explicit this.
        * fileread.cc (Input_file::Input_file): Add explicit this.
        (Input_file::will_search_for): New function.
        (Input_file::will_search_for): New function.
        (Input_file::open): Add pindex parameter.  Change all callers.
        (Input_file::open): Add pindex parameter.  Change all callers.
        * fileread.h (class Input_file): Add input_file_argument method.
        * fileread.h (class Input_file): Add input_file_argument method.
        Declare will_search_for.  Update declarations.
        Declare will_search_for.  Update declarations.
        * object.cc (make_elf_object): Add punconfigured parameter.
        * object.cc (make_elf_object): Add punconfigured parameter.
        Change all callers.
        Change all callers.
        * object.h (class Object): Make input_file public.  Add
        * object.h (class Object): Make input_file public.  Add
        searched_for method.
        searched_for method.
        (make_elf_object): Update declaration.
        (make_elf_object): Update declaration.
        * dirsearch.cc (Dirsearch::find): Add pindex parameter.  Use it to
        * dirsearch.cc (Dirsearch::find): Add pindex parameter.  Use it to
        restart search.
        restart search.
        * dirsearch.h (class Dirsearch): Update declaration.
        * dirsearch.h (class Dirsearch): Update declaration.
        * options.h (class General_options): Add --warn-search-mismatch.
        * options.h (class General_options): Add --warn-search-mismatch.
        * parameters.cc (Parameters::is_compatible_target): New function.
        * parameters.cc (Parameters::is_compatible_target): New function.
        * parameters.h (class Parameters): Declare is_compatible_target.
        * parameters.h (class Parameters): Declare is_compatible_target.
        * workqueue.cc (Workqueue::add_blocker): New function.
        * workqueue.cc (Workqueue::add_blocker): New function.
        * workqueue.h (class Workqueue): Declare add_blocker.
        * workqueue.h (class Workqueue): Declare add_blocker.
        * fileread.cc (Input_file::open): Remove options parameter.
        * fileread.cc (Input_file::open): Remove options parameter.
        Change all callers.
        Change all callers.
        (Input_file::open_binary): Likewise.
        (Input_file::open_binary): Likewise.
        * script.cc (read_input_script): Likewise.
        * script.cc (read_input_script): Likewise.
        * readsyms.h (class Read_symbols): Remove options_ field.  Remove
        * readsyms.h (class Read_symbols): Remove options_ field.  Remove
        options parameter from constructor.  Change all callers.
        options parameter from constructor.  Change all callers.
        (class Read_script): Likewise.
        (class Read_script): Likewise.
        * fileread.h (class Input_file): Update declarations.
        * fileread.h (class Input_file): Update declarations.
        * script.h (read_input_script): Update declaration.
        * script.h (read_input_script): Update declaration.
2009-03-10  Nick Clifton  
2009-03-10  Nick Clifton  
        * po/es.po: New Spanish translation.
        * po/es.po: New Spanish translation.
2009-03-06  Cary Coutant  
2009-03-06  Cary Coutant  
        * options.cc (parse_short_option): Keep dash_z from registering itself.
        * options.cc (parse_short_option): Keep dash_z from registering itself.
2009-03-03  Ian Lance Taylor  
2009-03-03  Ian Lance Taylor  
        PR 9918
        PR 9918
        * target-reloc.h (relocate_section): Pass output_section to
        * target-reloc.h (relocate_section): Pass output_section to
        relocate.
        relocate.
        * i386.cc (Target_i386::should_apply_static_reloc): Add
        * i386.cc (Target_i386::should_apply_static_reloc): Add
        output_section parameter.  Change all callers.
        output_section parameter.  Change all callers.
        (Target_i386::Relocate::relocate): Add output_section parameter.
        (Target_i386::Relocate::relocate): Add output_section parameter.
        * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
        * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
        * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
        * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
        * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
        * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
        * testsuite/two_file_shared.sh: New script.
        * testsuite/two_file_shared.sh: New script.
        * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
        (check_DATA): Add two_file_shared.dbg.
        (check_DATA): Add two_file_shared.dbg.
        (two_file_shared.dbg): New target.
        (two_file_shared.dbg): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2009-03-01  Ian Lance Taylor  
2009-03-01  Ian Lance Taylor  
        * configure.ac: Check for byteswap.h.
        * configure.ac: Check for byteswap.h.
        * configure: Rebuild.
        * configure: Rebuild.
        * config.in: Rebuild.
        * config.in: Rebuild.
2009-03-01  Mikolaj Zalewski  
2009-03-01  Mikolaj Zalewski  
        * layout.cc (Layout::find_or_add_kept_section): New function.
        * layout.cc (Layout::find_or_add_kept_section): New function.
        (Layout::add_comdat): Removed.
        (Layout::add_comdat): Removed.
        * layout.h (struct Kept_section): Move out of class Layout.
        * layout.h (struct Kept_section): Move out of class Layout.
        Remove trailing underscores from field names.  Add group_sections
        Remove trailing underscores from field names.  Add group_sections
        field.  Rename group_ field to is_group.  Change all uses.
        field.  Rename group_ field to is_group.  Change all uses.
        (class Layout): Declare find_or_add_kept_section, not add_comdat.
        (class Layout): Declare find_or_add_kept_section, not add_comdat.
        * object.cc (Sized_relobj::Sized_relobj): Don't initialize
        * object.cc (Sized_relobj::Sized_relobj): Don't initialize
        comdat_groups_ field.
        comdat_groups_ field.
        (Sized_relobj::include_section_group): Use
        (Sized_relobj::include_section_group): Use
        find_or_add_kept_section and Kept_section::group_sections.
        find_or_add_kept_section and Kept_section::group_sections.
        (Sized_relobj::include_linkonce_section): Likewise.
        (Sized_relobj::include_linkonce_section): Likewise.
        * object.cc (class Sized_relobj): Don't define Comdat_group or
        * object.cc (class Sized_relobj): Don't define Comdat_group or
        Comdat_group_table.  Remove find_comdat_group and
        Comdat_group_table.  Remove find_comdat_group and
        add_comdat_group.  Remove comdat_groups_ field.
        add_comdat_group.  Remove comdat_groups_ field.
        * plugin.cc (include_comdat_group): Use
        * plugin.cc (include_comdat_group): Use
        Layout::find_or_add_kept_section.
        Layout::find_or_add_kept_section.
2009-02-28  Ian Lance Taylor  
2009-02-28  Ian Lance Taylor  
        * README: --gc-sections and map files are now supported.  Document
        * README: --gc-sections and map files are now supported.  Document
        some build requirements.
        some build requirements.
        PR 6992
        PR 6992
        * symtab.cc (Symbol_table::sized_write_section_symbol): In a
        * symtab.cc (Symbol_table::sized_write_section_symbol): In a
        relocatable link set the value of the section symbol to zero.
        relocatable link set the value of the section symbol to zero.
        * object.cc (Sized_relobj::do_finalize_local_symbols): In a
        * object.cc (Sized_relobj::do_finalize_local_symbols): In a
        relocatable link don't include the section address in the local
        relocatable link don't include the section address in the local
        symbol value.
        symbol value.
2009-02-27  Ian Lance Taylor  
2009-02-27  Ian Lance Taylor  
        PR 6811
        PR 6811
        * options.h (class Search_directory): Add is_system_directory.
        * options.h (class Search_directory): Add is_system_directory.
        (class General_options): Declare is_in_system_directory.
        (class General_options): Declare is_in_system_directory.
        * options.cc (get_relative_sysroot): Make static.
        * options.cc (get_relative_sysroot): Make static.
        (get_default_sysroot): Make static.
        (get_default_sysroot): Make static.
        (General_optoins::is_in_system_directory): New function.
        (General_optoins::is_in_system_directory): New function.
        * fileread.cc (Input_file::is_in_system_directory): New function.
        * fileread.cc (Input_file::is_in_system_directory): New function.
        * fileread.h (class Input_file): Declare is_in_system_directory.
        * fileread.h (class Input_file): Declare is_in_system_directory.
        * object.h (class Object): Add is_in_system_directory.
        * object.h (class Object): Add is_in_system_directory.
        (class Input_objects): Remove system_library_directory_ field.
        (class Input_objects): Remove system_library_directory_ field.
        * object.cc (Input_objects::add_object): Don't set
        * object.cc (Input_objects::add_object): Don't set
        system_library_directory_.
        system_library_directory_.
        (input_objects::found_in_system_library_directory): Remove.
        (input_objects::found_in_system_library_directory): Remove.
        * symtab.cc (Symbol_table::write_globals): Remove input_objects
        * symtab.cc (Symbol_table::write_globals): Remove input_objects
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
        (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
        Call Object::is_in_system_directory.
        Call Object::is_in_system_directory.
        * symtab.h (class Symbol_table): Update declarations.
        * symtab.h (class Symbol_table): Update declarations.
        PR 5990
        PR 5990
        * descriptors.h (Open_descriptor): Add is_on_stack field.
        * descriptors.h (Open_descriptor): Add is_on_stack field.
        * descriptors.cc (Descriptors::open): If the descriptor is on the
        * descriptors.cc (Descriptors::open): If the descriptor is on the
        top of the stack, remove it.  Initialize is_on_stack field.
        top of the stack, remove it.  Initialize is_on_stack field.
        (Descriptors::release): Only add pod to stack if it is not on the
        (Descriptors::release): Only add pod to stack if it is not on the
        stack already.
        stack already.
        (Descriptors::close_some_descriptor): Clear stack_next and
        (Descriptors::close_some_descriptor): Clear stack_next and
        is_on_stack fields.
        is_on_stack fields.
        PR 7091
        PR 7091
        * output.cc (Output_section::find_starting_output_address): Rename
        * output.cc (Output_section::find_starting_output_address): Rename
        from starting_output_address; add PADDR parameter; change return
        from starting_output_address; add PADDR parameter; change return
        type.
        type.
        * output.h (class Output_section): Declare
        * output.h (class Output_section): Declare
        find_starting_output_address instead of starting_output_address.
        find_starting_output_address instead of starting_output_address.
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
        * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
        section symbol for which we can't find a merge section.
        section symbol for which we can't find a merge section.
        PR 9836
        PR 9836
        * symtab.cc (Symbol_table::add_from_object): If the visibility is
        * symtab.cc (Symbol_table::add_from_object): If the visibility is
        hidden or internal, force the symbol to be local.
        hidden or internal, force the symbol to be local.
        * resolve.cc (Symbol::override_visibility): Define.
        * resolve.cc (Symbol::override_visibility): Define.
        (Symbol::override_base): Use override_visibility.
        (Symbol::override_base): Use override_visibility.
        (Symbol_table::resolve): Likewise.
        (Symbol_table::resolve): Likewise.
        (Symbol::override_base_with_special): Likewise.
        (Symbol::override_base_with_special): Likewise.
        (Symbol_table::override_with_special): If the visibility is hidden
        (Symbol_table::override_with_special): If the visibility is hidden
        or internal, force the symbol to be local.
        or internal, force the symbol to be local.
        * symtab.h (class Symbol): Add set_visibility and
        * symtab.h (class Symbol): Add set_visibility and
        override_visibility.
        override_visibility.
        * testsuite/ver_test_1.sh: New file.
        * testsuite/ver_test_1.sh: New file.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
        (check_DATA): Add ver_test_1.syms.
        (check_DATA): Add ver_test_1.syms.
        (ver_test_1.syms): New target.
        (ver_test_1.syms): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2009-02-25  Cary Coutant  
2009-02-25  Cary Coutant  
        * layout.cc (Layout::choose_output_section): Don't rename sections
        * layout.cc (Layout::choose_output_section): Don't rename sections
        when using a linker script that has a SECTIONS clause.
        when using a linker script that has a SECTIONS clause.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * testsuite/Makefile.am (script_test_5.sh): New test case.
        * testsuite/Makefile.am (script_test_5.sh): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/script_test_5.cc: New file.
        * testsuite/script_test_5.cc: New file.
        * testsuite/script_test_5.sh: New file.
        * testsuite/script_test_5.sh: New file.
        * testsuite/script_test_5.t: New file.
        * testsuite/script_test_5.t: New file.
2009-02-13  Rafael Avila de Espindola  
2009-02-13  Rafael Avila de Espindola  
        * archive.cc (Archive::include_member): Update calls to add_symbols.
        * archive.cc (Archive::include_member): Update calls to add_symbols.
        * dynobj.cc (Sized_dynobj::make_version_map): Add
        * dynobj.cc (Sized_dynobj::make_version_map): Add
        the Layout argument.
        the Layout argument.
        * dynobj.h (do_add_symbols): Add the Layout argument.
        * dynobj.h (do_add_symbols): Add the Layout argument.
        * object.cc (Sized_relobj::do_add_symbols): Add the
        * object.cc (Sized_relobj::do_add_symbols): Add the
        Layout argument.
        Layout argument.
        * object.h (Object::add_symbols): Add the Layout argument.
        * object.h (Object::add_symbols): Add the Layout argument.
        (Object::do_add_symbols): Add the Layout argument.
        (Object::do_add_symbols): Add the Layout argument.
        (Sized_relobj::do_add_symbols): Add the Layout argument.
        (Sized_relobj::do_add_symbols): Add the Layout argument.
        * plugin.cc (Sized_pluginobj::do_add_symbols):
        * plugin.cc (Sized_pluginobj::do_add_symbols):
        Unify the two versions.
        Unify the two versions.
        (Add_plugin_symbols): Remove.
        (Add_plugin_symbols): Remove.
        * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
        * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
        (Sized_pluginobj::do_add_symbols): Unify the two versions.
        (Sized_pluginobj::do_add_symbols): Unify the two versions.
        (Add_plugin_symbols): Remove.
        (Add_plugin_symbols): Remove.
        * readsyms.cc (Read_symbols::do_read_symbols): Update call to
        * readsyms.cc (Read_symbols::do_read_symbols): Update call to
        Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
        Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
        (Add_symbols::run): Make it work with Pulginobj.
        (Add_symbols::run): Make it work with Pulginobj.
2009-02-06  Ian Lance Taylor  
2009-02-06  Ian Lance Taylor  
        * object.cc (Sized_relobj::do_layout): Make info message start
        * object.cc (Sized_relobj::do_layout): Make info message start
        with lower case letter.
        with lower case letter.
2009-02-06  Mikolaj Zalewski  
2009-02-06  Mikolaj Zalewski  
        * binary.cc: Fix file comment.
        * binary.cc: Fix file comment.
        * options.h (enum Incremental_disposition): Define.
        * options.h (enum Incremental_disposition): Define.
        (class General_options): Add new options: --incremental,
        (class General_options): Add new options: --incremental,
        --incremental_changed, --incremental_unchanged,
        --incremental_changed, --incremental_unchanged,
        --incremental_unknown.  Add incremental_disposition_ and
        --incremental_unknown.  Add incremental_disposition_ and
        implicit_incremental_ fields.
        implicit_incremental_ fields.
        (General_options::incremental_disposition): New function.
        (General_options::incremental_disposition): New function.
        (class Position_dependent_options): Add incremental_disposition
        (class Position_dependent_options): Add incremental_disposition
        option.
        option.
        (Position_dependent_options::copy_from_options): Set incremental
        (Position_dependent_options::copy_from_options): Set incremental
        dispositions.
        dispositions.
        * options.cc (General_options::parse_incremental_changed): New
        * options.cc (General_options::parse_incremental_changed): New
        function.
        function.
        (General_options::parse_incremental_unchanged): New function.
        (General_options::parse_incremental_unchanged): New function.
        (General_options::parse_incremental_unknown): New function.
        (General_options::parse_incremental_unknown): New function.
        (General_options::General_options): Initialize new fields
        (General_options::General_options): Initialize new fields
        incremental_disposition_ and implicit_incremental_.
        incremental_disposition_ and implicit_incremental_.
        (General_options::finalize): Check for uasge of --incremental-*
        (General_options::finalize): Check for uasge of --incremental-*
        without --incremental.
        without --incremental.
2009-02-06  Chris Demetriou  
2009-02-06  Chris Demetriou  
        * gold.h (gold_undefined_symbol): Change to take only a Symbol
        * gold.h (gold_undefined_symbol): Change to take only a Symbol
        pointer and to report location as the file name associated with
        pointer and to report location as the file name associated with
        the symbol.
        the symbol.
        (gold_undefined_symbol_at_location): New function to replace the
        (gold_undefined_symbol_at_location): New function to replace the
        old gold_undefined_symbol functionality.
        old gold_undefined_symbol functionality.
        * target-reloc.h (relocate_section): Update to use
        * target-reloc.h (relocate_section): Update to use
        gold_undefined_symbol_at_location.
        gold_undefined_symbol_at_location.
        * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
        * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
        Call gold_undefined_symbol function rather than gold_error.
        Call gold_undefined_symbol function rather than gold_error.
        * errors.h (Errors::undefined_symbol): Take location as a
        * errors.h (Errors::undefined_symbol): Take location as a
        string, rather than calculating it from a relocation.
        string, rather than calculating it from a relocation.
        * errors.cc (Errors::fatal): Print "fatal error:" before the
        * errors.cc (Errors::fatal): Print "fatal error:" before the
        formatted message.
        formatted message.
        (Errors::error, Errors::error_at_location): Print "error: "
        (Errors::error, Errors::error_at_location): Print "error: "
        before the formatted message.
        before the formatted message.
        (Errors::undefined_symbol): Take location as a string, rather
        (Errors::undefined_symbol): Take location as a string, rather
        than calculating it from a relocation.
        than calculating it from a relocation.
        (gold_undefined_symbol_at_location): New function akin to
        (gold_undefined_symbol_at_location): New function akin to
        old gold_undefined_symbol, calculates location from relocation.
        old gold_undefined_symbol, calculates location from relocation.
        (gold_undefined_symbol): Change to take only a Symbol pointer
        (gold_undefined_symbol): Change to take only a Symbol pointer
        and to report location as the file name associated with the symbol.
        and to report location as the file name associated with the symbol.
        * testsuite/debug_msg.sh: Update for changed error messages.
        * testsuite/debug_msg.sh: Update for changed error messages.
        * testsuite/undef_symbol.sh: Likewise.
        * testsuite/undef_symbol.sh: Likewise.
2009-02-04  Duncan Sands  
2009-02-04  Duncan Sands  
        PR 9812
        PR 9812
        * reduced_debug_output.h
        * reduced_debug_output.h
        (Output_reduced_debug_abbrev_section::failed): Use format for
        (Output_reduced_debug_abbrev_section::failed): Use format for
        gold_warning.
        gold_warning.
        (Output_reduced_debug_info_section::faild): Likewise.
        (Output_reduced_debug_info_section::faild): Likewise.
2009-01-31  Mikolaj Zalewski  
2009-01-31  Mikolaj Zalewski  
        * script.cc (Lazy_demangler): New class.
        * script.cc (Lazy_demangler): New class.
        (Version_script_info::get_symbol_version_helper): Demangle a
        (Version_script_info::get_symbol_version_helper): Demangle a
        symbol only once.
        symbol only once.
2009-01-29  Cary Coutant  
2009-01-29  Cary Coutant  
        * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
        * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
        to __tls_get_addr.
        to __tls_get_addr.
        * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
        * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2009-01-28  Ian Lance Taylor  
2009-01-28  Ian Lance Taylor  
        * version.cc (version_string): Bump to 1.9.
        * version.cc (version_string): Bump to 1.9.
        * gold.h: Include  and .
        * gold.h: Include  and .
        * version.cc: Include .
        * version.cc: Include .
        * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
        * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
        warning.
        warning.
        * reduced_debug_output.cc (insert_into_vector): Rename from
        * reduced_debug_output.cc (insert_into_vector): Rename from
        Insert_into_vector; change all callers.  Use Swap_unaligned to
        Insert_into_vector; change all callers.  Use Swap_unaligned to
        avoid aliasing issue; remove union since it is unnecessary.
        avoid aliasing issue; remove union since it is unnecessary.
2009-01-27  Sriraman Tallam  
2009-01-27  Sriraman Tallam  
        * Makefile.am (CCFILES): Add gc.cc.
        * Makefile.am (CCFILES): Add gc.cc.
        (HFILES): Add gc.h.
        (HFILES): Add gc.h.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * gold.cc (Gc_runner): New class.
        * gold.cc (Gc_runner): New class.
        (queue_initial_tasks): Call garbage collection related tasks
        (queue_initial_tasks): Call garbage collection related tasks
        when corresponding options are invoked.
        when corresponding options are invoked.
        (queue_middle_gc_tasks): New function.
        (queue_middle_gc_tasks): New function.
        (queue_middle_tasks): Reorder tasks to allow relocs to be read and
        (queue_middle_tasks): Reorder tasks to allow relocs to be read and
        processed early before laying out sections during garbage collection.
        processed early before laying out sections during garbage collection.
        * gold.h (queue_middle_gc_tasks): New function.
        * gold.h (queue_middle_gc_tasks): New function.
        (is_prefix_of): Move from "layout.cc".
        (is_prefix_of): Move from "layout.cc".
        * i386.cc (Target_i386::gc_process_relocs): New function.
        * i386.cc (Target_i386::gc_process_relocs): New function.
        * layout.cc (is_prefix_of): Remove. Move to "gold.h"
        * layout.cc (is_prefix_of): Remove. Move to "gold.h"
        * main.cc (main): Create object of class "Garbage_collection".
        * main.cc (main): Create object of class "Garbage_collection".
        * object.cc (Relobj::copy_symbols_data): New function.
        * object.cc (Relobj::copy_symbols_data): New function.
        (Relobj::is_section_name_included): New function.
        (Relobj::is_section_name_included): New function.
        (Sized_relobj::do_layout): Allow this function to be called twice
        (Sized_relobj::do_layout): Allow this function to be called twice
        during garbage collection and defer layout of section during the
        during garbage collection and defer layout of section during the
        first call.
        first call.
        * object.h (Relobj::get_symbols_data): New function.
        * object.h (Relobj::get_symbols_data): New function.
        (Relobj::is_section_name_included): New function.
        (Relobj::is_section_name_included): New function.
        (Relobj::copy_symbols_data): New function.
        (Relobj::copy_symbols_data): New function.
        (Relobj::set_symbols_data): New function.
        (Relobj::set_symbols_data): New function.
        (Relobj::get_relocs_data): New function.
        (Relobj::get_relocs_data): New function.
        (Relobj::set_relocs_data): New function.
        (Relobj::set_relocs_data): New function.
        (Relobj::is_output_section_offset_invalid): New pure virtual function.
        (Relobj::is_output_section_offset_invalid): New pure virtual function.
        (Relobj::gc_process_relocs): New function.
        (Relobj::gc_process_relocs): New function.
        (Relobj::do_gc_process_relocs): New pure virtual function.
        (Relobj::do_gc_process_relocs): New pure virtual function.
        (Relobj::sd_): New data member.
        (Relobj::sd_): New data member.
        (Sized_relobj::is_output_section_offset_invalid): New function.
        (Sized_relobj::is_output_section_offset_invalid): New function.
        (Sized_relobj::do_gc_process_relocs): New function.
        (Sized_relobj::do_gc_process_relocs): New function.
        * options.h (General_options::gc_sections): Modify to not be a no-op.
        * options.h (General_options::gc_sections): Modify to not be a no-op.
        (General_options::print_gc_sections): New option.
        (General_options::print_gc_sections): New option.
        * plugin.cc (Plugin_finish::run): Remove function call to
        * plugin.cc (Plugin_finish::run): Remove function call to
        Plugin_manager::layout_deferred_objects.  Move it to "gold.cc".
        Plugin_manager::layout_deferred_objects.  Move it to "gold.cc".
        * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
        * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
        * reloc.cc (Read_relocs::run): Add task to process relocs and
        * reloc.cc (Read_relocs::run): Add task to process relocs and
        determine unreferenced sections when doing garbage collection.
        determine unreferenced sections when doing garbage collection.
        (Gc_process_relocs): New class.
        (Gc_process_relocs): New class.
        (Sized_relobj::do_gc_process_relocs): New function.
        (Sized_relobj::do_gc_process_relocs): New function.
        (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
        (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
        sections that are garbage collected.
        sections that are garbage collected.
        * reloc.h (Gc_process_relocs): New class.
        * reloc.h (Gc_process_relocs): New class.
        * sparc.cc (Target_sparc::gc_process_relocs): New function.
        * sparc.cc (Target_sparc::gc_process_relocs): New function.
        * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
        * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
        symbols whose corresponding sections are garbage collected.
        symbols whose corresponding sections are garbage collected.
        (Symbol_table::Symbol_table): Add new parameter for the garbage
        (Symbol_table::Symbol_table): Add new parameter for the garbage
        collection object.
        collection object.
        (Symbol_table::gc_mark_undef_symbols): New function.
        (Symbol_table::gc_mark_undef_symbols): New function.
        (Symbol_table::gc_mark_symbol_for_shlib): New function.
        (Symbol_table::gc_mark_symbol_for_shlib): New function.
        (Symbol_table::gc_mark_dyn_syms): New function.
        (Symbol_table::gc_mark_dyn_syms): New function.
        (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
        (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
        as garbage.
        as garbage.
        (Symbol_table::add_from_object): Likewise.
        (Symbol_table::add_from_object): Likewise.
        (Symbol_table::add_from_relobj): When building shared objects, do not
        (Symbol_table::add_from_relobj): When building shared objects, do not
        treat externally visible symbols as garbage.
        treat externally visible symbols as garbage.
        (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
        (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
        table information for static and relocatable links.
        table information for static and relocatable links.
        * symtab.h (Symbol_table::set_gc): New function.
        * symtab.h (Symbol_table::set_gc): New function.
        (Symbol_table::gc): New function.
        (Symbol_table::gc): New function.
        (Symbol_table::gc_mark_undef_symbols): New function.
        (Symbol_table::gc_mark_undef_symbols): New function.
        (Symbol_table::gc_mark_symbol_for_shlib): New function.
        (Symbol_table::gc_mark_symbol_for_shlib): New function.
        (Symbol_table::gc_mark_dyn_syms): New function.
        (Symbol_table::gc_mark_dyn_syms): New function.
        (Symbol_table::gc_): New data member.
        (Symbol_table::gc_): New data member.
        * target.h (Sized_target::gc_process_relocs): New pure virtual
        * target.h (Sized_target::gc_process_relocs): New pure virtual
        function.
        function.
        * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
        * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
        * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
        * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2009-01-20  Chris Faylor 
2009-01-20  Chris Faylor 
        * options.h (General_options::gc_sections): Define as a no-op for now.
        * options.h (General_options::gc_sections): Define as a no-op for now.
        (General_options::no_keep_memory): Ditto.
        (General_options::no_keep_memory): Ditto.
        (General_options::Bshareable): Define.
        (General_options::Bshareable): Define.
        * options.cc (General_options::finalize): Honor -Bshareable.
        * options.cc (General_options::finalize): Honor -Bshareable.
2009-01-20  Andreas Schwab  
2009-01-20  Andreas Schwab  
        * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
        * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
        read the value in the contents, since we don't use it.  Use the
        read the value in the contents, since we don't use it.  Use the
        template endianness when writing.
        template endianness when writing.
        (Relocate::relocate): Use it for R_PPC_REL16_HA.
        (Relocate::relocate): Use it for R_PPC_REL16_HA.
2009-01-19  Andreas Schwab  
2009-01-19  Andreas Schwab  
        * configure.tgt (powerpc64-*): Fix targ_obj.
        * configure.tgt (powerpc64-*): Fix targ_obj.
2009-01-15  Ian Lance Taylor  
2009-01-15  Ian Lance Taylor  
        * object.cc (Sized_relobj::write_local_symbols): Don't write out
        * object.cc (Sized_relobj::write_local_symbols): Don't write out
        local symbols when stripping all symbols.
        local symbols when stripping all symbols.
2009-01-14  Cary Coutant  
2009-01-14  Cary Coutant  
        * output.cc (Output_reloc): Add explicit instantiations.
        * output.cc (Output_reloc): Add explicit instantiations.
2009-01-14  Cary Coutant  
2009-01-14  Cary Coutant  
        * archive.cc (Archive::get_elf_object_for_member): Remove call
        * archive.cc (Archive::get_elf_object_for_member): Remove call
        to File_read::claim_for_plugin.
        to File_read::claim_for_plugin.
        * descriptors.cc (Descriptors::open): Remove reference to
        * descriptors.cc (Descriptors::open): Remove reference to
        is_claimed.
        is_claimed.
        (Descriptors::claim_for_plugin): Remove.
        (Descriptors::claim_for_plugin): Remove.
        * descriptors.h (Descriptors::claim_for_plugin): Remove.
        * descriptors.h (Descriptors::claim_for_plugin): Remove.
        (Descriptors::is_claimed): Remove.
        (Descriptors::is_claimed): Remove.
        (claim_descriptor_for_plugin): Remove.
        (claim_descriptor_for_plugin): Remove.
        * fileread.cc (File_read::claim_for_plugin): Remove.
        * fileread.cc (File_read::claim_for_plugin): Remove.
        * fileread.h (File_read::claim_for_plugin): Remove.
        * fileread.h (File_read::claim_for_plugin): Remove.
        (File_read::descriptor): Reopen descriptor if necessary.
        (File_read::descriptor): Reopen descriptor if necessary.
        * plugin.cc  (Plugin::load): Add two new APIs to transfer vector.
        * plugin.cc  (Plugin::load): Add two new APIs to transfer vector.
        (Plugin_manager::all_symbols_read): Add task parameter. Change
        (Plugin_manager::all_symbols_read): Add task parameter. Change
        all callers.
        all callers.
        (Plugin_manager::get_input_file): New function.
        (Plugin_manager::get_input_file): New function.
        (Plugin_manager::release_input_file): New function.
        (Plugin_manager::release_input_file): New function.
        (Pluginobj::Pluginobj): Add filesize parameter and initialize
        (Pluginobj::Pluginobj): Add filesize parameter and initialize
        corresponding data member.
        corresponding data member.
        (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
        (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
        and pass to base constructor. Change all callers.
        and pass to base constructor. Change all callers.
        (get_input_file, release_input_file): New functions.
        (get_input_file, release_input_file): New functions.
        (make_sized_plugin_object): Add filesize parameter. Change all callers.
        (make_sized_plugin_object): Add filesize parameter. Change all callers.
        * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
        * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
        (Plugin_manager::all_symbols_read): Add task parameter.
        (Plugin_manager::all_symbols_read): Add task parameter.
        (Plugin_manager::get_input_file): New function.
        (Plugin_manager::get_input_file): New function.
        (Plugin_manager::release_input_file): New function.
        (Plugin_manager::release_input_file): New function.
        (Plugin_manager::task_): New data member.
        (Plugin_manager::task_): New data member.
        (Pluginobj::Pluginobj): Add filesize parameter.
        (Pluginobj::Pluginobj): Add filesize parameter.
        (Pluginobj::filename): New function.
        (Pluginobj::filename): New function.
        (Pluginobj::descriptor): New function.
        (Pluginobj::descriptor): New function.
        (Pluginobj::filesize): New function.
        (Pluginobj::filesize): New function.
        (Pluginobj::filesize_): New data member.
        (Pluginobj::filesize_): New data member.
        (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
        (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
        * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
        * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
        File_read::claim_for_plugin; use Object::unlock to unlock the file.
        File_read::claim_for_plugin; use Object::unlock to unlock the file.
        * testsuite/Makefile.am (plugin_test_4): New test case for plugins
        * testsuite/Makefile.am (plugin_test_4): New test case for plugins
        with archive libraries.
        with archive libraries.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/plugin_test.c (struct sym_info): New type.
        * testsuite/plugin_test.c (struct sym_info): New type.
        (get_input_file, release_input_file): New static variables.
        (get_input_file, release_input_file): New static variables.
        (onload): Capture new transfer vector entries.
        (onload): Capture new transfer vector entries.
        (claim_file_hook): Stop reading at end of file according to filesize.
        (claim_file_hook): Stop reading at end of file according to filesize.
        Factor out parsing of readelf output into separate function.
        Factor out parsing of readelf output into separate function.
        (all_symbols_read_hook): Exercise get_input_file and release_input_file
        (all_symbols_read_hook): Exercise get_input_file and release_input_file
        APIs and get the source file name from the symbol table.  Convert
        APIs and get the source file name from the symbol table.  Convert
        source file name to corresponding object file name.  Print info
        source file name to corresponding object file name.  Print info
        message when adding new input files.
        message when adding new input files.
        (parse_readelf_line): New function.
        (parse_readelf_line): New function.
        * testsuite/plugin_test_1.sh: Add checks for new info messages.
        * testsuite/plugin_test_1.sh: Add checks for new info messages.
        * testsuite/plugin_test_2.sh: Likewise.
        * testsuite/plugin_test_2.sh: Likewise.
        * testsuite/plugin_test_3.sh: Likewise.
        * testsuite/plugin_test_3.sh: Likewise.
        * testsuite/plugin_test_4.sh: New test case.
        * testsuite/plugin_test_4.sh: New test case.
2009-01-07  Ian Lance Taylor  
2009-01-07  Ian Lance Taylor  
        * version.cc (version_string): Bump to 1.8.
        * version.cc (version_string): Bump to 1.8.
2008-12-23  Cary Coutant  
2008-12-23  Cary Coutant  
        * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
        * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
        * plugin.cc (Plugin_manager::finish): Rename as
        * plugin.cc (Plugin_manager::finish): Rename as
        layout_deferred_objects.  Move cleanup to separate function.
        layout_deferred_objects.  Move cleanup to separate function.
        (Plugin_manager::cleanup): New function.
        (Plugin_manager::cleanup): New function.
        (Plugin_finish::run): Call layout_deferred_objects and cleanup
        (Plugin_finish::run): Call layout_deferred_objects and cleanup
        separately.
        separately.
        * plugin.h (Plugin_manager::finish): Rename as
        * plugin.h (Plugin_manager::finish): Rename as
        layout_deferred_objects.
        layout_deferred_objects.
        (Plugin_manager::cleanup): New function.
        (Plugin_manager::cleanup): New function.
        (Plugin_manager::cleanup_done): New field.
        (Plugin_manager::cleanup_done): New field.
2008-12-23  Cary Coutant  
2008-12-23  Cary Coutant  
        * plugin.cc (is_visible_from_outside): New function.
        * plugin.cc (is_visible_from_outside): New function.
        (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
        (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
        so we don't return "IR only" status for exported symbols or -r links.
        so we don't return "IR only" status for exported symbols or -r links.
        * testsuite/Makefile.am (plugin_test_3): New test case.
        * testsuite/Makefile.am (plugin_test_3): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/plugin_test_3.sh: New file.
        * testsuite/plugin_test_3.sh: New file.
2008-12-22  Cary Coutant  
2008-12-22  Cary Coutant  
        * object.cc (Sized_relobj::layout_section): New function.
        * object.cc (Sized_relobj::layout_section): New function.
        (Sized_relobj::do_layout): Defer layout of input sections until after
        (Sized_relobj::do_layout): Defer layout of input sections until after
        plugin has provided replacement files.
        plugin has provided replacement files.
        (Sized_relobj::do_layout_deferred_sections): New function.
        (Sized_relobj::do_layout_deferred_sections): New function.
        * object.h (Relobj::set_section_offset): Remove virtual keyword.
        * object.h (Relobj::set_section_offset): Remove virtual keyword.
        (Relobj::layout_deferred_sections): New function.
        (Relobj::layout_deferred_sections): New function.
        (Relobj::do_layout_deferred_sections): New function.
        (Relobj::do_layout_deferred_sections): New function.
        (Sized_relobj::do_layout_deferred_sections): New function.
        (Sized_relobj::do_layout_deferred_sections): New function.
        (Sized_relobj::layout_section): New function.
        (Sized_relobj::layout_section): New function.
        (Sized_relobj::Deferred_layout): New structure.
        (Sized_relobj::Deferred_layout): New structure.
        (Sized_relobj::deferred_layout_): New field.
        (Sized_relobj::deferred_layout_): New field.
        * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
        * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
        Change all callers.  Layout deferred sections.
        Change all callers.  Layout deferred sections.
        (class Plugin_finish): Renamed, was Plugin_cleanup.  Change all
        (class Plugin_finish): Renamed, was Plugin_cleanup.  Change all
        references.
        references.
        (Plugin_hook::run): Move code from do_plugin_hook inline.
        (Plugin_hook::run): Move code from do_plugin_hook inline.
        (Plugin_hook::do_plugin_hook): Remove.
        (Plugin_hook::do_plugin_hook): Remove.
        * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
        * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
        (Plugin_manager::finish): Renamed, was cleanup.
        (Plugin_manager::finish): Renamed, was cleanup.
        (Plugin_manager::should_defer_layout): New function.
        (Plugin_manager::should_defer_layout): New function.
        (Plugin_manager::add_deferred_layout_object): New function.
        (Plugin_manager::add_deferred_layout_object): New function.
        (Plugin_manager::Deferred_layout_list): New type.
        (Plugin_manager::Deferred_layout_list): New type.
        (Plugin_manager::deferred_layout_objects_): New field.
        (Plugin_manager::deferred_layout_objects_): New field.
        (Plugin_hook::do_plugin_hook): Remove.
        (Plugin_hook::do_plugin_hook): Remove.
2008-12-17  Ian Lance Taylor  
2008-12-17  Ian Lance Taylor  
        * options.h (class General_options): Add --no case for
        * options.h (class General_options): Add --no case for
        --export-dynamic.
        --export-dynamic.
2008-12-16  Cary Coutant  
2008-12-16  Cary Coutant  
        * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
        * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
        vector.
        vector.
        (Plugin_manager::claim_file): Create plugin object even if
        (Plugin_manager::claim_file): Create plugin object even if
        plugin did not call the add_symbols callback.
        plugin did not call the add_symbols callback.
        (Plugin_obj::get_symbol_resolution_info): Guard against plugin
        (Plugin_obj::get_symbol_resolution_info): Guard against plugin
        asking for more symbols than were added.
        asking for more symbols than were added.
        * testsuite/Makefile.am (plugin_test_1): Add test case with
        * testsuite/Makefile.am (plugin_test_1): Add test case with
        no global symbols.
        no global symbols.
        (empty.syms): New target.
        (empty.syms): New target.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/plugin_test.c (claim_file_hook): Add new debug
        * testsuite/plugin_test.c (claim_file_hook): Add new debug
        message. Don't call add_symbols if no globals.
        message. Don't call add_symbols if no globals.
        (all_symbols_read_hook): Don't provide replacement for empty
        (all_symbols_read_hook): Don't provide replacement for empty
        claimed file.
        claimed file.
2008-12-12  Ian Lance Taylor  
2008-12-12  Ian Lance Taylor  
        * target-reloc.h (Default_scan_relocatable_relocs): Only discard
        * target-reloc.h (Default_scan_relocatable_relocs): Only discard
        r_type == 0 for a local symbol with r_sym == 0.
        r_type == 0 for a local symbol with r_sym == 0.
        (scan_relocatable_relocs): Pass r_sym to
        (scan_relocatable_relocs): Pass r_sym to
        local_non_section_strategy.
        local_non_section_strategy.
        * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
        * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
        r_sym parameter.
        r_sym parameter.
        * configure.ac: Update test for TLS descriptors: they are
        * configure.ac: Update test for TLS descriptors: they are
        supported as of glibc 2.9.
        supported as of glibc 2.9.
        * configure: Rebuild.
        * configure: Rebuild.
2008-12-11  Ian Lance Taylor  
2008-12-11  Ian Lance Taylor  
        PR 7091
        PR 7091
        * target-reloc.h (Default_scan_relocatable_relocs): For each
        * target-reloc.h (Default_scan_relocatable_relocs): For each
        function, map r_type == 0 to RELOC_DISCARD.
        function, map r_type == 0 to RELOC_DISCARD.
2008-12-10  Cary Coutant  
2008-12-10  Cary Coutant  
        * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
        * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
        object to override a kept COMDAT group from a plugin object.
        object to override a kept COMDAT group from a plugin object.
2008-12-09  Ian Lance Taylor  
2008-12-09  Ian Lance Taylor  
        PR 7088
        PR 7088
        * yyscript.y (file_cmd): Handle INPUT.
        * yyscript.y (file_cmd): Handle INPUT.
        * testsuite/initpri1.c: Change all declarations to be full
        * testsuite/initpri1.c: Change all declarations to be full
        prototypes by adding void, to avoid compiler warnings.
        prototypes by adding void, to avoid compiler warnings.
2008-12-05  Rafael Avila de Espindola  
2008-12-05  Rafael Avila de Espindola  
        * options.cc (General_options::parse_plugin_opt): New.
        * options.cc (General_options::parse_plugin_opt): New.
        (General_options::add_plugin): The argument now is just the filename.
        (General_options::add_plugin): The argument now is just the filename.
        (General_options::add_plugin_option): New.
        (General_options::add_plugin_option): New.
        * options.h (plugin_opt): New.
        * options.h (plugin_opt): New.
        (add_plugin): Change argument name.
        (add_plugin): Change argument name.
        (add_plugin_option): New.
        (add_plugin_option): New.
        * plugin.cc (Plugin::load): Don't parse the plugin option.
        * plugin.cc (Plugin::load): Don't parse the plugin option.
        * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
        * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
        (Plugin::add_option): New.
        (Plugin::add_option): New.
        (Plugin::args_): Change type.
        (Plugin::args_): Change type.
        (Plugin::filename_): New.
        (Plugin::filename_): New.
        (Plugin_manager::add_plugin_option): New.
        (Plugin_manager::add_plugin_option): New.
        * testsuite/Makefile.am (plugin_test_1): Use new syntax.
        * testsuite/Makefile.am (plugin_test_1): Use new syntax.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
2008-12-05  Cary Coutant  
2008-12-05  Cary Coutant  
        * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
        * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
        Handle --strip-lto-sections option.
        Handle --strip-lto-sections option.
        * options.h (strip_lto_sections): New option.
        * options.h (strip_lto_sections): New option.
2008-12-01  Cary Coutant  
2008-12-01  Cary Coutant  
        * plugin.cc (ld_plugin_message): Change format parameter to const.
        * plugin.cc (ld_plugin_message): Change format parameter to const.
        Fix mismatch between new[] and delete.
        Fix mismatch between new[] and delete.
2008-11-14  Cary Coutant  
2008-11-14  Cary Coutant  
        * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
        * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
        instead of -1U.
        instead of -1U.
2008-11-05  Craig Silverstein  
2008-11-05  Craig Silverstein  
        * options.cc (General_options::parse_dynamic_list): New function.
        * options.cc (General_options::parse_dynamic_list): New function.
        * options.h (General_options): New flags dynamic_list,
        * options.h (General_options): New flags dynamic_list,
        dynamic_list_data, dynamic_list_cpp_new, and
        dynamic_list_data, dynamic_list_cpp_new, and
        dynamic_list_cpp_typeinfo.  New variable dynamic_list_.
        dynamic_list_cpp_typeinfo.  New variable dynamic_list_.
        (General_options::in_dynamic_list): New function.
        (General_options::in_dynamic_list): New function.
        * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
        * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
        (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
        (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
        (Lex::can_continue_name): Likewise.
        (Lex::can_continue_name): Likewise.
        (yylex): Likewise.
        (yylex): Likewise.
        (read_script_file): New parameter script_options.
        (read_script_file): New parameter script_options.
        (read_dynamic_list): New function.
        (read_dynamic_list): New function.
        (Script_options::define_dynamic_list): New function.
        (Script_options::define_dynamic_list): New function.
        (dynamic_list_keyword_parsecodes): New variable.
        (dynamic_list_keyword_parsecodes): New variable.
        (dynamic_list_keywords): New variable.
        (dynamic_list_keywords): New variable.
        * script.h (Script_options::define_dynamic_list): New function
        * script.h (Script_options::define_dynamic_list): New function
        prototype.
        prototype.
        (read_dynamic_list): New function prototype.
        (read_dynamic_list): New function prototype.
        * symtab.cc (strprefix): New macro.
        * symtab.cc (strprefix): New macro.
        (Symbol::should_add_dynsym_entry): Support dynamic_list,
        (Symbol::should_add_dynsym_entry): Support dynamic_list,
        dynamic_list_data, dynamic_list_cpp_new, and
        dynamic_list_data, dynamic_list_cpp_new, and
        dynamic_list_cpp_typeinfo.
        dynamic_list_cpp_typeinfo.
        * yyscript.y (PARSING_DYNAMIC_LIST): New token.
        * yyscript.y (PARSING_DYNAMIC_LIST): New token.
        (dynamic_list_expr): New rule.
        (dynamic_list_expr): New rule.
        (dynamic_list_nodes): Likewise.
        (dynamic_list_nodes): Likewise.
        (dynamic_list_node): Likewise.
        (dynamic_list_node): Likewise.
        * testsuite/Makefile.am (dynamic_list): New test.
        * testsuite/Makefile.am (dynamic_list): New test.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/dynamic_list.t: New file.
        * testsuite/dynamic_list.t: New file.
        * testsuite/dynamic_list.sh: New file.
        * testsuite/dynamic_list.sh: New file.
2008-11-05  Craig Silverstein  
2008-11-05  Craig Silverstein  
        * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
        * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
        * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
        * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
        (t11_last): Likewise.
        (t11_last): Likewise.
        * testsuite/ver_test_6.c (main): Likewise.
        * testsuite/ver_test_6.c (main): Likewise.
2008-10-07  Cary Coutant  
2008-10-07  Cary Coutant  
        * options.c (General_options::finalize): Add check for -static and
        * options.c (General_options::finalize): Add check for -static and
        -shared.
        -shared.
        * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
        * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
        is not empty.
        is not empty.
2008-10-02  Cary Coutant  
2008-10-02  Cary Coutant  
        * plugin.cc (make_sized_plugin_object): Fix conditional
        * plugin.cc (make_sized_plugin_object): Fix conditional
        compilation to work when not all targets are enabled.
        compilation to work when not all targets are enabled.
2008-09-29  Cary Coutant  
2008-09-29  Cary Coutant  
        * archive.cc (Archive::get_file_and_offset): Use filename instead
        * archive.cc (Archive::get_file_and_offset): Use filename instead
        of name to get library path.
        of name to get library path.
        (Archive::include_member): Unlock external member of a thin archive.
        (Archive::include_member): Unlock external member of a thin archive.
        * testsuite/Makefile.am (TEST_AR): New variable.
        * testsuite/Makefile.am (TEST_AR): New variable.
        (thin_archive_test_1): New test.
        (thin_archive_test_1): New test.
        (thin_archive_test_2): New test.
        (thin_archive_test_2): New test.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/thin_archive_main.cc: New file.
        * testsuite/thin_archive_main.cc: New file.
        * testsuite/thin_archive_test_1.cc: New file.
        * testsuite/thin_archive_test_1.cc: New file.
        * testsuite/thin_archive_test_2.cc: New file.
        * testsuite/thin_archive_test_2.cc: New file.
        * testsuite/thin_archive_test_3.cc: New file.
        * testsuite/thin_archive_test_3.cc: New file.
        * testsuite/thin_archive_test_4.cc: New file.
        * testsuite/thin_archive_test_4.cc: New file.
2008-09-29  Cary Coutant  
2008-09-29  Cary Coutant  
        * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
        * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
        * object.cc (Sized_relobj::do_layout): Use constant invalid_address
        * object.cc (Sized_relobj::do_layout): Use constant invalid_address
        instead of -1U.
        instead of -1U.
        (Sized_relobj::do_finalize_local_symbols): Likewise.
        (Sized_relobj::do_finalize_local_symbols): Likewise.
        (Sized_relobj::map_to_kept_section): Likewise.
        (Sized_relobj::map_to_kept_section): Likewise.
        * object.h (Sized_relobj::invalid_address): New constant.
        * object.h (Sized_relobj::invalid_address): New constant.
        (Sized_relobj::do_output_section_offset): Check for invalid_address
        (Sized_relobj::do_output_section_offset): Check for invalid_address
        and return -1ULL.
        and return -1ULL.
        * output.cc (Output_reloc::local_section_offset): Use constant
        * output.cc (Output_reloc::local_section_offset): Use constant
        invalid_address instead of -1U.
        invalid_address instead of -1U.
        (Output_reloc::get_address): Likewise.
        (Output_reloc::get_address): Likewise.
        (Output_section::output_address): Change -1U to -1ULL.
        (Output_section::output_address): Change -1U to -1ULL.
        * output.h (Output_reloc::invalid_address): New constant.
        * output.h (Output_reloc::invalid_address): New constant.
        * reloc.cc (Sized_relobj::write_sections): Use constant
        * reloc.cc (Sized_relobj::write_sections): Use constant
        invalid_address instead of -1U.
        invalid_address instead of -1U.
        (Sized_relobj::relocate_sections): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
        * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
        values for merge sections.
        values for merge sections.
        * target-reloc.h (relocate_for_relocatable): Use constant
        * target-reloc.h (relocate_for_relocatable): Use constant
        invalid_address instead of -1U.
        invalid_address instead of -1U.
2008-09-19  Cary Coutant  
2008-09-19  Cary Coutant  
        Add plugin functionality for link-time optimization (LTO).
        Add plugin functionality for link-time optimization (LTO).
        * configure.ac (plugins): Add --enable-plugins option.
        * configure.ac (plugins): Add --enable-plugins option.
        * configure: Regenerate.
        * configure: Regenerate.
        * config.in: Regenerate.
        * config.in: Regenerate.
        * Makefile.am (LIBDL): New variable.
        * Makefile.am (LIBDL): New variable.
        (CCFILES): Add plugin.cc.
        (CCFILES): Add plugin.cc.
        (HFILES): Add plugin.h.
        (HFILES): Add plugin.h.
        (ldadd_var): Add LIBDL.
        (ldadd_var): Add LIBDL.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * archive.cc: Include "plugin.h".
        * archive.cc: Include "plugin.h".
        (Archive::setup): Don't preread archive symbols when using a plugin.
        (Archive::setup): Don't preread archive symbols when using a plugin.
        (Archive::get_file_and_offset): Add memsize parameter.  Change callers.
        (Archive::get_file_and_offset): Add memsize parameter.  Change callers.
        (Archive::get_elf_object_for_member): Call plugin hooks for claiming
        (Archive::get_elf_object_for_member): Call plugin hooks for claiming
        files.
        files.
        (Archive::include_member): Add symbols from plugin objects.
        (Archive::include_member): Add symbols from plugin objects.
        * archive.h (Archive::get_file_and_offset): Add memsize parameter.
        * archive.h (Archive::get_file_and_offset): Add memsize parameter.
        * descriptors.cc (Descriptors::open): Check for file descriptors
        * descriptors.cc (Descriptors::open): Check for file descriptors
        abandoned by plugins.
        abandoned by plugins.
        (Descriptors::claim_for_plugin): New function.
        (Descriptors::claim_for_plugin): New function.
        * descriptors.h (Descriptors::claim_for_plugin): New function.
        * descriptors.h (Descriptors::claim_for_plugin): New function.
        (Open_descriptor::is_claimed): New field.
        (Open_descriptor::is_claimed): New field.
        (claim_descriptor_for_plugin): New function.
        (claim_descriptor_for_plugin): New function.
        * fileread.cc (File_read::claim_for_plugin): New function.
        * fileread.cc (File_read::claim_for_plugin): New function.
        * fileread.h (File_read::claim_for_plugin): New function.
        * fileread.h (File_read::claim_for_plugin): New function.
        (File_read::descriptor): New function.
        (File_read::descriptor): New function.
        * gold.cc: Include "plugin.h".
        * gold.cc: Include "plugin.h".
        (queue_initial_tasks): Add task to call plugin hooks for generating
        (queue_initial_tasks): Add task to call plugin hooks for generating
        new object files.
        new object files.
        * main.cc: Include "plugin.h".
        * main.cc: Include "plugin.h".
        (main): Load plugin libraries.
        (main): Load plugin libraries.
        * object.h (Pluginobj): Declare.
        * object.h (Pluginobj): Declare.
        (Object::pluginobj): New function.
        (Object::pluginobj): New function.
        (Object::do_pluginobj): New function.
        (Object::do_pluginobj): New function.
        (Object::set_target): New function.
        (Object::set_target): New function.
        * options.cc: Include "plugin.h".
        * options.cc: Include "plugin.h".
        (General_options::parse_plugin): New function.
        (General_options::parse_plugin): New function.
        (General_options::General_options): Initialize plugins_ field.
        (General_options::General_options): Initialize plugins_ field.
        (General_options::add_plugin): New function.
        (General_options::add_plugin): New function.
        * options.h (Plugin_manager): Declare.
        * options.h (Plugin_manager): Declare.
        (General_options): Add --plugin option.
        (General_options): Add --plugin option.
        (General_options::has_plugins): New function.
        (General_options::has_plugins): New function.
        (General_options::plugins): New function.
        (General_options::plugins): New function.
        (General_options::add_plugin): New function.
        (General_options::add_plugin): New function.
        (General_options::plugins_): New field.
        (General_options::plugins_): New field.
        * plugin.cc: New file.
        * plugin.cc: New file.
        * plugin.h: New file.
        * plugin.h: New file.
        * readsyms.cc: Include "plugin.h".
        * readsyms.cc: Include "plugin.h".
        (Read_symbols::do_read_symbols): Check for archive before checking
        (Read_symbols::do_read_symbols): Check for archive before checking
        for ELF file.  Call plugin hooks to claim files.
        for ELF file.  Call plugin hooks to claim files.
        * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
        * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
        from a real object file; force override when processing replacement
        from a real object file; force override when processing replacement
        files.
        files.
        * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
        * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
        (Symbol::init_base_object): Likewise.
        (Symbol::init_base_object): Likewise.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_undefined): Likewise.
        (Symbol::init_base_undefined): Likewise.
        (Symbol::output_section): Assert that object is not a plugin.
        (Symbol::output_section): Assert that object is not a plugin.
        (Symbol_table::add_from_pluginobj): New function.
        (Symbol_table::add_from_pluginobj): New function.
        (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
        (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
        undefined.
        undefined.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::add_from_pluginobj): Instantiate template.
        (Symbol_table::add_from_pluginobj): Instantiate template.
        * symtab.h (Sized_pluginobj): Declare.
        * symtab.h (Sized_pluginobj): Declare.
        (Symbol::in_real_elf): New function.
        (Symbol::in_real_elf): New function.
        (Symbol::set_in_real_elf): New function.
        (Symbol::set_in_real_elf): New function.
        (Symbol::in_real_elf_): New field.
        (Symbol::in_real_elf_): New field.
        (Symbol_table::add_from_pluginobj): New function.
        (Symbol_table::add_from_pluginobj): New function.
        * testsuite/Makefile.am (AM_CFLAGS): New variable.
        * testsuite/Makefile.am (AM_CFLAGS): New variable.
        (LIBDL): New variable.
        (LIBDL): New variable.
        (LDADD): Add LIBDL.
        (LDADD): Add LIBDL.
        (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
        (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
        (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
        (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
        (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
        (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
        (MOSTLYCLEANFILES): Likewise.
        (MOSTLYCLEANFILES): Likewise.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/plugin_test.c: New file.
        * testsuite/plugin_test.c: New file.
        * testsuite/plugin_test_1.sh: New file.
        * testsuite/plugin_test_1.sh: New file.
        * testsuite/plugin_test_2.sh: New file.
        * testsuite/plugin_test_2.sh: New file.
2008-09-16  Ian Lance Taylor  
2008-09-16  Ian Lance Taylor  
        * target-reloc.h (relocate_section): Check whether a symbol is
        * target-reloc.h (relocate_section): Check whether a symbol is
        defined by the ABI before reporting an undefined symbol error.
        defined by the ABI before reporting an undefined symbol error.
        * target.h (Target::is_defined_by_abi): Make parameter const.
        * target.h (Target::is_defined_by_abi): Make parameter const.
        (Target::do_is_defined_by_abi): Likewise.
        (Target::do_is_defined_by_abi): Likewise.
        * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
        * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
        * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
        * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
        * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
        * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
        * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
        * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
        * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
        * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * fileread.cc (make_view): Add casts to avoid warning.
        * fileread.cc (make_view): Add casts to avoid warning.
2008-09-16  Alexandre Oliva  
2008-09-16  Alexandre Oliva  
        * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
        * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2008-09-16  Alexandre Oliva  
2008-09-16  Alexandre Oliva  
        * options.h (General_options::output_is_executable): New.
        * options.h (General_options::output_is_executable): New.
        (General_options::output_is_pie): New.
        (General_options::output_is_pie): New.
        * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
        * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
        for shared libraries.
        for shared libraries.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2008-09-11  Chris Demetriou  
2008-09-11  Chris Demetriou  
        * options.h (origin): New -z option.
        * options.h (origin): New -z option.
        * layout.cc (Layout:finish_dynamic_section): If "-z origin"
        * layout.cc (Layout:finish_dynamic_section): If "-z origin"
        is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
        is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
        in DT_FLAGS_1.
        in DT_FLAGS_1.
2008-09-05  Cary Coutant  
2008-09-05  Cary Coutant  
        * fileread.cc (File_read::make_view): Add check for attempt to map
        * fileread.cc (File_read::make_view): Add check for attempt to map
        beyond end of file.
        beyond end of file.
2008-09-05  Cary Coutant  
2008-09-05  Cary Coutant  
        * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
        * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
        explicit instantiations.
        explicit instantiations.
2008-08-28  Kris Van Hees  
2008-08-28  Kris Van Hees  
        PR gold/6858
        PR gold/6858
        * options.cc (General_options::finalize): Allow undefined symbols
        * options.cc (General_options::finalize): Allow undefined symbols
        in shlibs if linking -shared.
        in shlibs if linking -shared.
        PR gold/6859
        PR gold/6859
        * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
        * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
        symbols as not needing a dynsym entry.
        symbols as not needing a dynsym entry.
2008-08-20  Craig Silverstein  
2008-08-20  Craig Silverstein  
        * fileread.cc (File_read::open): Do not lock the file unless it
        * fileread.cc (File_read::open): Do not lock the file unless it
        was successfully opened.
        was successfully opened.
2008-08-14  Cary Coutant  
2008-08-14  Cary Coutant  
        * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
        * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
        Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
        Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
        * testsuite/tls_test.cc (struct int128): 128-bit struct
        * testsuite/tls_test.cc (struct int128): 128-bit struct
        for testing TLS relocs with non-zero addend.
        for testing TLS relocs with non-zero addend.
        (v12): New TLS variable.
        (v12): New TLS variable.
        (t12): New test.
        (t12): New test.
        (t_last): Add check for v12.
        (t_last): Add check for v12.
        * testsuite/tls_test.h (t12): New function.
        * testsuite/tls_test.h (t12): New function.
        * testsuite/tls_test_main.cc (thread_routine): Call new test.
        * testsuite/tls_test_main.cc (thread_routine): Call new test.
2008-08-13  Ian Lance Taylor  
2008-08-13  Ian Lance Taylor  
        * layout.cc (Layout::attach_allocated_section_to_segment): Don't
        * layout.cc (Layout::attach_allocated_section_to_segment): Don't
        set tls_segment_ or relro_segment_.
        set tls_segment_ or relro_segment_.
        (Layout::make_output_segment): Set tls_segment_ and relro_segment_
        (Layout::make_output_segment): Set tls_segment_ and relro_segment_
        when appropriate.
        when appropriate.
        * output.h (Output_section::clear_is_relro): New function.
        * output.h (Output_section::clear_is_relro): New function.
        * output.cc (Output_segment::add_output_section): Handle SHF_TLS
        * output.cc (Output_segment::add_output_section): Handle SHF_TLS
        sections specially even when output_data_ is empty.
        sections specially even when output_data_ is empty.
        (Output_segment::maximum_alignment): When first section is relro,
        (Output_segment::maximum_alignment): When first section is relro,
        only force alignment for PT_LOAD segments.
        only force alignment for PT_LOAD segments.
        * script.cc (script_data_segment_align): New function.
        * script.cc (script_data_segment_align): New function.
        (script_data_segment_relro_end): New function.
        (script_data_segment_relro_end): New function.
        * script-c.h (script_data_segment_align): Declare.
        * script-c.h (script_data_segment_align): Declare.
        (script_data_segment_relro_end): Declare.
        (script_data_segment_relro_end): Declare.
        * script-sections.h (class Script_sections): Declare
        * script-sections.h (class Script_sections): Declare
        data_segment_align and data_segment_relro_end.  Add fields
        data_segment_align and data_segment_relro_end.  Add fields
        segment_align_index_ and saw_relro_end_.
        segment_align_index_ and saw_relro_end_.
        * script-sections.cc (class Sections_element): Add set_is_relro
        * script-sections.cc (class Sections_element): Add set_is_relro
        virtual function.  Add new bool* parameter to place_orphan_here.
        virtual function.  Add new bool* parameter to place_orphan_here.
        Add get_output_section virtual function.
        Add get_output_section virtual function.
        (class Output_section_definition): Add set_is_relro.  Add new
        (class Output_section_definition): Add set_is_relro.  Add new
        bool* parameter to place_orphan_here.  Add get_output_section.
        bool* parameter to place_orphan_here.  Add get_output_section.
        Add is_relro_ field.
        Add is_relro_ field.
        (Output_section_definition::Output_section_definition): Initialize
        (Output_section_definition::Output_section_definition): Initialize
        evaluated_address_, evaluated_load_address, evaluated_addralign_,
        evaluated_address_, evaluated_load_address, evaluated_addralign_,
        and is_relro_ fields.
        and is_relro_ fields.
        (Output_section_definition::place_orphan_here): Add is_relro
        (Output_section_definition::place_orphan_here): Add is_relro
        parameter.
        parameter.
        (Output_section_definition::set_section_addresses): Set relro for
        (Output_section_definition::set_section_addresses): Set relro for
        output section.
        output section.
        (Output_section_definition::alternate_constraint): Likewise.
        (Output_section_definition::alternate_constraint): Likewise.
        (class Orphan_output_section): Add new bool* parameter to
        (class Orphan_output_section): Add new bool* parameter to
        place_orphan_here.  Add get_output_section.
        place_orphan_here.  Add get_output_section.
        (Orphan_output_section::place_orphan_here): Add is_relro
        (Orphan_output_section::place_orphan_here): Add is_relro
        parameter.
        parameter.
        (Script_sections::Script_sections): Initialize
        (Script_sections::Script_sections): Initialize
        data_segment_align_index_ and saw_relro_end_.
        data_segment_align_index_ and saw_relro_end_.
        (Script_sections::data_segment_align): New function.
        (Script_sections::data_segment_align): New function.
        (Script_sections::data_segment_relro_end): New function.
        (Script_sections::data_segment_relro_end): New function.
        (Script_sections::place_orphan): Set or clear is_relro.
        (Script_sections::place_orphan): Set or clear is_relro.
        (Script_sections::set_section_addresses): Force alignment of first
        (Script_sections::set_section_addresses): Force alignment of first
        TLS section.
        TLS section.
        * yyscript.y (exp): Call script_data_segment_align and
        * yyscript.y (exp): Call script_data_segment_align and
        script_data_segment_relro_end.
        script_data_segment_relro_end.
        * testsuite/relro_script_test.t: New file.
        * testsuite/relro_script_test.t: New file.
        * testsuite/relro_test.cc (using_script): Declare.
        * testsuite/relro_test.cc (using_script): Declare.
        (t1, t2): Test using_script.
        (t1, t2): Test using_script.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
        (relro_script_test_SOURCES): Define.
        (relro_script_test_SOURCES): Define.
        (relro_script_test_DEPENDENCIES): Define.
        (relro_script_test_DEPENDENCIES): Define.
        (relro_script_test_LDFLAGS): Define.
        (relro_script_test_LDFLAGS): Define.
        (relro_script_test_LDADD): Define.
        (relro_script_test_LDADD): Define.
        (relro_script_test.so): New target.
        (relro_script_test.so): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-08-06  Cary Coutant 
2008-08-06  Cary Coutant 
        * archive.cc (Archive::total_archives, Archive::total_members)
        * archive.cc (Archive::total_archives, Archive::total_members)
        (Archive::total_members_loaded): New variables.
        (Archive::total_members_loaded): New variables.
        (Archive::setup): Add parameter.  Add option to preread
        (Archive::setup): Add parameter.  Add option to preread
        archive symbols.
        archive symbols.
        (Archive::read_armap): Add counter.
        (Archive::read_armap): Add counter.
        (Archive::get_file_and_offset): New function.
        (Archive::get_file_and_offset): New function.
        (Archive::get_elf_object_for_member): New function.
        (Archive::get_elf_object_for_member): New function.
        (Archive::read_all_symbols): New function.
        (Archive::read_all_symbols): New function.
        (Archive::read_symbols): New function.
        (Archive::read_symbols): New function.
        (Archive::add_symbols): Add counters.
        (Archive::add_symbols): Add counters.
        (Archive::include_all_members): Use armap to find members if it's
        (Archive::include_all_members): Use armap to find members if it's
        already built.
        already built.
        (Archive::include_member): Skip reading symbols if already read.
        (Archive::include_member): Skip reading symbols if already read.
        Factored code into Archive::get_file_and_offset and
        Factored code into Archive::get_file_and_offset and
        Archive::get_elf_object_for_member.  Changed call to
        Archive::get_elf_object_for_member.  Changed call to
        Mapfile::report_include_archive_member.
        Mapfile::report_include_archive_member.
        (Archive::print_stats): New function.
        (Archive::print_stats): New function.
        * archive.h: Declare Object and Read_symbols_data classes.
        * archive.h: Declare Object and Read_symbols_data classes.
        (Archive::Archive): Add initializers for new members.
        (Archive::Archive): Add initializers for new members.
        (Archive::setup): Add parameter.
        (Archive::setup): Add parameter.
        (Archive::print_stats): New function.
        (Archive::print_stats): New function.
        (Archive::total_archives, Archive::total_members)
        (Archive::total_archives, Archive::total_members)
        (Archive::total_members_loaded): New variables.
        (Archive::total_members_loaded): New variables.
        (Archive::get_file_and_offset): New function.
        (Archive::get_file_and_offset): New function.
        (Archive::get_elf_object_for_member): New function.
        (Archive::get_elf_object_for_member): New function.
        (Archive::read_all_symbols): New function.
        (Archive::read_all_symbols): New function.
        (Archive::read_symbols): New function.
        (Archive::read_symbols): New function.
        (Archive::Archive_member): New class.
        (Archive::Archive_member): New class.
        (Archive::members_): New member.
        (Archive::members_): New member.
        (Archive::num_members_): New member.
        (Archive::num_members_): New member.
        * main.cc: Include archive.h.
        * main.cc: Include archive.h.
        (main): Call Archive::print_stats.
        (main): Call Archive::print_stats.
        * mapfile.cc (Mapfile::report_include_archive_member): Delete
        * mapfile.cc (Mapfile::report_include_archive_member): Delete
        archive parameter; member_name is now the fully-decorated name.
        archive parameter; member_name is now the fully-decorated name.
        * mapfile.h (Mapfile::report_include_archive_member): Likewise.
        * mapfile.h (Mapfile::report_include_archive_member): Likewise.
        * options.h: (General_options): Add --preread-archive-symbols option.
        * options.h: (General_options): Add --preread-archive-symbols option.
        * readsyms.cc (Read_symbols::do_read_symbols): Change call to
        * readsyms.cc (Read_symbols::do_read_symbols): Change call to
        Archive::setup.
        Archive::setup.
2008-08-04  Ian Lance Taylor  
2008-08-04  Ian Lance Taylor  
        * symtab.h (Symbol::use_plt_offset): New function.
        * symtab.h (Symbol::use_plt_offset): New function.
        * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
        * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
        * powerpc.cc (Relocate::relocate): Likewise.
        * powerpc.cc (Relocate::relocate): Likewise.
        * sparc.cc (Relocate::relocate): Likewise.
        * sparc.cc (Relocate::relocate): Likewise.
        * x86_64.cc (Relocate::relocate): Likewise.
        * x86_64.cc (Relocate::relocate): Likewise.
        * testsuite/weak_plt.sh: New test.
        * testsuite/weak_plt.sh: New test.
        * testsuite/weak_plt_main.cc: New test.
        * testsuite/weak_plt_main.cc: New test.
        * testsuite/weak_plt_shared.cc: New test.
        * testsuite/weak_plt_shared.cc: New test.
        * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
        (check_PROGRAMS): Add weak_plt.
        (check_PROGRAMS): Add weak_plt.
        (check_DATA): Add weak_plt_shared.so.
        (check_DATA): Add weak_plt_shared.so.
        (weak_plt_main_pic.o, weak_plt): New targets.
        (weak_plt_main_pic.o, weak_plt): New targets.
        (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
        (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
        * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
        gcctestdir/ld.
        gcctestdir/ld.
        (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
        (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-08-04  Alan Modra  
2008-08-04  Alan Modra  
        * Makefile.am (POTFILES.in): Set LC_ALL=C.
        * Makefile.am (POTFILES.in): Set LC_ALL=C.
        * Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * po/POTFILES.in: Regenerate.
        * po/POTFILES.in: Regenerate.
2008-07-29  Ian Lance Taylor  
2008-07-29  Ian Lance Taylor  
        * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
        * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
        symbols before other symbols.
        symbols before other symbols.
        * testsuite/script_test_2.cc (test_addr): Declare.
        * testsuite/script_test_2.cc (test_addr): Declare.
        (test_addr_alias): Declare.
        (test_addr_alias): Declare.
        (main): Check that test_addr and test_addr_alias have the right
        (main): Check that test_addr and test_addr_alias have the right
        values.
        values.
        * testsuite/script_test_2.t: Define test_addr_alias and
        * testsuite/script_test_2.t: Define test_addr_alias and
        test_addr.
        test_addr.
2008-07-24  Ian Lance Taylor  
2008-07-24  Ian Lance Taylor  
        PR 5990
        PR 5990
        * descriptors.cc: New file.
        * descriptors.cc: New file.
        * descriptors.h: New file.
        * descriptors.h: New file.
        * gold-threads.h (class Hold_optional_lock): New class.
        * gold-threads.h (class Hold_optional_lock): New class.
        * fileread.cc: Include "descriptors.h".
        * fileread.cc: Include "descriptors.h".
        (File_read::~File_read): Release descriptor rather than closing
        (File_read::~File_read): Release descriptor rather than closing
        it.
        it.
        (File_read::open) [file]: Call open_descriptor rather than open.
        (File_read::open) [file]: Call open_descriptor rather than open.
        Set is_descriptor_opened_.
        Set is_descriptor_opened_.
        (File_read::open) [memory]: Assert that descriptor is not open.
        (File_read::open) [memory]: Assert that descriptor is not open.
        (File_read::reopen_descriptor): New function.
        (File_read::reopen_descriptor): New function.
        (File_read::release): Release descriptor.
        (File_read::release): Release descriptor.
        (File_read::do_read): Make non-const.  Reopen descriptor.
        (File_read::do_read): Make non-const.  Reopen descriptor.
        (File_read::read): Make non-const.
        (File_read::read): Make non-const.
        (File_read::make_view): Reopen descriptor.
        (File_read::make_view): Reopen descriptor.
        (File_read::do_readv): Likewise.
        (File_read::do_readv): Likewise.
        * fileread.h (class File_read): Add is_descriptor_opened_ field.
        * fileread.h (class File_read): Add is_descriptor_opened_ field.
        Update declarations.
        Update declarations.
        * layout.cc: Include "descriptors.h".
        * layout.cc: Include "descriptors.h".
        (Layout::create_build_id): Use open_descriptor rather than open.
        (Layout::create_build_id): Use open_descriptor rather than open.
        * output.cc: Include "descriptors.h".
        * output.cc: Include "descriptors.h".
        (Output_file::open): Use open_descriptor rather than open.
        (Output_file::open): Use open_descriptor rather than open.
        * archive.cc (Archive::const_iterator): Change Archive to be
        * archive.cc (Archive::const_iterator): Change Archive to be
        non-const.
        non-const.
        (Archive::begin, Archive::end): Make non-const.
        (Archive::begin, Archive::end): Make non-const.
        (Archive::count_members): Likewise.
        (Archive::count_members): Likewise.
        * archive.h (class Archive): Update declarations.
        * archive.h (class Archive): Update declarations.
        * object.h (Object::read): Make non-const.
        * object.h (Object::read): Make non-const.
        * Makefile.am (CCFILES): Add descriptors.cc.
        * Makefile.am (CCFILES): Add descriptors.cc.
        (HFILES): Add descriptors.h.
        (HFILES): Add descriptors.h.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
        PR 6716
        PR 6716
        * gold.h: Always include .  Add Solaris workarounds
        * gold.h: Always include .  Add Solaris workarounds
        following code in binutils/sysdep.h.
        following code in binutils/sysdep.h.
        PR 6048
        PR 6048
        * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
        * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
        this->eh_frame_hdr_ is NULL before using it.
        this->eh_frame_hdr_ is NULL before using it.
        * dynobj.cc (Versions::Versions): Update comment.
        * dynobj.cc (Versions::Versions): Update comment.
        * dynobj.cc (Versions::Versions): If there is an soname, use it as
        * dynobj.cc (Versions::Versions): If there is an soname, use it as
        the base version name.
        the base version name.
        * stringpool.cc (Stringpool_template::add_with_length): Set key to
        * stringpool.cc (Stringpool_template::add_with_length): Set key to
        array size plus one.
        array size plus one.
        (Stringpool_template::set_string_offsets): Subtract one from key
        (Stringpool_template::set_string_offsets): Subtract one from key
        before using it as an array index.
        before using it as an array index.
        (Stringpool_template::get_offset_with_length): Likewise.
        (Stringpool_template::get_offset_with_length): Likewise.
        (Stringpool_template::write_to_buffer): Likewise.
        (Stringpool_template::write_to_buffer): Likewise.
        * stringpool.h (Stringpool_template::get_offset_from_key):
        * stringpool.h (Stringpool_template::get_offset_from_key):
        Likewise.
        Likewise.
2008-07-23  Ian Lance Taylor  
2008-07-23  Ian Lance Taylor  
        PR 6658
        PR 6658
        * object.h (Merged_symbol_value::value): Do our best to handle a
        * object.h (Merged_symbol_value::value): Do our best to handle a
        negative addend.
        negative addend.
        PR 6647
        PR 6647
        * script.cc (Version_script_info::get_versions): Don't add empty
        * script.cc (Version_script_info::get_versions): Don't add empty
        version tag to return value.
        version tag to return value.
        (Version_script_info::get_symbol_version_helper): Change return
        (Version_script_info::get_symbol_version_helper): Change return
        type to bool.  Add pversion parameter.  Change all callers.
        type to bool.  Add pversion parameter.  Change all callers.
        (script_register_vers_node): Don't require a non-NULL tag.
        (script_register_vers_node): Don't require a non-NULL tag.
        * script.h (class Version_script_info): Update declarations.
        * script.h (class Version_script_info): Update declarations.
        (Version_script_info::get_symbol_version): Change return type to
        (Version_script_info::get_symbol_version): Change return type to
        bool.  Add version parameter.  Change all callers.
        bool.  Add version parameter.  Change all callers.
        * symtab.cc (Sized_symbol::add_from_relobj): Rework version
        * symtab.cc (Sized_symbol::add_from_relobj): Rework version
        handling.  Handle an empty version from a version script.
        handling.  Handle an empty version from a version script.
        (Symbol_table::define_special_symbol): Likewise.
        (Symbol_table::define_special_symbol): Likewise.
        * testsuite/ver_test_10.script: New file.
        * testsuite/ver_test_10.script: New file.
        * testsuite/ver_test_10.sh: New file.
        * testsuite/ver_test_10.sh: New file.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
        (check_DATA): Add ver_test_10.syms.
        (check_DATA): Add ver_test_10.syms.
        (ver_test_10.syms, ver_test_10.so): New target.
        (ver_test_10.syms, ver_test_10.so): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-07-23  Simon Baldwin  
2008-07-23  Simon Baldwin  
        * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
        * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
        to zero for undefined symbols from dynamic libraries.
        to zero for undefined symbols from dynamic libraries.
2008-07-23  Ian Lance Taylor  
2008-07-23  Ian Lance Taylor  
        * symtab.cc (Symbol_table::resolve): Remove version parameter.
        * symtab.cc (Symbol_table::resolve): Remove version parameter.
        Change all callers.
        Change all callers.
        * symtab.h (class Symbol_table): Update declaration.
        * symtab.h (class Symbol_table): Update declaration.
        * testsuite/ver_test_9.cc: New file.
        * testsuite/ver_test_9.cc: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
        (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
        (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
        (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
        (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
        (ver_test_9.so, ver_test_9.o): New targets.
        (ver_test_9.so, ver_test_9.o): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-07-22  Ian Lance Taylor  
2008-07-22  Ian Lance Taylor  
        * options.h (class General_options): Define --check-sections.
        * options.h (class General_options): Define --check-sections.
        * layout.cc (Layout::set_segment_offsets): Handle
        * layout.cc (Layout::set_segment_offsets): Handle
        --check-sections.
        --check-sections.
        * options.h (class General_options): Define -n/--nmagic and
        * options.h (class General_options): Define -n/--nmagic and
        -N/--omagic.
        -N/--omagic.
        * options.cc (General_options::finalize): For -n/--nmagic or
        * options.cc (General_options::finalize): For -n/--nmagic or
        -N/--omagic, set -static.
        -N/--omagic, set -static.
        * layout.cc (Layout::attach_allocated_section_to_segment): If
        * layout.cc (Layout::attach_allocated_section_to_segment): If
        -N/--omagic, don't put read-only and read-write sections in
        -N/--omagic, don't put read-only and read-write sections in
        different segments.
        different segments.
        (Layout::find_first_load_seg): If -N/--omagic, don't insist on
        (Layout::find_first_load_seg): If -N/--omagic, don't insist on
        finding a read-only segment.
        finding a read-only segment.
        (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
        (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
        don't set the minimum segment alignment to the common page size,
        don't set the minimum segment alignment to the common page size,
        and don't set the file offset to the address modulo the page size.
        and don't set the file offset to the address modulo the page size.
        * script-sections.cc (Script_sections::create_segments): If
        * script-sections.cc (Script_sections::create_segments): If
        -n/--omagic, don't put read-only and read-write sections in
        -n/--omagic, don't put read-only and read-write sections in
        different segments.
        different segments.
        * cref.cc: New file.
        * cref.cc: New file.
        * cref.h: New file.
        * cref.h: New file.
        * options.h (class General_options): Add --print-symbol-counts.
        * options.h (class General_options): Add --print-symbol-counts.
        * main.cc (main): Issue defined symbol report if requested.
        * main.cc (main): Issue defined symbol report if requested.
        * archive.cc (Archive::interpret_header): Make into a const member
        * archive.cc (Archive::interpret_header): Make into a const member
        function.
        function.
        (Archive::add_symbols): Call Input_objects::archive_start and
        (Archive::add_symbols): Call Input_objects::archive_start and
        archive_stop.
        archive_stop.
        (Archive::const_iterator): Define new class.
        (Archive::const_iterator): Define new class.
        (Archive::begin, Archive::end): New functions.
        (Archive::begin, Archive::end): New functions.
        (Archive::include_all_members): Rewrite to use iterator.
        (Archive::include_all_members): Rewrite to use iterator.
        (Archive::count_members): New function.
        (Archive::count_members): New function.
        * archive.h (class Archive): Update declarations.
        * archive.h (class Archive): Update declarations.
        (Archive::filename): New function.
        (Archive::filename): New function.
        * object.cc: Include "cref.h".
        * object.cc: Include "cref.h".
        (Sized_relobj::Sized_relobj): Initialize defined_count_.
        (Sized_relobj::Sized_relobj): Initialize defined_count_.
        (Sized_relobj::do_get_global_symbol_counts): New function.
        (Sized_relobj::do_get_global_symbol_counts): New function.
        (Input_objects::add_object): Add object to cross-referencer.
        (Input_objects::add_object): Add object to cross-referencer.
        (Input_objects::archive_start): New function.
        (Input_objects::archive_start): New function.
        (Input_objects::archive_stop): New function.
        (Input_objects::archive_stop): New function.
        (Input_objects::print_symbol_counts): New function.
        (Input_objects::print_symbol_counts): New function.
        * object.h: Declare Cref and Archive.
        * object.h: Declare Cref and Archive.
        (Object::get_global_symbol_counts): New function.
        (Object::get_global_symbol_counts): New function.
        (Object::do_get_global_symbol_counts): New pure virtual function.
        (Object::do_get_global_symbol_counts): New pure virtual function.
        (class Sized_relobj): Add defined_count_ field.  Update
        (class Sized_relobj): Add defined_count_ field.  Update
        declarations.
        declarations.
        (class Input_objects): Add cref_ field.  Update constructor.
        (class Input_objects): Add cref_ field.  Update constructor.
        Update declarations.
        Update declarations.
        * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
        * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
        defined_count_.
        defined_count_.
        (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
        (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
        symbol counts.
        symbol counts.
        (Sized_dynobj::do_get_global_symbol_counts): New function.
        (Sized_dynobj::do_get_global_symbol_counts): New function.
        * dynobj.h (class Sized_dynobj): Add fields symbols_ and
        * dynobj.h (class Sized_dynobj): Add fields symbols_ and
        defined_count_.  Update declarations.  Define Symbols typedef.
        defined_count_.  Update declarations.  Define Symbols typedef.
        * symtab.cc (Symbol_table::add_from_relobj): Add defined
        * symtab.cc (Symbol_table::add_from_relobj): Add defined
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol_table::add_from_dynobj): Add sympointers and defined
        (Symbol_table::add_from_dynobj): Add sympointers and defined
        parameters.  Change all callers.
        parameters.  Change all callers.
        * symtab.h (class Symbol_table): Update declarations.
        * symtab.h (class Symbol_table): Update declarations.
        * Makefile.am (CCFILES): Add cref.cc.
        * Makefile.am (CCFILES): Add cref.cc.
        (HFILES): Add cref.h.
        (HFILES): Add cref.h.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2008-07-22  Simon Baldwin  
2008-07-22  Simon Baldwin  
        * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
        * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
        to zero when writing undefined symbols.
        to zero when writing undefined symbols.
2008-07-22  Ian Lance Taylor  
2008-07-22  Ian Lance Taylor  
        * output.cc (Output_section::add_input_section): Don't try to
        * output.cc (Output_section::add_input_section): Don't try to
        merge empty merge sections.
        merge empty merge sections.
2008-07-21  Craig Silverstein  
2008-07-21  Craig Silverstein  
        * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
        * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
        Include symbol version in error message.
        Include symbol version in error message.
2008-07-20  Chris Demetriou  
2008-07-20  Chris Demetriou  
        * configure.ac (gold_cv_c_random_seed): New configured variable.
        * configure.ac (gold_cv_c_random_seed): New configured variable.
        (RANDOM_SEED_CFLAGS): New substituted variable.
        (RANDOM_SEED_CFLAGS): New substituted variable.
        * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
        * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
        * configure: Rebuild.
        * configure: Rebuild.
        * Makefile.in: Likewise.
        * Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.
2008-07-18  Ian Lance Taylor  
2008-07-18  Ian Lance Taylor  
        * symtab.cc (Symbol_table::add_from_object): Rewrite the case
        * symtab.cc (Symbol_table::add_from_object): Rewrite the case
        where we see NAME/NULL and NAME/VERSION  as separate symbols.
        where we see NAME/NULL and NAME/VERSION  as separate symbols.
        * testsuite/ver_test_main.cc (main): Call t4.
        * testsuite/ver_test_main.cc (main): Call t4.
        (t4, t4_2a): Define.
        (t4, t4_2a): Define.
        * testsuite/ver_test_2.cc (t4_2): Define.
        * testsuite/ver_test_2.cc (t4_2): Define.
        * testsuite/ver_test_2.script: Put t4_2a in VER2.
        * testsuite/ver_test_2.script: Put t4_2a in VER2.
        * testsuite/ver_test_4.cc (t4_2a): Define.
        * testsuite/ver_test_4.cc (t4_2a): Define.
        * testsuite/ver_test_4.script: Put t4_2a in VER2.
        * testsuite/ver_test_4.script: Put t4_2a in VER2.
        * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
        * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
2008-07-17  Ian Lance Taylor  
2008-07-17  Ian Lance Taylor  
        * dynobj.cc (Versions::add_def): If we give an error about a
        * dynobj.cc (Versions::add_def): If we give an error about a
        missing version, go ahead and create the version anyhow.
        missing version, go ahead and create the version anyhow.
2008-07-10  Ian Lance Taylor  
2008-07-10  Ian Lance Taylor  
        Handle output sections with more than 0x7fffffff bytes.
        Handle output sections with more than 0x7fffffff bytes.
        * object.h (class Relobj): Change map_to_output_ to
        * object.h (class Relobj): Change map_to_output_ to
        output_sections_, and just keep a section pointer.  Change all
        output_sections_, and just keep a section pointer.  Change all
        uses.  Move comdat group support to Sized_relobj.
        uses.  Move comdat group support to Sized_relobj.
        (Relobj::is_section_specially_mapped): Remove.
        (Relobj::is_section_specially_mapped): Remove.
        (Relobj::output_section): Remove poff parameter.  Change all
        (Relobj::output_section): Remove poff parameter.  Change all
        callers.
        callers.
        (Relobj::output_section_offset): New function.
        (Relobj::output_section_offset): New function.
        (Relobj::set_section_offset): Rewrite.
        (Relobj::set_section_offset): Rewrite.
        (Relobj::map_to_output): Remove.
        (Relobj::map_to_output): Remove.
        (Relobj::output_sections): New function.
        (Relobj::output_sections): New function.
        (Relobj::do_output_section_offset): New pure virtual function.
        (Relobj::do_output_section_offset): New pure virtual function.
        (Relobj::do_set_section_offset): Likewise.
        (Relobj::do_set_section_offset): Likewise.
        (class Sized_relobj): Add section_offsets_ field.  Add comdat
        (class Sized_relobj): Add section_offsets_ field.  Add comdat
        group support from Relobj.  Update declarations.
        group support from Relobj.  Update declarations.
        (Sized_relobj::get_output_section_offset): New function.
        (Sized_relobj::get_output_section_offset): New function.
        (Sized_relobj::do_output_section_offset): New function.
        (Sized_relobj::do_output_section_offset): New function.
        (Sized_relobj::do_set_section_offset): New function.
        (Sized_relobj::do_set_section_offset): New function.
        * object.cc (Relobj::output_section_address): Remove.
        * object.cc (Relobj::output_section_address): Remove.
        (Sized_relobj::Sized_relobj): Initialize new fields.
        (Sized_relobj::Sized_relobj): Initialize new fields.
        (Sized_relobj::include_section_group): Cast find_kept_object to
        (Sized_relobj::include_section_group): Cast find_kept_object to
        Sized_relobj.
        Sized_relobj.
        (Sized_relobj::include_linkonce_section): Likewise.
        (Sized_relobj::include_linkonce_section): Likewise.
        (Sized_relobj::do_layout): Use separate arrays for output section
        (Sized_relobj::do_layout): Use separate arrays for output section
        and output offset.
        and output offset.
        (Sized_relobj::do_count_local_symbols): Change map_to_output to
        (Sized_relobj::do_count_local_symbols): Change map_to_output to
        output_sections.
        output_sections.
        (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
        (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
        output_sections and section_offsets.
        output_sections and section_offsets.
        (Sized_relobj::write_local_symbols): Likewise.
        (Sized_relobj::write_local_symbols): Likewise.
        (map_to_kept_section): Compute output address directly.
        (map_to_kept_section): Compute output address directly.
        * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
        * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
        output_sections and section_offsets.
        output_sections and section_offsets.
        (Sized_relobj::write_sections): Likewise.
        (Sized_relobj::write_sections): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        * symtab.cc (sized_finalize_symbol): Use output_section_offset.
        * symtab.cc (sized_finalize_symbol): Use output_section_offset.
        * output.h (class Output_reloc): Update declarations.  Change
        * output.h (class Output_reloc): Update declarations.  Change
        u2_.relobj to Sized_relobj*.
        u2_.relobj to Sized_relobj*.
        (class Output_data_reloc): Change add functions to use
        (class Output_data_reloc): Change add functions to use
        Sized_relobj*.
        Sized_relobj*.
        * output.cc (Output_reloc::Output_reloc): Change relobj to
        * output.cc (Output_reloc::Output_reloc): Change relobj to
        Sized_relobj*.
        Sized_relobj*.
        (Output_reloc::local_section_offset): Change return type to
        (Output_reloc::local_section_offset): Change return type to
        Elf_Addr.  Use get_output_section_offset.
        Elf_Addr.  Use get_output_section_offset.
        (Output_reloc::get_address): Likewise.
        (Output_reloc::get_address): Likewise.
        (Output_section::is_input_address_mapped): Don't call
        (Output_section::is_input_address_mapped): Don't call
        is_section_specially_mapped.
        is_section_specially_mapped.
        (Output_section::output_offset): Likewise.
        (Output_section::output_offset): Likewise.
        (Output_section::output_address): Likewise.
        (Output_section::output_address): Likewise.
        (Output_section::starting_output_address): Likewise.
        (Output_section::starting_output_address): Likewise.
        * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
        * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
        parameter to Sized_relobj*.
        parameter to Sized_relobj*.
        (Copy_relocs::need_copy_reloc): Likewise.
        (Copy_relocs::need_copy_reloc): Likewise.
        (Copy_relocs::save): Likewise.
        (Copy_relocs::save): Likewise.
        * copy-relocs.h (class Copy_relocs): Update declarations.
        * copy-relocs.h (class Copy_relocs): Update declarations.
        (class Copy_relocs::Copy_reloc_entry): Change constructor to use
        (class Copy_relocs::Copy_reloc_entry): Change constructor to use
        Sized_relobj*.  Change relobj_ field to Sized_relobj*.
        Sized_relobj*.  Change relobj_ field to Sized_relobj*.
        * target-reloc.h (relocate_for_relocatable): Change
        * target-reloc.h (relocate_for_relocatable): Change
        offset_in_output_section type to Elf_Addr.  Change code that uses
        offset_in_output_section type to Elf_Addr.  Change code that uses
        it as well.
        it as well.
        * layout.cc (Layout::layout): Always set *off.
        * layout.cc (Layout::layout): Always set *off.
        * mapfile.cc (Mapfile::print_input_section): Use
        * mapfile.cc (Mapfile::print_input_section): Use
        output_section_offset.
        output_section_offset.
        * i386.cc (Target_i386::copy_reloc): Change object parameter to
        * i386.cc (Target_i386::copy_reloc): Change object parameter to
        Sized_relobj*.
        Sized_relobj*.
        * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
        * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
        * sparc.cc (Target_sparc::copy_reloc): Likewise.
        * sparc.cc (Target_sparc::copy_reloc): Likewise.
        * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
        * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
2008-07-03  Ian Lance Taylor  
2008-07-03  Ian Lance Taylor  
        * layout.cc (Layout::include_section): Do not discard unrecognized
        * layout.cc (Layout::include_section): Do not discard unrecognized
        SHT_STRTAB sections.
        SHT_STRTAB sections.
2008-06-30  Craig Silverstein  
2008-06-30  Craig Silverstein  
        * script.cc (Lex::can_continue_name): Make '?' allowable in
        * script.cc (Lex::can_continue_name): Make '?' allowable in
        version-script names.
        version-script names.
        * testsuite/version_script.map: Change glob pattern to use '?'
        * testsuite/version_script.map: Change glob pattern to use '?'
2008-06-30  Manish Singh  
2008-06-30  Manish Singh  
        PR 6585
        PR 6585
        * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
        * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
        Correct typo.
        Correct typo.
2008-06-30  Ian Lance Taylor  
2008-06-30  Ian Lance Taylor  
        PR 6660
        PR 6660
        PR 6682
        PR 6682
        * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
        * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
        versions]: Don't try to read the value in the contents, since we
        versions]: Don't try to read the value in the contents, since we
        don't use it.  Use the template endianness when writing.
        don't use it.  Use the template endianness when writing.
2008-06-25  Cary Coutant  
2008-06-25  Cary Coutant  
        * fileread.cc (File_read::make_view): Assert on zero-length view.
        * fileread.cc (File_read::make_view): Assert on zero-length view.
        * object.cc (Sized_relobj::do_read_symbols): Don't try to read
        * object.cc (Sized_relobj::do_read_symbols): Don't try to read
        symbol table when there are no symbols to read.
        symbol table when there are no symbols to read.
2008-06-23  Craig Silverstein  
2008-06-23  Craig Silverstein  
        * version.cc (version_string): Bump to 1.7
        * version.cc (version_string): Bump to 1.7
2008-06-18  Craig Silverstein  
2008-06-18  Craig Silverstein  
        * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
        * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
        constant 0xFFFF to type Valtype.
        constant 0xFFFF to type Valtype.
        (Powerpc_relocate_functions::rel16_ha): Likewise.
        (Powerpc_relocate_functions::rel16_ha): Likewise.
2008-06-17  Ian Lance Taylor  
2008-06-17  Ian Lance Taylor  
        * output.h (Output_section::Input_section): Initialize p2align_ to
        * output.h (Output_section::Input_section): Initialize p2align_ to
        zero for Output_section_data constructors.
        zero for Output_section_data constructors.
        (Output_section::Input_section::addralign): If not an input
        (Output_section::Input_section::addralign): If not an input
        section, return the alignment of the Output_section_data.
        section, return the alignment of the Output_section_data.
        * testsuite/copy_test.cc: New file.
        * testsuite/copy_test.cc: New file.
        * testsuite/copy_test_1.cc: New file.
        * testsuite/copy_test_1.cc: New file.
        * testsuite/copy_test_2.cc: New file.
        * testsuite/copy_test_2.cc: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
        (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
        (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
        (copy_test_LDFLAGS, copy_test_LDADD): New variables.
        (copy_test_LDFLAGS, copy_test_LDADD): New variables.
        (copy_test_1_pic.o, copy_test_1.so): New targets.
        (copy_test_1_pic.o, copy_test_1.so): New targets.
        (copy_test_2_pic.o, copy_test_2.so): New targets.
        (copy_test_2_pic.o, copy_test_2.so): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * script-sections.cc (Script_sections::place_orphan): Initialize
        * script-sections.cc (Script_sections::place_orphan): Initialize
        local variable exact.
        local variable exact.
2008-06-13  David Edelsohn  
2008-06-13  David Edelsohn  
        * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
        * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
2008-06-12  David Edelsohn  
2008-06-12  David Edelsohn  
            David S. Miller  
            David S. Miller  
        * powerpc.cc: New file.
        * powerpc.cc: New file.
        * Makefile.am (TARGETSOURCES): Add powerpc.cc
        * Makefile.am (TARGETSOURCES): Add powerpc.cc
        (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
        (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
        * configure.tgt: Add entries for powerpc-* and powerpc64-*.
        * configure.tgt: Add entries for powerpc-* and powerpc64-*.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2008-06-09  Ian Lance Taylor  
2008-06-09  Ian Lance Taylor  
        * testsuite/relro_test.cc: Include , , and
        * testsuite/relro_test.cc: Include , , and
        .
        .
        (throwing, orig_terminate): New static variables.
        (throwing, orig_terminate): New static variables.
        (terminate_handler): New static function.
        (terminate_handler): New static function.
        (t2): Set terminate handler.
        (t2): Set terminate handler.
2008-06-05  Kris Van Hees  
2008-06-05  Kris Van Hees  
        PR 6584
        PR 6584
        * binary.cc (Binary_to_elf::sized_convert): Fix .data
        * binary.cc (Binary_to_elf::sized_convert): Fix .data
        alignment.
        alignment.
2008-05-30  Cary Coutant  
2008-05-30  Cary Coutant  
        * archive.cc (Archive::include_all_members) Correct to step
        * archive.cc (Archive::include_all_members) Correct to step
        over symbol table and extended name table in thin archives.
        over symbol table and extended name table in thin archives.
2008-05-29  Kris Van Hees  
2008-05-29  Kris Van Hees  
        PR 6407
        PR 6407
        * target-reloc.h (relocate_for_relocatable): Fix new_offset
        * target-reloc.h (relocate_for_relocatable): Fix new_offset
        calculation.
        calculation.
2008-05-28  Caleb Howe  
2008-05-28  Caleb Howe  
        * reduced_debug_output.cc: New file.
        * reduced_debug_output.cc: New file.
        * reduced_debug_output.h: New file.
        * reduced_debug_output.h: New file.
        * options.h (class General_options): Add --strip-debug-non-line.
        * options.h (class General_options): Add --strip-debug-non-line.
        * options.cc (General_options::finalize): Add strip_debug_non_line
        * options.cc (General_options::finalize): Add strip_debug_non_line
        to the strip heirarchy.
        to the strip heirarchy.
        * layout.h (class Layout): Add debug_abbrev_ and debug_info_
        * layout.h (class Layout): Add debug_abbrev_ and debug_info_
        fields.
        fields.
        * layout.cc: Include "reduced_debug_output.h".
        * layout.cc: Include "reduced_debug_output.h".
        (Layout::Layout): Initialize new fields.
        (Layout::Layout): Initialize new fields.
        (line_only_debug_sections): New static array.
        (line_only_debug_sections): New static array.
        (is_lines_only_debug_sections): New static inline function.
        (is_lines_only_debug_sections): New static inline function.
        (Layout::include_section): Handle --strip-debug-non-line.
        (Layout::include_section): Handle --strip-debug-non-line.
        (Layout::make_output_section): If --strip-debug-non-line, build
        (Layout::make_output_section): If --strip-debug-non-line, build
        new output sections for .debug_abbrev and .debug_info.
        new output sections for .debug_abbrev and .debug_info.
        * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
        * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
        gold.  Warn about possible overflow.
        gold.  Warn about possible overflow.
        (read_signed_LEB_128): Likewise.
        (read_signed_LEB_128): Likewise.
        * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
        * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
        (read_signed_LEB_128): Declare.
        (read_signed_LEB_128): Declare.
        * Makefile.am (CCFILES): Add reduced_debug_output.cc.
        * Makefile.am (CCFILES): Add reduced_debug_output.cc.
        (HFILES): Add reduced_debug_output.h.
        (HFILES): Add reduced_debug_output.h.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2008-05-21  Ian Lance Taylor  
2008-05-21  Ian Lance Taylor  
        * mapfile.cc: New file.
        * mapfile.cc: New file.
        * mapfile.h: New file.
        * mapfile.h: New file.
        * options.h (class General_options): Add -M/--print-map and -Map.
        * options.h (class General_options): Add -M/--print-map and -Map.
        * options.cc (General_options::finalize): Make -M equivalent to
        * options.cc (General_options::finalize): Make -M equivalent to
        -Map -.
        -Map -.
        * main.cc: Include  and "mapfile.h".
        * main.cc: Include  and "mapfile.h".
        (main): Open mapfile if requested.
        (main): Open mapfile if requested.
        * gold.cc (class Middle_runner): Add mapfile_ field.  Update
        * gold.cc (class Middle_runner): Add mapfile_ field.  Update
        constructor.  Change caller.
        constructor.  Change caller.
        (queue_initial_tasks): Add mapfile parameter.  Change caller.
        (queue_initial_tasks): Add mapfile parameter.  Change caller.
        (queue_middle_tasks): Likewise.
        (queue_middle_tasks): Likewise.
        * gold.h (queue_initial_tasks, queue_middle_tasks): Update
        * gold.h (queue_initial_tasks, queue_middle_tasks): Update
        declarations.
        declarations.
        * archive.cc: Include "mapfile.h".
        * archive.cc: Include "mapfile.h".
        (Archive::add_symbols): Add mapfile parameter.  Change all
        (Archive::add_symbols): Add mapfile parameter.  Change all
        callers.  Pass mapfile, symbol, and reason to include_member.
        callers.  Pass mapfile, symbol, and reason to include_member.
        (Archive::include_all_members): Add mapfile parameter.  Change all
        (Archive::include_all_members): Add mapfile parameter.  Change all
        callers.
        callers.
        (Archive::include_member): Add mapfile, sym, and why parameters.
        (Archive::include_member): Add mapfile, sym, and why parameters.
        Change all callers.  Report inclusion to map file.
        Change all callers.  Report inclusion to map file.
        * archive.h: Include "fileread.h".
        * archive.h: Include "fileread.h".
        (class Archive): Update declarations.
        (class Archive): Update declarations.
        (Archive::file): New const method.
        (Archive::file): New const method.
        (class Add_archive_symbols): Add mapfile_ field.  Update
        (class Add_archive_symbols): Add mapfile_ field.  Update
        constructor.  Change all callers.
        constructor.  Change all callers.
        * readsyms.h (class Read_symbols): Likewise.
        * readsyms.h (class Read_symbols): Likewise.
        (class Finish_group): Likewise.
        (class Finish_group): Likewise.
        (class Read_script): Likewise.
        (class Read_script): Likewise.
        * common.cc: Include "mapfile.h".
        * common.cc: Include "mapfile.h".
        (Symbol_table::allocate_commons): Add mapfile parameter.  Change
        (Symbol_table::allocate_commons): Add mapfile parameter.  Change
        all callers.
        all callers.
        (Symbol_table::do_allocate_commons): Likewise.
        (Symbol_table::do_allocate_commons): Likewise.
        (Symbol_table::do_allocate_commons_list): Likewise.  Report common
        (Symbol_table::do_allocate_commons_list): Likewise.  Report common
        symbol allocation to mapfile.
        symbol allocation to mapfile.
        * common.h (class Allocate_commons_task): Add mapfile_ field.
        * common.h (class Allocate_commons_task): Add mapfile_ field.
        Update constructor.  Change all callers.
        Update constructor.  Change all callers.
        * symtab.h (class Symbol_table): Update declarations.
        * symtab.h (class Symbol_table): Update declarations.
        * layout.cc: Include "mapfile.h".
        * layout.cc: Include "mapfile.h".
        (Layout_task_runner::run): Print information to mapfile.
        (Layout_task_runner::run): Print information to mapfile.
        (Layout::create_gold_note): Change Output_data_fixed_space to
        (Layout::create_gold_note): Change Output_data_fixed_space to
        Output_data_zero_fill.
        Output_data_zero_fill.
        (Layout::create_build_id): Likewise.
        (Layout::create_build_id): Likewise.
        (Layout::print_to_mapfile): New function.
        (Layout::print_to_mapfile): New function.
        * layout.h (class Layout_task_runner): Add mapfile_ field.  Update
        * layout.h (class Layout_task_runner): Add mapfile_ field.  Update
        constructor.  Change caller.
        constructor.  Change caller.
        (class Layout): Declare print_to_mapfile.
        (class Layout): Declare print_to_mapfile.
        * output.cc (Output_section::Input_section::print_to_mapfile): New
        * output.cc (Output_section::Input_section::print_to_mapfile): New
        function.
        function.
        (Output_section::add_input_section): If producing a map, always
        (Output_section::add_input_section): If producing a map, always
        add to input_sections_ list.
        add to input_sections_ list.
        (Output_section::do_print_to_mapfile): New function.
        (Output_section::do_print_to_mapfile): New function.
        (Output_segment::print_sections_to_mapfile): New function.
        (Output_segment::print_sections_to_mapfile): New function.
        (Output_segment::print_section_list_to_mapfile): New function.
        (Output_segment::print_section_list_to_mapfile): New function.
        * output.h: Include "mapfile.h".
        * output.h: Include "mapfile.h".
        (Output_data::print_to_mapfile): New function.
        (Output_data::print_to_mapfile): New function.
        (Output_data::do_print_to_mapfile): New virtual function.
        (Output_data::do_print_to_mapfile): New virtual function.
        (Output_segment_headers::do_print_to_mapfile): New function.
        (Output_segment_headers::do_print_to_mapfile): New function.
        (Output_file_header::do_print_to_mapfile): New function.
        (Output_file_header::do_print_to_mapfile): New function.
        (Output_data_const::do_print_to_mapfile): New function.
        (Output_data_const::do_print_to_mapfile): New function.
        (class Output_data_const_buffer): Add map_name_ field.  Update
        (class Output_data_const_buffer): Add map_name_ field.  Update
        constructor.  Change all callers.  Add do_print_to_mapfile
        constructor.  Change all callers.  Add do_print_to_mapfile
        function.
        function.
        (class Output_data_fixed_space): Likewise.
        (class Output_data_fixed_space): Likewise.
        (class Output_data_space): Likewise.
        (class Output_data_space): Likewise.
        (class Output_data_zero_fill): New class.
        (class Output_data_zero_fill): New class.
        (Output_data_strtab::do_print_to_mapfile): New function.
        (Output_data_strtab::do_print_to_mapfile): New function.
        (Output_data_reloc_base::do_print_to_mapfile): New function.
        (Output_data_reloc_base::do_print_to_mapfile): New function.
        (Output_relocatable_relocs::do_print_to_mapfile): New function.
        (Output_relocatable_relocs::do_print_to_mapfile): New function.
        (Output_data_group::do_print_to_mapfile): New function.
        (Output_data_group::do_print_to_mapfile): New function.
        (Output_data_got::do_print_to_mapfile): New function.
        (Output_data_got::do_print_to_mapfile): New function.
        (Output_data_dynamic::do_print_to_mapfile): New function.
        (Output_data_dynamic::do_print_to_mapfile): New function.
        (Output_symtab_xindex::do_print_to_mapfile): New function.
        (Output_symtab_xindex::do_print_to_mapfile): New function.
        (class Output_section): Declare do_print_to_mapflie.  Declare
        (class Output_section): Declare do_print_to_mapflie.  Declare
        print_to_mapfile in Input_section.
        print_to_mapfile in Input_section.
        (class Output_segment): Declare new functions.
        (class Output_segment): Declare new functions.
        * object.h (Sized_relobj::symbol_count): New function.
        * object.h (Sized_relobj::symbol_count): New function.
        * script-sections.cc
        * script-sections.cc
        (Output_section_element_dot_assignment::set_section_addresses):
        (Output_section_element_dot_assignment::set_section_addresses):
        Change Output_data_fixed_space to Output_data_zero_fill.
        Change Output_data_fixed_space to Output_data_zero_fill.
        (Output_data_expression::do_print_to_mapfile): New function.
        (Output_data_expression::do_print_to_mapfile): New function.
        * script.cc (read_input_script): Add mapfile parameter.  Change
        * script.cc (read_input_script): Add mapfile parameter.  Change
        all callers.
        all callers.
        * script.h (read_input_script): Update declaration.
        * script.h (read_input_script): Update declaration.
        * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
        * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
        (Eh_frame::do_print_to_mapfile): New function.
        (Eh_frame::do_print_to_mapfile): New function.
        * merge.h (Output_merge_data::do_print_to_mapfile): New function.
        * merge.h (Output_merge_data::do_print_to_mapfile): New function.
        (Output_merge_string::do_print_to_mapfile): New function.
        (Output_merge_string::do_print_to_mapfile): New function.
        * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
        * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
        function.
        function.
        * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
        * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
        function.
        function.
        * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
        * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
        function.
        function.
        * Makefile.am (CCFILES): Add mapfile.cc.
        * Makefile.am (CCFILES): Add mapfile.cc.
        (HFILES): Add mapfile.h.
        (HFILES): Add mapfile.h.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
2008-05-19  Ian Lance Taylor  
2008-05-19  Ian Lance Taylor  
        * options.h (class General_options): Add -z relro.
        * options.h (class General_options): Add -z relro.
        * layout.cc (Layout::Layout): Initialize relro_segment_.
        * layout.cc (Layout::Layout): Initialize relro_segment_.
        (Layout::add_output_section_data): Return the output section.
        (Layout::add_output_section_data): Return the output section.
        (Layout::make_output_section): Rcognize relro sections and mark
        (Layout::make_output_section): Rcognize relro sections and mark
        them appropriately.
        them appropriately.
        (Layout::attach_allocated_section_to_segment): Put relro sections
        (Layout::attach_allocated_section_to_segment): Put relro sections
        in a PT_GNU_RELRO segment.
        in a PT_GNU_RELRO segment.
        (Layout::create_initial_dynamic_sections): Mark the .dynamic
        (Layout::create_initial_dynamic_sections): Mark the .dynamic
        section as relro.
        section as relro.
        (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
        (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
        PT_TLS segments.
        PT_TLS segments.
        (Layout::linkonce_mapping): Map d.rel.ro.local to
        (Layout::linkonce_mapping): Map d.rel.ro.local to
        .data.rel.ro.local.
        .data.rel.ro.local.
        (Layout::output_section_name): Us .data.rel.ro.local for any
        (Layout::output_section_name): Us .data.rel.ro.local for any
        section which begins with that.
        section which begins with that.
        * layout.h (class Layout): Update add_output_section_data
        * layout.h (class Layout): Update add_output_section_data
        declaration.  Add relro_segment_ field.
        declaration.  Add relro_segment_ field.
        * output.cc (Output_section::Output_section): Initialize is_relro_
        * output.cc (Output_section::Output_section): Initialize is_relro_
        and is_relro_local_ fields.
        and is_relro_local_ fields.
        (Output_segment::add_output_section): Group relro sections.
        (Output_segment::add_output_section): Group relro sections.
        (Output_segment::is_first_section_relro): New function.
        (Output_segment::is_first_section_relro): New function.
        (Output_segment::maximum_alignment): If there is a relro section,
        (Output_segment::maximum_alignment): If there is a relro section,
        align the segment to the common page size.
        align the segment to the common page size.
        (Output_segment::set_section_addresses): Track whether we are
        (Output_segment::set_section_addresses): Track whether we are
        looking at relro sections.  If the last section is a relro
        looking at relro sections.  If the last section is a relro
        section, align to the common page size.
        section, align to the common page size.
        (Output_segment::set_section_list_addresses): Add in_relro
        (Output_segment::set_section_list_addresses): Add in_relro
        parameter.  Change all callers.  Align to the page size when
        parameter.  Change all callers.  Align to the page size when
        moving from relro to non-relro section.
        moving from relro to non-relro section.
        (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
        (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
        segment.
        segment.
        * output.h (class Output_section): Add is_relro_ and
        * output.h (class Output_section): Add is_relro_ and
        is_relro_local_ fields.
        is_relro_local_ fields.
        (Output_section::is_relro): New function.
        (Output_section::is_relro): New function.
        (Output_section::set_is_relro): New function.
        (Output_section::set_is_relro): New function.
        (Output_section::is_relro_local): New function.
        (Output_section::is_relro_local): New function.
        (Output_section::set_is_relro_local): New function.
        (Output_section::set_is_relro_local): New function.
        (class Output_segment): Update declarations.
        (class Output_segment): Update declarations.
        * i386.cc (Target_i386::got_section): Mark .got section as relro.
        * i386.cc (Target_i386::got_section): Mark .got section as relro.
        * sparc.cc (Target_sparc::got_section): Likewise.
        * sparc.cc (Target_sparc::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * x86_64.cc (Target_x86_64::got_section): Likewise.
        * testsuite/relro_test_main.cc: New file.
        * testsuite/relro_test_main.cc: New file.
        * testsuite/relro_test.cc: New file.
        * testsuite/relro_test.cc: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
        (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
        (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
        (relro_test_LDFLAGS, relro_test_LDADD): New variables.
        (relro_test_LDFLAGS, relro_test_LDADD): New variables.
        (relro_test.so, relro_test_pic.o): New targets.
        (relro_test.so, relro_test_pic.o): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-05-16  Ian Lance Taylor  
2008-05-16  Ian Lance Taylor  
        * output.cc (Output_segment::add_output_section): Remove front
        * output.cc (Output_segment::add_output_section): Remove front
        parameter.
        parameter.
        * output.h (class Output_segment): Remove
        * output.h (class Output_segment): Remove
        add_initial_output_section and overloaded add_output_section.
        add_initial_output_section and overloaded add_output_section.
        Update declaration of remaining add_output_section.
        Update declaration of remaining add_output_section.
        * layout.cc (Layout::create_interp): Call add_output_section
        * layout.cc (Layout::create_interp): Call add_output_section
        rather than add_initial_output_section.
        rather than add_initial_output_section.
        (Layout::finish_dynamic_section): Likewise.
        (Layout::finish_dynamic_section): Likewise.
        * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
        * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
        for TLS_GOTDESC and TLS_DESC_CALL.  Only optimize TLS_LDO_32 if we
        for TLS_GOTDESC and TLS_DESC_CALL.  Only optimize TLS_LDO_32 if we
        know the dynamic type.
        know the dynamic type.
        * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
        * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
        field.  Initialize it in constructor.
        field.  Initialize it in constructor.
        (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
        (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
        block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
        block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
        Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
        Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
        reloc.
        reloc.
        * output.cc (Output_reloc::get_address): Change return type to
        * output.cc (Output_reloc::get_address): Change return type to
        Elf_Addr.
        Elf_Addr.
        * output.h (class Output_reloc): Update get_address declaration.
        * output.h (class Output_reloc): Update get_address declaration.
        * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
        * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
        for section addresses.
        for section addresses.
2008-05-09  Ian Lance Taylor  
2008-05-09  Ian Lance Taylor  
        PR 6493
        PR 6493
        * gold.cc (gold_nomem): Use return value of write.
        * gold.cc (gold_nomem): Use return value of write.
2008-05-08  Ian Lance Taylor  
2008-05-08  Ian Lance Taylor  
        * symtab.c (Symbol::init_base_output_data): Add version
        * symtab.c (Symbol::init_base_output_data): Add version
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_undefined): Likewise.
        (Symbol::init_base_undefined): Likewise.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_undefined): Likewise.
        (Sized_symbol::init_undefined): Likewise.
        (Symbol_table::do_define_in_output_data): If the new symbol has a
        (Symbol_table::do_define_in_output_data): If the new symbol has a
        version, mark it as the default.
        version, mark it as the default.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::do_define_in_output_segment): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        (Symbol_table::do_define_as_constant): Likewise.
        * symtab.h (class Symbol): Update declarations.
        * symtab.h (class Symbol): Update declarations.
        (class Sized_symbol): Likewise.
        (class Sized_symbol): Likewise.
        * resolve.cc (Symbol::override_version): New function.
        * resolve.cc (Symbol::override_version): New function.
        (Symbol::override_base): Call override_version.
        (Symbol::override_base): Call override_version.
        (Symbol::override_base_with_special): Likewise.
        (Symbol::override_base_with_special): Likewise.
        * testsuite/ver_script_8.script: New file.
        * testsuite/ver_script_8.script: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
        (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
        (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
        (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
        (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
        (ver_test_8_1.so, ver_test_8_2.so): New targets.
        (ver_test_8_1.so, ver_test_8_2.so): New targets.
2008-05-06  Ian Lance Taylor  
2008-05-06  Ian Lance Taylor  
        PR 6049
        PR 6049
        * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
        * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
        functions.
        functions.
        (class General_options): Remove existing --undefined, and add
        (class General_options): Remove existing --undefined, and add
        --no-undefined instead.  Add new --undefined as synonym for -u.
        --no-undefined instead.  Add new --undefined as synonym for -u.
        * archive.cc (Archive::add_symbols): Check whether symbol was
        * archive.cc (Archive::add_symbols): Check whether symbol was
        named with -u.
        named with -u.
        * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
        * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
        * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
        * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
        all uses.  Add IS_UNDEFINED.  Update declarations to split
        all uses.  Add IS_UNDEFINED.  Update declarations to split
        different versions of init_base.  Declare init_base_undefined.
        different versions of init_base.  Declare init_base_undefined.
        (Symbol::is_defined): Handle IS_UNDEFINED.
        (Symbol::is_defined): Handle IS_UNDEFINED.
        (Symbol::is_undefined): Likewise.
        (Symbol::is_undefined): Likewise.
        (Symbol::is_weak_undefined): Call is_undefined.
        (Symbol::is_weak_undefined): Call is_undefined.
        (Symbol::is_absolute): Handle IS_CONSTANT.
        (Symbol::is_absolute): Handle IS_CONSTANT.
        (class Sized_symbol): Update declarations to split different
        (class Sized_symbol): Update declarations to split different
        versions of init.  Declare init_undefined.
        versions of init.  Declare init_undefined.
        (class Symbol_table): Declare new functions.
        (class Symbol_table): Declare new functions.
        * symtab.cc (Symbol::init_base_object): Rename from init_base.
        * symtab.cc (Symbol::init_base_object): Rename from init_base.
        Change all callers.
        Change all callers.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_data): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_output_segment): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_constant): Likewise.
        (Symbol::init_base_undefined): New function.
        (Symbol::init_base_undefined): New function.
        (Sized_symbol::init_object): Rename from init.  Change all
        (Sized_symbol::init_object): Rename from init.  Change all
        callers.
        callers.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_data): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_output_segment): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_constant): Likewise.
        (Sized_symbol::init_undefined): New function.
        (Sized_symbol::init_undefined): New function.
        (Symbol_table::add_undefined_symbols_from_command_line): New
        (Symbol_table::add_undefined_symbols_from_command_line): New
        function.
        function.
        (Symbol_table::do_add_undefined_symbols_from_command_line): New
        (Symbol_table::do_add_undefined_symbols_from_command_line): New
        function.
        function.
        (Symbol::final_value_is_known): Handle IS_UNDEFINED.
        (Symbol::final_value_is_known): Handle IS_UNDEFINED.
        (Symbol::output_section): Likewise.
        (Symbol::output_section): Likewise.
        (Symbol::set_output_section): Likewise.
        (Symbol::set_output_section): Likewise.
        (Symbol_table::sized_finalize_symbol): Likewise.
        (Symbol_table::sized_finalize_symbol): Likewise.
        (Symbol_table::sized_write_globals): Likewise.
        (Symbol_table::sized_write_globals): Likewise.
        * resolve.cc (Symbol_table::should_override): Likewise.
        * resolve.cc (Symbol_table::should_override): Likewise.
        (Symbol::override_base_with_special): Likewise.
        (Symbol::override_base_with_special): Likewise.
        * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
        * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
        symbol, change it to have default visibility.
        symbol, change it to have default visibility.
        * testsuite/protected_1.cc: New file.
        * testsuite/protected_1.cc: New file.
        * testsuite/protected_2.cc: New file.
        * testsuite/protected_2.cc: New file.
        * testsuite/protected_3.cc: New file.
        * testsuite/protected_3.cc: New file.
        * testsuite/protected_main_1.cc: New file.
        * testsuite/protected_main_1.cc: New file.
        * testsuite/protected_main_2.cc: New file.
        * testsuite/protected_main_2.cc: New file.
        * testsuite/protected_main_3.cc: New file.
        * testsuite/protected_main_3.cc: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
        * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
        (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
        (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
        (protected_1_LDFLAGS, protected_1_LDADD): Define.
        (protected_1_LDFLAGS, protected_1_LDADD): Define.
        (protected_1.so): New target.
        (protected_1.so): New target.
        (protected_1_pic.o, protected_2_pic.o): New targets.
        (protected_1_pic.o, protected_2_pic.o): New targets.
        (protected_3_pic.o): New target.
        (protected_3_pic.o): New target.
        (check_PROGRAMS): Add protected_2.
        (check_PROGRAMS): Add protected_2.
        (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
        (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
        (protected_2_LDFLAGS, protected_2_LDADD): Define.
        (protected_2_LDFLAGS, protected_2_LDADD): Define.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * options.h (DEFINE_var): Add set_user_set_##varname__.
        * options.h (DEFINE_var): Add set_user_set_##varname__.
        (DEFINE_bool_alias): New macro.
        (DEFINE_bool_alias): New macro.
        (class General_options): Define -Bstatic using DEFINE_bool_alias
        (class General_options): Define -Bstatic using DEFINE_bool_alias
        rather than DEFINE_special.  Add --undefined as an alias for -z
        rather than DEFINE_special.  Add --undefined as an alias for -z
        defs.
        defs.
        * options.cc (General_options::parse_Bstatic): Remove.
        * options.cc (General_options::parse_Bstatic): Remove.
        * options.h (class General_options): Add --fatal-warnings.
        * options.h (class General_options): Add --fatal-warnings.
        * main.cc (main): Implement --fatal-warnings.
        * main.cc (main): Implement --fatal-warnings.
        * errors.h (Errors::warning_count): New function.
        * errors.h (Errors::warning_count): New function.
        * options.h (class General_options): Add -Bsymbolic-functions.
        * options.h (class General_options): Add -Bsymbolic-functions.
        * symtab.h (Symbol::is_preemptible): Check for
        * symtab.h (Symbol::is_preemptible): Check for
        -Bsymbolic-functions.
        -Bsymbolic-functions.
2008-05-05  Ian Lance Taylor  
2008-05-05  Ian Lance Taylor  
        * options.h (DEFINE_bool): For DASH_Z, create the negative option
        * options.h (DEFINE_bool): For DASH_Z, create the negative option
        as noVARNAME rather than no-VARNAME.
        as noVARNAME rather than no-VARNAME.
        (class General_options): Add option -z combreloc.
        (class General_options): Add option -z combreloc.
        * output.h (class Output_reloc) [SHT_REL]: Declare compare and
        * output.h (class Output_reloc) [SHT_REL]: Declare compare and
        get_address.
        get_address.
        (Output_reloc::sort_before) [SHT_REL]: New function.
        (Output_reloc::sort_before) [SHT_REL]: New function.
        (Output_reloc::sort_before) [SHT_RELA]: New function.
        (Output_reloc::sort_before) [SHT_RELA]: New function.
        (class Output_data_reloc_base): Add sort_relocs_ field.  Define
        (class Output_data_reloc_base): Add sort_relocs_ field.  Define
        Sort_relocs_comparison.
        Sort_relocs_comparison.
        (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
        (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Output_data_reloc::Output_data_reloc) [both versions]: Add
        (Output_data_reloc::Output_data_reloc) [both versions]: Add
        sort_relocs parameter.  Change all callers.
        sort_relocs parameter.  Change all callers.
        * output.cc (Output_reloc::get_address): New function, broken out
        * output.cc (Output_reloc::get_address): New function, broken out
        of write_rel.
        of write_rel.
        (Output_reloc::write_rel): Call it.
        (Output_reloc::write_rel): Call it.
        (Output_reloc::compare): New function.
        (Output_reloc::compare): New function.
        (Output_data_reloc_base::do_write): Optionally sort relocs.
        (Output_data_reloc_base::do_write): Optionally sort relocs.
        * configure.ac: If targ_extra_obj is set, link it in.
        * configure.ac: If targ_extra_obj is set, link it in.
        * configure.tgt: Initialize all variables.
        * configure.tgt: Initialize all variables.
        (x86_64*): Set targ_extra_obj and targ_extra_size.
        (x86_64*): Set targ_extra_obj and targ_extra_size.
        * configure: Rebuild.
        * configure: Rebuild.
        * object.cc (Sized_relobj::include_section_group): Adjust section
        * object.cc (Sized_relobj::include_section_group): Adjust section
        indexes read from group data.  Build vector to pass to
        indexes read from group data.  Build vector to pass to
        layout_group.
        layout_group.
        * layout.cc (Layout::layout_group): Add flags and shndxes
        * layout.cc (Layout::layout_group): Add flags and shndxes
        parameters.  Remove contents parameter.  Change caller.  Update
        parameters.  Remove contents parameter.  Change caller.  Update
        explicit instantiations.
        explicit instantiations.
        * layout.h (class Layout): Update layout_group declaration.
        * layout.h (class Layout): Update layout_group declaration.
        * output.cc (Output_data_group::Output_data_group): Add flags and
        * output.cc (Output_data_group::Output_data_group): Add flags and
        input_shndxes parameters.  Remove contents parameter.  Change
        input_shndxes parameters.  Remove contents parameter.  Change
        caller.
        caller.
        (Output_data_group::do_write): Change input_sections_ to
        (Output_data_group::do_write): Change input_sections_ to
        input_shndxes_.
        input_shndxes_.
        * output.h (class Output_data_group): Update constructor
        * output.h (class Output_data_group): Update constructor
        declaration.  Rename input_sections_ to input_shndxes_.
        declaration.  Rename input_sections_ to input_shndxes_.
        * testsuite/many_sections_test.cc: Add template.
        * testsuite/many_sections_test.cc: Add template.
2008-04-30  Cary Coutant  
2008-04-30  Cary Coutant  
        * target-reloc.h (relocate_section): Fix dead-pointer bug.
        * target-reloc.h (relocate_section): Fix dead-pointer bug.
        * layout.cc (Layout::include_section): Refactored check for debug
        * layout.cc (Layout::include_section): Refactored check for debug
        info section.
        info section.
        (Layout::add_comdat): Add new parameters.  Change type
        (Layout::add_comdat): Add new parameters.  Change type
        of signature parameter.  Add object and shndx to signatures table.
        of signature parameter.  Add object and shndx to signatures table.
        (Layout::find_kept_object): New function.
        (Layout::find_kept_object): New function.
        * layout.h: Include .
        * layout.h: Include .
        (Layout::is_debug_info_section): New function.
        (Layout::is_debug_info_section): New function.
        (Layout::add_comdat): Add new parameters.
        (Layout::add_comdat): Add new parameters.
        (Layout::find_kept_object): New function.
        (Layout::find_kept_object): New function.
        (Layout::Kept_section): New struct.
        (Layout::Kept_section): New struct.
        (Layout::Signatures): Change type of map range.
        (Layout::Signatures): Change type of map range.
        * object.cc (Relobj::output_section_address): New function.
        * object.cc (Relobj::output_section_address): New function.
        (Sized_relobj::include_section_group): Add new parameters.  Change
        (Sized_relobj::include_section_group): Add new parameters.  Change
        calls to Layout::add_comdat.  Change to build table of kept comdat
        calls to Layout::add_comdat.  Change to build table of kept comdat
        groups and table mapping discarded sections to kept sections.
        groups and table mapping discarded sections to kept sections.
        (Sized_relobj::include_linkonce_section): Likewise.  Add new parameter.
        (Sized_relobj::include_linkonce_section): Likewise.  Add new parameter.
        (Sized_relobj::do_layout): Change calls to include_section_group and
        (Sized_relobj::do_layout): Change calls to include_section_group and
        include_linkonce_section.
        include_linkonce_section.
        (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
        (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
        value to zero when section is discarded.
        value to zero when section is discarded.
        (Sized_relobj::map_to_kept_section): New function.
        (Sized_relobj::map_to_kept_section): New function.
        * object.h (Relobj::output_section_address): New function.
        * object.h (Relobj::output_section_address): New function.
        (Relobj::Comdat_group): New type.
        (Relobj::Comdat_group): New type.
        (Relobj::find_comdat_group): New function.
        (Relobj::find_comdat_group): New function.
        (Relobj::Comdat_group_table): New type.
        (Relobj::Comdat_group_table): New type.
        (Relobj::Kept_comdat_section): New type.
        (Relobj::Kept_comdat_section): New type.
        (Relobj::Kept_comdat_section_table): New type.
        (Relobj::Kept_comdat_section_table): New type.
        (Relobj::add_comdat_group): New function.
        (Relobj::add_comdat_group): New function.
        (Relobj::set_kept_comdat_section): New function.
        (Relobj::set_kept_comdat_section): New function.
        (Relobj::get_kept_comdat_section): New function.
        (Relobj::get_kept_comdat_section): New function.
        (Relobj::comdat_groups_): New field.
        (Relobj::comdat_groups_): New field.
        (Relobj::kept_comdat_sections_): New field.
        (Relobj::kept_comdat_sections_): New field.
        (Symbol_value::input_value): Update comment.
        (Symbol_value::input_value): Update comment.
        (Sized_relobj::map_to_kept_section) New function.
        (Sized_relobj::map_to_kept_section) New function.
        (Sized_relobj::include_linkonce_section): Add new parameter.
        (Sized_relobj::include_linkonce_section): Add new parameter.
        * target-reloc.h (Comdat_behavior): New type.
        * target-reloc.h (Comdat_behavior): New type.
        (get_comdat_behavior): New function.
        (get_comdat_behavior): New function.
        (relocate_section): Add code to map a discarded section to the
        (relocate_section): Add code to map a discarded section to the
        corresponding kept section when applying a relocation.
        corresponding kept section when applying a relocation.
2008-04-30  Craig Silverstein  
2008-04-30  Craig Silverstein  
        * dwarf_reader.cc (next_generation_count): New static var.
        * dwarf_reader.cc (next_generation_count): New static var.
        (Addr2line_cache_entry): New struct.
        (Addr2line_cache_entry): New struct.
        (addr2line_cache): New static var.
        (addr2line_cache): New static var.
        (Dwarf_line_info::one_addr2line): Added caching.
        (Dwarf_line_info::one_addr2line): Added caching.
        (Dwarf_line_info::clear_addr2line_cache): New function.
        (Dwarf_line_info::clear_addr2line_cache): New function.
        * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
        * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
        cache-size parameter.
        cache-size parameter.
        (Dwarf_line_info::one_addr2line_cache): New function.
        (Dwarf_line_info::one_addr2line_cache): New function.
        * symtab.cc (Symbol_table::detect_odr_violations): Pass
        * symtab.cc (Symbol_table::detect_odr_violations): Pass
        new cache-size argument to one_addr2line(), and clear cache.
        new cache-size argument to one_addr2line(), and clear cache.
2008-04-28  Cary Coutant  
2008-04-28  Cary Coutant  
        * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
        * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
        R_386_PC8 relocations.
        R_386_PC8 relocations.
2008-04-23  Ian Lance Taylor  
2008-04-23  Ian Lance Taylor  
        * object.cc (Sized_relobj::include_section_group): Check for
        * object.cc (Sized_relobj::include_section_group): Check for
        invalid section group.
        invalid section group.
        * object.cc (make_elf_object): Correct test for 64-bit ELF file
        * object.cc (make_elf_object): Correct test for 64-bit ELF file
        header size.
        header size.
        * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
        * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
        than read for file header.
        than read for file header.
        * archive.cc (Archive::include_member): Likewise.
        * archive.cc (Archive::include_member): Likewise.
2008-04-23  Paolo Bonzini  
2008-04-23  Paolo Bonzini  
        * aclocal.m4: Regenerate.
        * aclocal.m4: Regenerate.
        * configure: Regenerate.
        * configure: Regenerate.
2008-04-19  Ian Lance Taylor  
2008-04-19  Ian Lance Taylor  
        * version.cc (version_string): Bump to 1.6.
        * version.cc (version_string): Bump to 1.6.
        * testsuite/Makefile.am (many_sections_r_test): New target.
        * testsuite/Makefile.am (many_sections_r_test): New target.
        (many_sections_r_test_SOURCES): Remove.
        (many_sections_r_test_SOURCES): Remove.
        (many_sections_r_test_DEPENDENCIES): Remove.
        (many_sections_r_test_DEPENDENCIES): Remove.
        (many_sections_r_test_LDFLAGS): Remove.
        (many_sections_r_test_LDFLAGS): Remove.
        (many_sections_r_test_LDADD): Remove.
        (many_sections_r_test_LDADD): Remove.
        * object.cc (Sized_relobj::do_add_symbols): Always pass
        * object.cc (Sized_relobj::do_add_symbols): Always pass
        local_symbol_count_ to add_from_relobj.
        local_symbol_count_ to add_from_relobj.
        * testsuite/Makefile.am (many_sections_check.h): Only check one in
        * testsuite/Makefile.am (many_sections_check.h): Only check one in
        every thousand variables.
        every thousand variables.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * object.cc (Xindex::initialize_symtab_xindex): New function.
        * object.cc (Xindex::initialize_symtab_xindex): New function.
        (Xindex::read_symtab_xindex): New function.
        (Xindex::read_symtab_xindex): New function.
        (Xindex::sym_xindex_to_shndx): New function.
        (Xindex::sym_xindex_to_shndx): New function.
        (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
        (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
        available.
        available.
        (Sized_relobj::do_initialize_xindex): New function.
        (Sized_relobj::do_initialize_xindex): New function.
        (Sized_relobj::do_read_symbols): Adjust section links.
        (Sized_relobj::do_read_symbols): Adjust section links.
        (Sized_relobj::symbol_section_and_value): Add is_ordinary
        (Sized_relobj::symbol_section_and_value): Add is_ordinary
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Sized_relobj::include_section_group): Adjust section links and
        (Sized_relobj::include_section_group): Adjust section links and
        symbol section indexes.
        symbol section indexes.
        (Sized_relobj::do_layout): Adjust section links.
        (Sized_relobj::do_layout): Adjust section links.
        (Sized_relobj::do_count_local_symbols): Adjust section links and
        (Sized_relobj::do_count_local_symbols): Adjust section links and
        symbol section indexes.
        symbol section indexes.
        (Sized_relobj::do_finalize_local_symbols): Distinguish between
        (Sized_relobj::do_finalize_local_symbols): Distinguish between
        ordinary and special symbols.
        ordinary and special symbols.
        (Sized_relobj::write_local_symbols): Add symtab_xindex and
        (Sized_relobj::write_local_symbols): Add symtab_xindex and
        dynsym_xindex parameters.  Change all callers.  Adjust section
        dynsym_xindex parameters.  Change all callers.  Adjust section
        links.  Use SHN_XINDEX when needed.
        links.  Use SHN_XINDEX when needed.
        (Sized_relobj::get_symbol_location_info): Adjust section links.
        (Sized_relobj::get_symbol_location_info): Adjust section links.
        Don't get fooled by special symbols.
        Don't get fooled by special symbols.
        * object.h (class Xindex): Define.
        * object.h (class Xindex): Define.
        (class Object): Add xindex_ parameter.  Declare virtual functoin
        (class Object): Add xindex_ parameter.  Declare virtual functoin
        do_initialize_xindex.
        do_initialize_xindex.
        (Object::adjust_sym_shndx): New function.
        (Object::adjust_sym_shndx): New function.
        (Object::set_xindex): New protected function.
        (Object::set_xindex): New protected function.
        (class Symbol_value): Add is_ordinary_shndx_ field.
        (class Symbol_value): Add is_ordinary_shndx_ field.
        (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
        (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
        (Symbol_value::value): Assert ordinary section.
        (Symbol_value::value): Assert ordinary section.
        (Symbol_value::initialize_input_to_output_map): Likewise.
        (Symbol_value::initialize_input_to_output_map): Likewise.
        (Symbol_value::set_input_shndx): Add is_ordinary parameter.
        (Symbol_value::set_input_shndx): Add is_ordinary parameter.
        Change all callers.
        Change all callers.
        (Symbol_value::input_shndx): Add is_ordinary parameter.  Change
        (Symbol_value::input_shndx): Add is_ordinary parameter.  Change
        all callers.
        all callers.
        (class Sized_relobj): Update declarations.
        (class Sized_relobj): Update declarations.
        (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
        (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Sized_relobj::adjust_shndx): New function.
        (Sized_relobj::adjust_shndx): New function.
        * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
        * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
        field.
        field.
        (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
        (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
        parameter.  Change all callers.  Pick up SHT_DYNSYM_SHNDX section
        parameter.  Change all callers.  Pick up SHT_DYNSYM_SHNDX section
        for SHT_DYNSYM section if available.  Set dynsym_shndx_ field.
        for SHT_DYNSYM section if available.  Set dynsym_shndx_ field.
        (Sized_dynobj::read_dynsym_section): Adjust section links.
        (Sized_dynobj::read_dynsym_section): Adjust section links.
        (Sized_dynobj::read_dynamic): Likewise.
        (Sized_dynobj::read_dynamic): Likewise.
        (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field.  Adjust
        (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field.  Adjust
        section links.
        section links.
        (Sized_dynobj::do_initialize_xindex): New function.
        (Sized_dynobj::do_initialize_xindex): New function.
        * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field.  Declare
        * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field.  Declare
        do_initialize_xindex.
        do_initialize_xindex.
        (Sized_dynobj::adjust_shndx): New function.
        (Sized_dynobj::adjust_shndx): New function.
        * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
        * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
        dynsym_xindex_ fields.
        dynsym_xindex_ fields.
        (Layout::finalize): Add a call to set_section_indexes before
        (Layout::finalize): Add a call to set_section_indexes before
        creating the symtab sections.
        creating the symtab sections.
        (Layout::set_section_indexes): Don't do anything if the section
        (Layout::set_section_indexes): Don't do anything if the section
        already has a section index.
        already has a section index.
        (Layout::create_symtab_sections): Add shnum parameter.  Change
        (Layout::create_symtab_sections): Add shnum parameter.  Change
        caller.  Create .symtab_shndx section if needed.
        caller.  Create .symtab_shndx section if needed.
        (Layout::create_shdrs): Add shstrtab_section parameter.  Change
        (Layout::create_shdrs): Add shstrtab_section parameter.  Change
        caller.
        caller.
        (Layout::allocated_output_section_count): New function.
        (Layout::allocated_output_section_count): New function.
        (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
        (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
        needed.
        needed.
        * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
        * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
        fields.  Update declarations.
        fields.  Update declarations.
        (Layout::symtab_xindex): New function.
        (Layout::symtab_xindex): New function.
        (Layout::dynsym_xindex): New function.
        (Layout::dynsym_xindex): New function.
        (class Write_symbols_task): Add layout_ field.
        (class Write_symbols_task): Add layout_ field.
        (Write_symbols_task::Write_symbols_task): Add layout parameter.
        (Write_symbols_task::Write_symbols_task): Add layout parameter.
        Change caller.
        Change caller.
        * output.cc (Output_section_headers::Output_section_headers): Add
        * output.cc (Output_section_headers::Output_section_headers): Add
        shstrtab_section parameter.  Change all callers.
        shstrtab_section parameter.  Change all callers.
        (Output_section_headers::do_sized_write): Store overflow values
        (Output_section_headers::do_sized_write): Store overflow values
        for section count and section string table section index in
        for section count and section string table section index in
        section header zero.
        section header zero.
        (Output_file_header::do_sized_write): Check for overflow of
        (Output_file_header::do_sized_write): Check for overflow of
        section count and section string table section index.
        section count and section string table section index.
        (Output_symtab_xindex::do_write): New function.
        (Output_symtab_xindex::do_write): New function.
        (Output_symtab_xindex::endian_do_write): New function.
        (Output_symtab_xindex::endian_do_write): New function.
        * output.h (class Output_section_headers): Add shstrtab_section_.
        * output.h (class Output_section_headers): Add shstrtab_section_.
        Update declarations.
        Update declarations.
        (class Output_symtab_xindex): Define.
        (class Output_symtab_xindex): Define.
        (Output_section::has_out_shndx): New function.
        (Output_section::has_out_shndx): New function.
        * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
        * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
        field.
        field.
        (Symbol::init_base): Add st_shndx and is_ordinary parameters.
        (Symbol::init_base): Add st_shndx and is_ordinary parameters.
        Change all callers.
        Change all callers.
        (Sized_symbol::init): Likewise.
        (Sized_symbol::init): Likewise.
        (Symbol::output_section): Check for ordinary symbol.
        (Symbol::output_section): Check for ordinary symbol.
        (Symbol_table::add_from_object): Remove orig_sym parameter.  Add
        (Symbol_table::add_from_object): Remove orig_sym parameter.  Add
        st_shndx, is_ordinary, and orig_st_shndx parameters.  Change all
        st_shndx, is_ordinary, and orig_st_shndx parameters.  Change all
        callers.
        callers.
        (Symbol_table::add_from_relobj): Add symndx_offset parameter.
        (Symbol_table::add_from_relobj): Add symndx_offset parameter.
        Change all callers.  Simplify handling of symbols from sections
        Change all callers.  Simplify handling of symbols from sections
        not included in the link.
        not included in the link.
        (Symbol_table::add_from_dynobj): Handle ordinary symbol
        (Symbol_table::add_from_dynobj): Handle ordinary symbol
        distinction.
        distinction.
        (Weak_alias_sorter::operator()): Assert that symbols are
        (Weak_alias_sorter::operator()): Assert that symbols are
        ordinary.
        ordinary.
        (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
        (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
        distinction.
        distinction.
        (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
        (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
        parameters.  Change all callers.
        parameters.  Change all callers.
        (Symbol_table::sized_write_globals): Likewise.  Handle ordinary
        (Symbol_table::sized_write_globals): Likewise.  Handle ordinary
        symbol distinction.  Use SHN_XINDEX when needed.
        symbol distinction.  Use SHN_XINDEX when needed.
        (Symbol_table::write_section_symbol): Add symtab_xindex
        (Symbol_table::write_section_symbol): Add symtab_xindex
        parameter.  Change all callers.
        parameter.  Change all callers.
        (Symbol_table::sized_write_section_symbol): Likewise.  Use
        (Symbol_table::sized_write_section_symbol): Likewise.  Use
        SHN_XINDEX when needed.
        SHN_XINDEX when needed.
        * symtab.h (class Symbol): Add is_ordinary_shndx_ field.  Update
        * symtab.h (class Symbol): Add is_ordinary_shndx_ field.  Update
        declarations.
        declarations.
        (Symbol::shndx): Add is_ordinary parameter.  Change all callers.
        (Symbol::shndx): Add is_ordinary parameter.  Change all callers.
        (Symbol::is_defined): Check is_ordinary.
        (Symbol::is_defined): Check is_ordinary.
        (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
        (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
        (Symbol::is_absolute, Symbol::is_common): Likewise.
        (Symbol::is_absolute, Symbol::is_common): Likewise.
        (class Sized_symbol): Update declarations.
        (class Sized_symbol): Update declarations.
        (class Symbol_table): Update declarations.
        (class Symbol_table): Update declarations.
        * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
        * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
        parameters.  Change all callers.
        parameters.  Change all callers.
        (Sized_symbol::override): Likewise.
        (Sized_symbol::override): Likewise.
        (Symbol_table::override): Likewise.
        (Symbol_table::override): Likewise.
        (symbol_to_bits): Add is_ordinary parameter.  Change all callers.
        (symbol_to_bits): Add is_ordinary parameter.  Change all callers.
        (Symbol_table::resolve): Remove orig_sym parameter.  Add st_shndx,
        (Symbol_table::resolve): Remove orig_sym parameter.  Add st_shndx,
        is_ordinary, and orig_st_shndx parameters.  Change all callers.
        is_ordinary, and orig_st_shndx parameters.  Change all callers.
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
        * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
        to be in an ordinary section.
        to be in an ordinary section.
        * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
        * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
        object and is_ordinary parameters.  Change all callers.
        object and is_ordinary parameters.  Change all callers.
        (Sized_dwarf_line_info::read_relocs): Add object parameter.
        (Sized_dwarf_line_info::read_relocs): Add object parameter.
        Change all callers.  Don't add undefined or non-ordinary symbols
        Change all callers.  Don't add undefined or non-ordinary symbols
        to reloc_map_.
        to reloc_map_.
        (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
        (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
        Change all callers.
        Change all callers.
        * dwarf_reader.h (class Sized_dwarf_line_info): Update
        * dwarf_reader.h (class Sized_dwarf_line_info): Update
        declarations.
        declarations.
        * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
        * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
        * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
        * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
        (Sized_relobj::relocate_sections): Likewise.
        (Sized_relobj::relocate_sections): Likewise.
        * target-reloc.h (scan_relocs): Adjust section symbol index.
        * target-reloc.h (scan_relocs): Adjust section symbol index.
        (scan_relocatable_relocs): Likewise.
        (scan_relocatable_relocs): Likewise.
        * i386.cc (Scan::local): Check for ordinary symbols.
        * i386.cc (Scan::local): Check for ordinary symbols.
        * sparc.cc (Scan::local): Likewise.
        * sparc.cc (Scan::local): Likewise.
        * x86_64.cc (Scan::local): Likewise.
        * x86_64.cc (Scan::local): Likewise.
        * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
        * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
        to symbol_section_and_value.
        to symbol_section_and_value.
        * testsuite/many_sections_test.cc: New file.
        * testsuite/many_sections_test.cc: New file.
        * testsuite/Makefile.am (BUILT_SOURCES): Define.
        * testsuite/Makefile.am (BUILT_SOURCES): Define.
        (check_PROGRAMS): Add many_sections_test.
        (check_PROGRAMS): Add many_sections_test.
        (many_sections_test_SOURCES): Define.
        (many_sections_test_SOURCES): Define.
        (many_sections_test_DEPENDENCIES): Define.
        (many_sections_test_DEPENDENCIES): Define.
        (many_sections_test_LDFLAGS): Define.
        (many_sections_test_LDFLAGS): Define.
        (BUILT_SOURCES): Add many_sections_define.h.
        (BUILT_SOURCES): Add many_sections_define.h.
        (many_sections_define.h): New target.
        (many_sections_define.h): New target.
        (BUILT_SOURCES): Add many_sections_check.h.
        (BUILT_SOURCES): Add many_sections_check.h.
        (many_sections_check.h): New target.
        (many_sections_check.h): New target.
        (check_PROGRAMS): Add many_sections_r_test.
        (check_PROGRAMS): Add many_sections_r_test.
        (many_sections_r_test_SOURCES): Define.
        (many_sections_r_test_SOURCES): Define.
        (many_sections_r_test_DEPENDENCIES): Define.
        (many_sections_r_test_DEPENDENCIES): Define.
        (many_sections_r_test_LDFLAGS): Define.
        (many_sections_r_test_LDFLAGS): Define.
        (many_sections_r_test_LDADD): Define.
        (many_sections_r_test_LDADD): Define.
        (many_sections_r_test.o): New target.
        (many_sections_r_test.o): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-04-17  Cary Coutant  
2008-04-17  Cary Coutant  
        * errors.cc (Errors::info): New function.
        * errors.cc (Errors::info): New function.
        (gold_info): New function.
        (gold_info): New function.
        * errors.h (Errors::info): New function.
        * errors.h (Errors::info): New function.
        * gold.h (gold_info): New function.
        * gold.h (gold_info): New function.
        * object.cc (Input_objects::add_object): Print trace output.
        * object.cc (Input_objects::add_object): Print trace output.
        * options.cc (options::parse_set): New function.
        * options.cc (options::parse_set): New function.
        (General_options::parse_wrap): Deleted.
        (General_options::parse_wrap): Deleted.
        (General_options::General_options): Deleted initializer.
        (General_options::General_options): Deleted initializer.
        * options.h (options::String_set): New typedef.
        * options.h (options::String_set): New typedef.
        (options::parse_set): New function.
        (options::parse_set): New function.
        (DEFINE_set): New macro.
        (DEFINE_set): New macro.
        (General_options::wrap): Changed to use DEFINE_set. Changed
        (General_options::wrap): Changed to use DEFINE_set. Changed
        callers of any_wrap_symbols and is_wrap_symbol.
        callers of any_wrap_symbols and is_wrap_symbol.
        (General_options::trace, General_options::trace_symbol):
        (General_options::trace, General_options::trace_symbol):
        New options.
        New options.
        (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
        (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
        (General_options::wrap_symbols_): Deleted.
        (General_options::wrap_symbols_): Deleted.
        * symtab.cc (Symbol_table::add_from_object): Print trace output.
        * symtab.cc (Symbol_table::add_from_object): Print trace output.
2008-04-17  David S. Miller  
2008-04-17  David S. Miller  
        * options.cc (General_options::parse_V): New function.
        * options.cc (General_options::parse_V): New function.
        * options.h: Add entries for -V and -Qy.
        * options.h: Add entries for -V and -Qy.
2008-04-17  Ian Lance Taylor  
2008-04-17  Ian Lance Taylor  
        * common.cc (Symbol_table::allocate_commons): Remove options
        * common.cc (Symbol_table::allocate_commons): Remove options
        parameter.  Change caller.
        parameter.  Change caller.
        (Symbol_table::do_allocate_commons): Remove options parameter.
        (Symbol_table::do_allocate_commons): Remove options parameter.
        Change caller.  Just call do_allocate_commons_list twice.
        Change caller.  Just call do_allocate_commons_list twice.
        (Symbol_table::do_allocate_commons_list): New function, broken out
        (Symbol_table::do_allocate_commons_list): New function, broken out
        of do_allocate_commons.
        of do_allocate_commons.
        * common.h (class Allocate_commons_task): Remove options_ field.
        * common.h (class Allocate_commons_task): Remove options_ field.
        Update constructor.
        Update constructor.
        * symtab.cc (Symbol_table::Symbol_table): Initialize
        * symtab.cc (Symbol_table::Symbol_table): Initialize
        tls_commons_.
        tls_commons_.
        (Symbol_table::add_from_object): Put TLS common symbols on
        (Symbol_table::add_from_object): Put TLS common symbols on
        tls_commons_ list.
        tls_commons_ list.
        (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
        (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
        which are IN_OUTPUT_DATA.
        which are IN_OUTPUT_DATA.
        * symtab.h (class Symbol_table): Add tls_commons_ field.  Update
        * symtab.h (class Symbol_table): Add tls_commons_ field.  Update
        allocate_commons and do_allocate_commons declarations.  Declare
        allocate_commons and do_allocate_commons declarations.  Declare
        do_allocate_commons_list.
        do_allocate_commons_list.
        * gold.cc (queue_middle_tasks): Update creation of
        * gold.cc (queue_middle_tasks): Update creation of
        Allocate_commons_task to not pass options.
        Allocate_commons_task to not pass options.
        * testsuite/Makefile.am (INCLUDES): Add -I.. .
        * testsuite/Makefile.am (INCLUDES): Add -I.. .
        (TLS_TEST_C_FLAGS): New variable.
        (TLS_TEST_C_FLAGS): New variable.
        (tls_test_c_pic.o): New target.
        (tls_test_c_pic.o): New target.
        (tls_test_shared.so): Link in tls_test_c_pic.o.
        (tls_test_shared.so): Link in tls_test_c_pic.o.
        (tls_test_c_pic_ie.o): New target.
        (tls_test_c_pic_ie.o): New target.
        (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
        (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
        (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
        (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
        (tls_test_c.o): New target.
        (tls_test_c.o): New target.
        (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
        (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
        (tls_pic_test_LDADD): Likewise.
        (tls_pic_test_LDADD): Likewise.
        (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
        (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
        (tls_shared_gd_to_ie_test_LDADD): Likewise.
        (tls_shared_gd_to_ie_test_LDADD): Likewise.
        (tls_test_c_gnu2.o): New target.
        (tls_test_c_gnu2.o): New target.
        (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
        (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
        tls_test_c_gnu2.o.
        tls_test_c_gnu2.o.
        (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
        (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
        (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
        (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
        (tls_test_shared_nonpic.so): Link in tls_test_c.o.
        (tls_test_shared_nonpic.so): Link in tls_test_c.o.
        * testsuite/tls_test.cc: Include "config.h".
        * testsuite/tls_test.cc: Include "config.h".
        (t_last): Call t11_last.
        (t_last): Call t11_last.
        * testsuite/tls_test.h (t11, t11_last): Declare.
        * testsuite/tls_test.h (t11, t11_last): Declare.
        * testsuite/tls_test_c.c: New file.
        * testsuite/tls_test_c.c: New file.
        * testsuite/tls_test_main.cc (thread_routine): Call t11.
        * testsuite/tls_test_main.cc (thread_routine): Call t11.
        * configure.ac: Check for OpenMP support.
        * configure.ac: Check for OpenMP support.
        * configure, config.in, Makefile.in: Rebuild.
        * configure, config.in, Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
2008-04-16  Cary Coutant  
2008-04-16  Cary Coutant  
        * i386.cc (Target_i386::define_tls_base_symbol): New function.
        * i386.cc (Target_i386::define_tls_base_symbol): New function.
        (Target_i386::tls_base_symbol_defined_): New field.
        (Target_i386::tls_base_symbol_defined_): New field.
        (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
        (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Scan::global): Likewise.
        * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
        * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
        * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
        (Target_x86_64::tls_base_symbol_defined_): New field.
        (Target_x86_64::tls_base_symbol_defined_): New field.
        (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
        (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
2008-04-16  Cary Coutant  
2008-04-16  Cary Coutant  
        * symtab.h (Symbol::is_strong_undefined): Removed unused function.
        * symtab.h (Symbol::is_strong_undefined): Removed unused function.
        (Symbol::needs_plt_entry): Allow weak undefined symbols.
        (Symbol::needs_plt_entry): Allow weak undefined symbols.
        (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
        (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
        building shared libraries.
        building shared libraries.
        * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
        * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
        (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
        (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
        (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
        (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/weak_undef.h: New file.
        * testsuite/weak_undef.h: New file.
        * testsuite/weak_undef_file1.cc: Add extra test cases.
        * testsuite/weak_undef_file1.cc: Add extra test cases.
        * testsuite/weak_undef_file2.cc: Likewise.
        * testsuite/weak_undef_file2.cc: Likewise.
        * testsuite/weak_undef_test.cc: Likewise.
        * testsuite/weak_undef_test.cc: Likewise.
2008-04-16  David S. Miller  
2008-04-16  David S. Miller  
        * sparc.cc (Target_sparc::Scan): Change from struct to class.
        * sparc.cc (Target_sparc::Scan): Change from struct to class.
        Add issued_non_pic_error_ field.  Declare check_non_pic.
        Add issued_non_pic_error_ field.  Declare check_non_pic.
        (Target_sparc::Scan::check_non_pic): New function.
        (Target_sparc::Scan::check_non_pic): New function.
        (Target_sparc::Scan::local): Call check_non_pic as appropriate.
        (Target_sparc::Scan::local): Call check_non_pic as appropriate.
        (Target_sparc::Scan::global): Likewise.
        (Target_sparc::Scan::global): Likewise.
        * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
        * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
        * configure: Rebuild.
        * configure: Rebuild.
        * options.h (DEFINE_enable): New macro.
        * options.h (DEFINE_enable): New macro.
        (new_dtags): New enable option.
        (new_dtags): New enable option.
        (initfirst, interpose, loadfltr, nodefaultlib,
        (initfirst, interpose, loadfltr, nodefaultlib,
        nodelete, nodlopen, nodump): New -z options.
        nodelete, nodlopen, nodump): New -z options.
        * layout.cc (Layout:finish_dynamic_section): If new
        * layout.cc (Layout:finish_dynamic_section): If new
        dtags enabled, emit DT_RUNPATH.  Also, emit a
        dtags enabled, emit DT_RUNPATH.  Also, emit a
        DT_FLAGS_1 containing any specified -z flags.
        DT_FLAGS_1 containing any specified -z flags.
2008-04-16  Ian Lance Taylor  
2008-04-16  Ian Lance Taylor  
        * copy-relocs.cc: New file.
        * copy-relocs.cc: New file.
        * copy-relocs.h: New file.
        * copy-relocs.h: New file.
        * reloc.cc: Remove Copy_relocs code.
        * reloc.cc: Remove Copy_relocs code.
        * reloc.h: Likewise.
        * reloc.h: Likewise.
        * reloc-types.h (struct Reloc_types) [both versions]: Add
        * reloc-types.h (struct Reloc_types) [both versions]: Add
        get_reloc_addend_noerror.
        get_reloc_addend_noerror.
        * output.h (class Output_data_reloc): Add
        * output.h (class Output_data_reloc): Add
        variants of add_global which take an addend which must be zero.
        variants of add_global which take an addend which must be zero.
        * i386.cc: Include "copy-relocs.h".
        * i386.cc: Include "copy-relocs.h".
        (class Target_i386): Change type of copy_relocs_ to variable,
        (class Target_i386): Change type of copy_relocs_ to variable,
        update initializer.
        update initializer.
        (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
        (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
        Change all callers.
        Change all callers.
        (Target_i386::do_finalize_sections): Change handling of
        (Target_i386::do_finalize_sections): Change handling of
        copy_relocs_.
        copy_relocs_.
        * sparc.cc: Include "copy-relocs.h".
        * sparc.cc: Include "copy-relocs.h".
        (class Target_sparc): Change type of copy_relocs_ to variable,
        (class Target_sparc): Change type of copy_relocs_ to variable,
        update initializer.
        update initializer.
        (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
        (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
        Change all callers.
        Change all callers.
        (Target_sparc::do_finalize_sections): Change handling of
        (Target_sparc::do_finalize_sections): Change handling of
        copy_relocs_.
        copy_relocs_.
        * x86_64.cc: Include "copy-relocs.h".
        * x86_64.cc: Include "copy-relocs.h".
        (class Target_x86_64): Change type of copy_relocs_ to variable,
        (class Target_x86_64): Change type of copy_relocs_ to variable,
        update initializer.
        update initializer.
        (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
        (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
        class.  Change all callers.
        class.  Change all callers.
        (Target_x86_64::do_finalize_sections): Change handling of
        (Target_x86_64::do_finalize_sections): Change handling of
        copy_relocs_.
        copy_relocs_.
        * Makefile.am (CCFILES): Add copy-relocs.cc.
        * Makefile.am (CCFILES): Add copy-relocs.cc.
        (HFILES): Add copy-relocs.h.
        (HFILES): Add copy-relocs.h.
        * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
        * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
        * testsuite/script_test_4.sh: Permit leading zeroes.
        * testsuite/script_test_4.sh: Permit leading zeroes.
2008-04-15  Ian Lance Taylor  
2008-04-15  Ian Lance Taylor  
        * script-sections.cc (Script_sections::create_segments): Use
        * script-sections.cc (Script_sections::create_segments): Use
        header_size_adjustment even when there is enough room for the
        header_size_adjustment even when there is enough room for the
        headers.
        headers.
        * testsuite/script_test_4.sh: New file.
        * testsuite/script_test_4.sh: New file.
        * testsuite/script_test_4.t: New file.
        * testsuite/script_test_4.t: New file.
        * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
        (check_DATA): Add script_test_4.stdout.
        (check_DATA): Add script_test_4.stdout.
        (MOSTLYCLEANFILES): Likewise.
        (MOSTLYCLEANFILES): Likewise.
        (script_test_4): New target.
        (script_test_4): New target.
        (script_test_4.stdout): New target.
        (script_test_4.stdout): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * sparc.cc: Add definitions for Output_data_plt_sparc class
        * sparc.cc: Add definitions for Output_data_plt_sparc class
        constants.
        constants.
2008-04-14  David S. Miller  
2008-04-14  David S. Miller  
        * sparc.cc: New file.
        * sparc.cc: New file.
        * Makefile.am (TARGETSOURCES): Add sparc.cc
        * Makefile.am (TARGETSOURCES): Add sparc.cc
        (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
        (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
        * configure.tgt: Document targ_extra_size and
        * configure.tgt: Document targ_extra_size and
        targ_extra_big_endian.  Add entries for sparc-* and
        targ_extra_big_endian.  Add entries for sparc-* and
        sparc64-*.
        sparc64-*.
        * configure.ac: Handle targ_extra_size and
        * configure.ac: Handle targ_extra_size and
        targ_extra_big_endian.
        targ_extra_big_endian.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
        * configure: Likewise.
        * configure: Likewise.
        * po/POTFILES.in: Likewise.
        * po/POTFILES.in: Likewise.
        * po/gold.pot: Likewise.
        * po/gold.pot: Likewise.
2008-04-14  Ian Lance Taylor  
2008-04-14  Ian Lance Taylor  
        * layout.cc (Layout::Layout): Initialize sections_are_attached_.
        * layout.cc (Layout::Layout): Initialize sections_are_attached_.
        (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
        (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
        in the name/type/flags to section mapping.  Don't call
        in the name/type/flags to section mapping.  Don't call
        allocate_output_section.
        allocate_output_section.
        (Layout::choose_output_section): Change parameter from adjust_name
        (Layout::choose_output_section): Change parameter from adjust_name
        to is_input_section.  Don't permit input sections after sections
        to is_input_section.  Don't permit input sections after sections
        are attached to segments.  Don't call allocate_output_section.
        are attached to segments.  Don't call allocate_output_section.
        (Layout::layout_eh_frame): Call update_flags_for_input_section,
        (Layout::layout_eh_frame): Call update_flags_for_input_section,
        not write_enable_output_section.
        not write_enable_output_section.
        (Layout::make_output_section): Don't push to
        (Layout::make_output_section): Don't push to
        unattached_section_list_ nor call attach_to_segment.  Call
        unattached_section_list_ nor call attach_to_segment.  Call
        attach_section_to_segment if sections are attached.
        attach_section_to_segment if sections are attached.
        (Layout::attach_sections_to_segments): New function.
        (Layout::attach_sections_to_segments): New function.
        (Layout::attach_section_to_segment): New function.
        (Layout::attach_section_to_segment): New function.
        (Layout::attach_allocated_section_to_segment): Rename from
        (Layout::attach_allocated_section_to_segment): Rename from
        attach_to_segment.  Remove flags parameter.
        attach_to_segment.  Remove flags parameter.
        (Layout::allocate_output_section): Remove function.
        (Layout::allocate_output_section): Remove function.
        (Layout::write_enable_output_section): Remove function.
        (Layout::write_enable_output_section): Remove function.
        * layout.h (class Layout): Update for above changes.  Add new
        * layout.h (class Layout): Update for above changes.  Add new
        field sections_are_attached_.
        field sections_are_attached_.
        * output.h (Output_section::update_flags_for_input_section): New
        * output.h (Output_section::update_flags_for_input_section): New
        function.
        function.
        * output.cc (Output_section::add_input_section): Call
        * output.cc (Output_section::add_input_section): Call
        update_flags_for_input_section.
        update_flags_for_input_section.
        * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
        * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
2008-04-11  Cary Coutant  
2008-04-11  Cary Coutant  
        * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
        * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
        thought unnecessary.
        thought unnecessary.
        * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
        * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
2008-04-11  Ian Lance Taylor  
2008-04-11  Ian Lance Taylor  
        * output.h (class Output_section_data): Remove inline definition
        * output.h (class Output_section_data): Remove inline definition
        of set_addralign.
        of set_addralign.
        * output.cc (Output_section_data::set_addralign): New function.
        * output.cc (Output_section_data::set_addralign): New function.
2008-04-11  Cary Coutant  
2008-04-11  Cary Coutant  
        Add support for TLS descriptors for i386 and x86_64.
        Add support for TLS descriptors for i386 and x86_64.
        * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
        * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
        (Target_i386::Relocate::tls_desc_gd_to_le): New function.
        (Target_i386::Relocate::tls_desc_gd_to_le): New function.
        (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
        (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
        GOT_TYPE_TLS_DESC.
        GOT_TYPE_TLS_DESC.
        (Target_i386::got_mod_index_entry): Remove unnecessary code.
        (Target_i386::got_mod_index_entry): Remove unnecessary code.
        (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
        (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
        R_386_TLS_DESC_CALL relocations.  Fix problem with initial-exec
        R_386_TLS_DESC_CALL relocations.  Fix problem with initial-exec
        relocations.
        relocations.
        (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
        (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
        Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
        Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
        Fix problem with initial-exec relocations.
        Fix problem with initial-exec relocations.
        (Target_i386::Relocate::relocate_tls): Likewise.
        (Target_i386::Relocate::relocate_tls): Likewise.
        (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
        (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
        relaxation.
        relaxation.
        * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
        * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
        support for section-plus-offset dynamic table entries.
        support for section-plus-offset dynamic table entries.
        * output.h (Output_data_dynamic::add_section_plus_offset): New function.
        * output.h (Output_data_dynamic::add_section_plus_offset): New function.
        (Output_data_dynamic::Dynamic_entry): Add support for
        (Output_data_dynamic::Dynamic_entry): Add support for
        section-plus-offset dynamic table entries.
        section-plus-offset dynamic table entries.
        (Output_data_dynamic::Classification): Likewise.
        (Output_data_dynamic::Classification): Likewise.
        (Output_data_dynamic::classification_): Renamed offset_.
        (Output_data_dynamic::classification_): Renamed offset_.
        * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
        * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
        (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
        (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
        (Target_x86_64::make_plt_section): New function.
        (Target_x86_64::make_plt_section): New function.
        (Target_x86_64::reserve_tlsdesc_entries): New function.
        (Target_x86_64::reserve_tlsdesc_entries): New function.
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
        (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
        (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
        (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
        (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
        (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
        (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
        (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
        (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
        (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
        (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
        (Output_data_plt_x86_64::set_final_data_size): Move out of line;
        (Output_data_plt_x86_64::set_final_data_size): Move out of line;
        add extra PLT entry for TLS descriptors.
        add extra PLT entry for TLS descriptors.
        (Output_data_plt_x86_64::got_): New field.
        (Output_data_plt_x86_64::got_): New field.
        (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
        (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
        (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
        fields.
        fields.
        (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
        (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
        descriptors.
        descriptors.
        (Target_x86_64::make_plt_entry): Factor out make_plt_section.
        (Target_x86_64::make_plt_entry): Factor out make_plt_section.
        (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
        (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
        (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
        (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
        R_386_TLS_DESC_CALL relocations.
        R_386_TLS_DESC_CALL relocations.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::do_finalize_sections): Add dynamic table entries
        (Target_x86_64::do_finalize_sections): Add dynamic table entries
        for TLS descriptors.
        for TLS descriptors.
        (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
        (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
        Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
        Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
        (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
        (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
        GD-to-IE relaxation.
        GD-to-IE relaxation.
        * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
        * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
        and TLS_DESCRIPTORS.
        and TLS_DESCRIPTORS.
        * Makefile.in: Rebuild.
        * Makefile.in: Rebuild.
        * configure: Rebuild.
        * configure: Rebuild.
        * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
        * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
        (tls_test_shared2.so): New target.
        (tls_test_shared2.so): New target.
        (tls_shared_gd_to_ie_test_SOURCES): New variable.
        (tls_shared_gd_to_ie_test_SOURCES): New variable.
        (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
        (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
        (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
        (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
        (tls_shared_gd_to_ie_test_LDADD): New variable.
        (tls_shared_gd_to_ie_test_LDADD): New variable.
        (tls_shared_gnu2_gd_to_ie_test): New target.
        (tls_shared_gnu2_gd_to_ie_test): New target.
        (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
        (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
        New targets.
        New targets.
        (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
        (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
        (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
        (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
        (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
        (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
        (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
        (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
        (tls_shared_gnu2_test): New target.
        (tls_shared_gnu2_test): New target.
        (tls_test_gnu2_shared.so): New target.
        (tls_test_gnu2_shared.so): New target.
        (tls_shared_gnu2_test_SOURCES): New variable.
        (tls_shared_gnu2_test_SOURCES): New variable.
        (tls_shared_gnu2_test_DEPENDENCIES): New variable.
        (tls_shared_gnu2_test_DEPENDENCIES): New variable.
        (tls_shared_gnu2_test_LDFLAGS): New variable.
        (tls_shared_gnu2_test_LDFLAGS): New variable.
        (tls_shared_gnu2_test_LDADD): New variable.
        (tls_shared_gnu2_test_LDADD): New variable.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.
        * testsuite/Makefile.
2008-04-11  Ian Lance Taylor  
2008-04-11  Ian Lance Taylor  
        * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
        * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
        justsyms.t.
        justsyms.t.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
        * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
        long.
        long.
        * testsuite/script_test_2.cc (main): Adjust test.
        * testsuite/script_test_2.cc (main): Adjust test.
2008-04-11  David S. Miller  
2008-04-11  David S. Miller  
            Ian Lance Taylor  
            Ian Lance Taylor  
        * options.h (General_options): Add entries for '-Y' and
        * options.h (General_options): Add entries for '-Y' and
        '-relax'.
        '-relax'.
        * options.cc (General_options:finalize): If -Y was used, add those
        * options.cc (General_options:finalize): If -Y was used, add those
        entries to the library path instead of the default "/lib" and
        entries to the library path instead of the default "/lib" and
        "/usr/lib".
        "/usr/lib".
2008-04-11  David S. Miller  
2008-04-11  David S. Miller  
        * testsuite/justsyms.t: Start at 0x100.
        * testsuite/justsyms.t: Start at 0x100.
        * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
        * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
        * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
        * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
        long.
        long.
        * testsuite/script_test_2.cc: Adjust string and section length
        * testsuite/script_test_2.cc: Adjust string and section length
        checks.
        checks.
2008-04-09  Ian Lance Taylor  
2008-04-09  Ian Lance Taylor  
        PR gold/5996
        PR gold/5996
        * script-sections.cc (Sections_element::allocate_to_segment): Add
        * script-sections.cc (Sections_element::allocate_to_segment): Add
        orphan parameter.
        orphan parameter.
        (Output_section_definition::allocate_to_segment): Likewise.
        (Output_section_definition::allocate_to_segment): Likewise.
        (Orphan_output_section::allocate_to_segment): Likewise.
        (Orphan_output_section::allocate_to_segment): Likewise.
        (Script_sections::attach_sections_using_phdrs_clause): Don't
        (Script_sections::attach_sections_using_phdrs_clause): Don't
        propagate non-PT_LOAD segments to orphan sections.
        propagate non-PT_LOAD segments to orphan sections.
        * testsuite/Makefile.am (script_test_3.stdout): Generate using
        * testsuite/Makefile.am (script_test_3.stdout): Generate using
        readelf rather than objdump.
        readelf rather than objdump.
        * testsuite/script_test_3.sh: Adjust accordingly.  Test that
        * testsuite/script_test_3.sh: Adjust accordingly.  Test that
        .interp section and PT_INTERP segment are the same size.
        .interp section and PT_INTERP segment are the same size.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
        * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
        aliases for symbols defined in the same object.
        aliases for symbols defined in the same object.
        * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
        (weak_alias_test_SOURCES): New variable.
        (weak_alias_test_SOURCES): New variable.
        (weak_alias_test_DEPENDENCIES): New variable.
        (weak_alias_test_DEPENDENCIES): New variable.
        (weak_alias_test_LDFLAGS): New variable.
        (weak_alias_test_LDFLAGS): New variable.
        (weak_alias_test_LDADD): New variable.
        (weak_alias_test_LDADD): New variable.
        (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
        (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
        (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
        (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
        (weak_alias_test_3.o): New target.
        (weak_alias_test_3.o): New target.
        (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
        (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
        * testsuite/weak_alias_test_main.cc: New file.
        * testsuite/weak_alias_test_main.cc: New file.
        * testsuite/weak_alias_test_1.cc: New file.
        * testsuite/weak_alias_test_1.cc: New file.
        * testsuite/weak_alias_test_2.cc: New file.
        * testsuite/weak_alias_test_2.cc: New file.
        * testsuite/weak_alias_test_3.cc: New file.
        * testsuite/weak_alias_test_3.cc: New file.
2008-04-08  Ian Lance Taylor  
2008-04-08  Ian Lance Taylor  
        * options.h (class General_options): Add --noinhibit-exec option.
        * options.h (class General_options): Add --noinhibit-exec option.
        * main.cc (main): Check --noinhibit-exec.
        * main.cc (main): Check --noinhibit-exec.
        * options.h (class General_options): Define --wrap as a special
        * options.h (class General_options): Define --wrap as a special
        option.  Add wrap_symbols_ field.
        option.  Add wrap_symbols_ field.
        (General_options::any_wrap_symbols): New function.
        (General_options::any_wrap_symbols): New function.
        (General_options::is_wrap_symbol): New function.
        (General_options::is_wrap_symbol): New function.
        * options.cc (General_options::parse_wrap): New function.
        * options.cc (General_options::parse_wrap): New function.
        (General_options::General_options): Initialize wrap_symbols_.
        (General_options::General_options): Initialize wrap_symbols_.
        * symtab.cc (Symbol_table::wrap_symbol): New function.
        * symtab.cc (Symbol_table::wrap_symbol): New function.
        (Symbol_table::add_from_object): Handle --wrap.
        (Symbol_table::add_from_object): Handle --wrap.
        * symtab.h (class Symbol_table): Declare wrap_symbol.
        * symtab.h (class Symbol_table): Declare wrap_symbol.
        * target.h (Target::wrap_char): New function.
        * target.h (Target::wrap_char): New function.
        (Target::Target_info): Add wrap_char field.
        (Target::Target_info): Add wrap_char field.
        * i386.cc (Target_i386::i386_info): Initialize wrap_char.
        * i386.cc (Target_i386::i386_info): Initialize wrap_char.
        * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
        * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
        * testsuite/testfile.cc (Target_test::test_target_info):
        * testsuite/testfile.cc (Target_test::test_target_info):
        Likewise.
        Likewise.
        * errors.cc (Errors::undefined_symbol): Mention symbol version if
        * errors.cc (Errors::undefined_symbol): Mention symbol version if
        there is one.
        there is one.
        * layout.h (class Layout): Add added_eh_frame_data_ field.
        * layout.h (class Layout): Add added_eh_frame_data_ field.
        * layout.cc (Layout::Layout): Initialize new field.
        * layout.cc (Layout::Layout): Initialize new field.
        (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
        (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
        output section until we find a section we merged successfully.
        output section until we find a section we merged successfully.
        * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
        * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
        that the size be non-zero.
        that the size be non-zero.
        * merge.cc (Object_merge_map::get_output_offset): Remove inline
        * merge.cc (Object_merge_map::get_output_offset): Remove inline
        qualifier.
        qualifier.
2008-04-08  Craig Silverstein  
2008-04-08  Craig Silverstein  
        * configure.ac: Export new conditional variable HAVE_ZLIB.
        * configure.ac: Export new conditional variable HAVE_ZLIB.
        * testsuite/Makefile.am (flagstest_o_specialfile): Condition
        * testsuite/Makefile.am (flagstest_o_specialfile): Condition
        on HAVE_ZLIB.
        on HAVE_ZLIB.
        (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
        (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2008-04-07  Ian Lance Taylor  
2008-04-07  Ian Lance Taylor  
        * version.cc (version_string): Set to "1.5".
        * version.cc (version_string): Set to "1.5".
        * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
        * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
        Add issued_non_pic_error_ field.  Declare check_non_pic.
        Add issued_non_pic_error_ field.  Declare check_non_pic.
        (Target_x86_64::Scan::check_non_pic): New function.
        (Target_x86_64::Scan::check_non_pic): New function.
        (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
        (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        * output.cc (Output_reloc::local_section_offset): Add
        * output.cc (Output_reloc::local_section_offset): Add
        addend parameter.  Change caller.  Handle merge sections.
        addend parameter.  Change caller.  Handle merge sections.
        (Output_reloc::symbol_value): Change parameter type from
        (Output_reloc::symbol_value): Change parameter type from
        Address to Addend.  Don't add in the result of
        Address to Addend.  Don't add in the result of
        local_section_offset, pass down the addend and use the returned
        local_section_offset, pass down the addend and use the returned
        value.
        value.
        * output.h (class Output_reloc): Add Addend typedef.
        * output.h (class Output_reloc): Add Addend typedef.
        Update declarations of local_section_offset and symbol_value.
        Update declarations of local_section_offset and symbol_value.
        * testsuite/two_file_test_1.cc (t18): New function.
        * testsuite/two_file_test_1.cc (t18): New function.
        * testsuite/two_file_test_2.cc (f18): New function.
        * testsuite/two_file_test_2.cc (f18): New function.
        * testsuite/two_file_test_main.cc (main): Call t18.
        * testsuite/two_file_test_main.cc (main): Call t18.
        * testsuite/two_file_test.h (t18, f18): Declare.
        * testsuite/two_file_test.h (t18, f18): Declare.
        * configure.ac: Don't test for objdump, c++filt, or readelf.
        * configure.ac: Don't test for objdump, c++filt, or readelf.
        * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
        * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
        conditionals.
        conditionals.
        (TEST_READELF): New variable.
        (TEST_READELF): New variable.
        (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
        (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
        (check_PROGRAMS): Add two_file_strip_test.
        (check_PROGRAMS): Add two_file_strip_test.
        (two_file_strip_test): New target.
        (two_file_strip_test): New target.
        (check_PROGRAMS): Add two_file_same_shared_strip_test.
        (check_PROGRAMS): Add two_file_same_shared_strip_test.
        (two_file_same_shared_strip_test_SOURCES): New variable.
        (two_file_same_shared_strip_test_SOURCES): New variable.
        (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
        (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
        (two_file_same_shared_strip_test_LDFLAGS): New variable.
        (two_file_same_shared_strip_test_LDFLAGS): New variable.
        (two_file_same_shared_strip_test_LDADD): New variable.
        (two_file_same_shared_strip_test_LDADD): New variable.
        (two_file_shared_strip.so): New target.
        (two_file_shared_strip.so): New target.
        (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
        (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
        (ver_test_5.syms, ver_test_7.syms): Likewise.
        (ver_test_5.syms, ver_test_7.syms): Likewise.
        (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
        (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
        (strip_test_3.stdout): Use TEST_OBJDUMP.
        (strip_test_3.stdout): Use TEST_OBJDUMP.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2008-04-04  Cary Coutant  
2008-04-04  Cary Coutant  
        * symtab.h (Symbol::is_weak_undefined): New function.
        * symtab.h (Symbol::is_weak_undefined): New function.
        (Symbol::is_strong_undefined): New function.
        (Symbol::is_strong_undefined): New function.
        (Symbol::is_absolute): New function.
        (Symbol::is_absolute): New function.
        (Symbol::needs_plt_entry): Exclude weak undefined symbols.
        (Symbol::needs_plt_entry): Exclude weak undefined symbols.
        (Symbol::needs_dynamic_reloc): Exclude weak undefined and
        (Symbol::needs_dynamic_reloc): Exclude weak undefined and
        absolute symbols.
        absolute symbols.
        * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
        * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
        (weak_undef_test): New target.
        (weak_undef_test): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/weak_undef_file1.cc: New file.
        * testsuite/weak_undef_file1.cc: New file.
        * testsuite/weak_undef_file2.cc: New file.
        * testsuite/weak_undef_file2.cc: New file.
        * testsuite/weak_undef_test.cc: New file.
        * testsuite/weak_undef_test.cc: New file.
2008-04-03  Craig Silverstein  
2008-04-03  Craig Silverstein  
        * compressed_output.h (class Output_compressed_section): Use
        * compressed_output.h (class Output_compressed_section): Use
        unsigned buffer.
        unsigned buffer.
        * compressed_output.cc (zlib_compress): Use unsigned buffers,
        * compressed_output.cc (zlib_compress): Use unsigned buffers,
        add zlib header.
        add zlib header.
        (zlib_compressed_suffix): Removed.
        (zlib_compressed_suffix): Removed.
        (Output_compressed_section::set_final_data_size): Use unsigned
        (Output_compressed_section::set_final_data_size): Use unsigned
        buffers.
        buffers.
        * testsuite/Makefile.am (flagstest_compress_debug_sections):
        * testsuite/Makefile.am (flagstest_compress_debug_sections):
        Fix linker invocation.
        Fix linker invocation.
        (flagstest_o_specialfile_and_compress_debug_sections):
        (flagstest_o_specialfile_and_compress_debug_sections):
        Likewise.
        Likewise.
        * testsuite/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.
2008-04-02  David S. Miller  
2008-04-02  David S. Miller  
        *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
        *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
        Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
        Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
2008-04-02  Craig Silverstein  
2008-04-02  Craig Silverstein  
        * TODO: New file.
        * TODO: New file.
2008-04-02  Ian Lance Taylor  
2008-04-02  Ian Lance Taylor  
        * fileread.cc (File_read::find_view): Add byteshift and vshifted
        * fileread.cc (File_read::find_view): Add byteshift and vshifted
        parameters.  Update for new key type to views_.  Change all
        parameters.  Update for new key type to views_.  Change all
        callers.
        callers.
        (File_read::read): Adjust for byteshift in returned view.
        (File_read::read): Adjust for byteshift in returned view.
        (File_read::add_view): New function, broken out of
        (File_read::add_view): New function, broken out of
        find_and_make_view.
        find_and_make_view.
        (File_read::make_view): New function, broken out of
        (File_read::make_view): New function, broken out of
        find_and_make_view.
        find_and_make_view.
        (File_read::find_or_make_view): Add offset and aligned
        (File_read::find_or_make_view): Add offset and aligned
        parameters.  Rewrite accordingly.  Change all callers.
        parameters.  Rewrite accordingly.  Change all callers.
        (File_read::get_view): Add offset and aligned parameters.  Adjust
        (File_read::get_view): Add offset and aligned parameters.  Adjust
        for byteshift in return value.
        for byteshift in return value.
        (File_read::get_lasting_view): Likewise.
        (File_read::get_lasting_view): Likewise.
        * fileread.h (class File_read): Update declarations.
        * fileread.h (class File_read): Update declarations.
        (class File_read::View): Add byteshift_ field.  Add byteshift to
        (class File_read::View): Add byteshift_ field.  Add byteshift to
        constructor.  Add byteshift method.
        constructor.  Add byteshift method.
        * archive.h (Archive::clear_uncached_views): New function.
        * archive.h (Archive::clear_uncached_views): New function.
        (Archive::get_view): Add aligned parameter.  Change all callers.
        (Archive::get_view): Add aligned parameter.  Change all callers.
        * object.h (Object::get_view): Add aligned parameter.  Change all
        * object.h (Object::get_view): Add aligned parameter.  Change all
        callers.
        callers.
        (Object::get_lasting_view): Likewise.
        (Object::get_lasting_view): Likewise.
        * fileread.cc (File_read::release): Don't call clear_views if
        * fileread.cc (File_read::release): Don't call clear_views if
        there are multiple objects.
        there are multiple objects.
        * fileread.h (File_read::clear_uncached_views): New function.
        * fileread.h (File_read::clear_uncached_views): New function.
        * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
        * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
        on the archive.
        on the archive.
2008-03-31  Cary Coutant  
2008-03-31  Cary Coutant  
        Add thin archive support.
        Add thin archive support.
        * archive.cc (Archive::armagt): New const.
        * archive.cc (Archive::armagt): New const.
        (Archive::setup): Remove task parameter and calls to unlock.
        (Archive::setup): Remove task parameter and calls to unlock.
        (Archive::unlock_nested_archives): New function.
        (Archive::unlock_nested_archives): New function.
        (Archive::read_header): Add nested_off parameter. Change
        (Archive::read_header): Add nested_off parameter. Change
        all callers.
        all callers.
        (Archive::interpret_header): Likewise.
        (Archive::interpret_header): Likewise.
        (Archive::include_all_members): Change to handle thin
        (Archive::include_all_members): Change to handle thin
        archives.
        archives.
        (Archive::include_member): Likewise.
        (Archive::include_member): Likewise.
        * archive.h (Archive::Archive): Add new parameters and
        * archive.h (Archive::Archive): Add new parameters and
        initializers.
        initializers.
        (Archive::armagt): New const.
        (Archive::armagt): New const.
        (Archive::setup): Remove task parameter.
        (Archive::setup): Remove task parameter.
        (Archive::unlock_nested_archives): New function.
        (Archive::unlock_nested_archives): New function.
        (Archive::read_header): Add nested_off parameter.
        (Archive::read_header): Add nested_off parameter.
        (Archive::interpret_header): Likewise.
        (Archive::interpret_header): Likewise.
        (Archive::Nested_archive_table): New typedef.
        (Archive::Nested_archive_table): New typedef.
        (Archive::is_thin_archive_): New field.
        (Archive::is_thin_archive_): New field.
        (Archive::nested_archives_): New field.
        (Archive::nested_archives_): New field.
        (Archive::options_): New field.
        (Archive::options_): New field.
        (Archive::dirpath_): New field.
        (Archive::dirpath_): New field.
        (Archive::task_): New field.
        (Archive::task_): New field.
        * readsyms.cc (Read_symbols::do_read_symbols): Add check
        * readsyms.cc (Read_symbols::do_read_symbols): Add check
        for thin archives.  Pass additional parameters to
        for thin archives.  Pass additional parameters to
        Archive::Archive.  Unlock the archive file after calling
        Archive::Archive.  Unlock the archive file after calling
        Archive::setup.
        Archive::setup.
2008-03-29  Ian Lance Taylor  
2008-03-29  Ian Lance Taylor  
        * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
        * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
        version symbol to be local.
        version symbol to be local.
        * testsuite/ver_test_4.sh: New file.
        * testsuite/ver_test_4.sh: New file.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
        * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
        (check_DATA): Add ver_test_4.syms.
        (check_DATA): Add ver_test_4.syms.
        (ver_test_4.syms): New target.
        (ver_test_4.syms): New target.
        * testsuite/Makefile.in: Rebuild.
        * testsuite/Makefile.in: Rebuild.
        * output.cc
        * output.cc
        (Output_section::Input_section_sort_entry::has_priority): New
        (Output_section::Input_section_sort_entry::has_priority): New
        function.
        function.
        (Output_section::Input_section_sort_entry::match_file_name): New
        (Output_section::Input_section_sort_entry::match_file_name): New
        function.
        function.
        (Output_section::Input_section_sort_entry::match_section_name):
        (Output_section::Input_section_sort_entry::match_section_name):
        Remove.
        Remove.
        (Output_section::Input_section_sort_entry::match_section_name_prefix):
        (Output_section::Input_section_sort_entry::match_section_name_prefix):
        Remove.
        Remove.
        (Output_section::Input_section_sort_entry::match_section_file):
        (Output_section::Input_section_sort_entry::match_section_file):
        Remove.
        Remove.
        (Output_section::Input_section_sort_compare::operator()): Rewrite
        (Output_section::Input_section_sort_compare::operator()): Rewrite
        using new Input_section_sort_entry functions.  Sort crtbegin and
        using new Input_section_sort_entry functions.  Sort crtbegin and
        crtend first.  Sort sections with no priority before sections with
        crtend first.  Sort sections with no priority before sections with
        a priority.
        a priority.
        * testsuite/initpri1.c (d3): Check j != 4.
        * testsuite/initpri1.c (d3): Check j != 4.
        (cd5): New constructor/destructor function.
        (cd5): New constructor/destructor function.
        (main): Check j != 2.
        (main): Check j != 2.
        * symtab.cc (Symbol_table::add_from_object): If we don't use the
        * symtab.cc (Symbol_table::add_from_object): If we don't use the
        new symbol when resolving, don't call set_is_default.
        new symbol when resolving, don't call set_is_default.
        * testsuite/ver_test_7.cc: New file.
        * testsuite/ver_test_7.cc: New file.
        * testsuite/ver_test_7.sh: New file.
        * testsuite/ver_test_7.sh: New file.
        * testsuite/Makefile.am (ver_test_7.so): New target.
        * testsuite/Makefile.am (ver_test_7.so): New target.
        (ver_test_7.o): New target.
        (ver_test_7.o): New target.
        (check_SCRIPTS): Add ver_test_7.sh.
        (check_SCRIPTS): Add ver_test_7.sh.
        (check_DATA): Add ver_test_7.syms.
        (check_DATA): Add ver_test_7.syms.
        (ver_test_7.syms): New target.
        (ver_test_7.syms): New target.
2008-03-28  Ian Lance Taylor  
2008-03-28  Ian Lance Taylor  
        * layout.cc (Layout::layout): If we see an input section with a
        * layout.cc (Layout::layout): If we see an input section with a
        name that needs sorting, set the must_sort flag for the output
        name that needs sorting, set the must_sort flag for the output
        section.
        section.
        (Layout::make_output_section): If the name of the output section
        (Layout::make_output_section): If the name of the output section
        indicates that it might require sorting, set the may_sort flag.
        indicates that it might require sorting, set the may_sort flag.
        * output.h (Output_section::may_sort_attached_input_sections): New
        * output.h (Output_section::may_sort_attached_input_sections): New
        function.
        function.
        (Output_section::set_may_sort_attached_input_sections): New
        (Output_section::set_may_sort_attached_input_sections): New
        function.
        function.
        (Output_section::must_sort_attached_input_sections): New
        (Output_section::must_sort_attached_input_sections): New
        function.
        function.
        (Output_section::set_must_sort_attached_input_sections): New
        (Output_section::set_must_sort_attached_input_sections): New
        function.
        function.
        (class Output_section): Declare Input_section_sort_entry.  Define
        (class Output_section): Declare Input_section_sort_entry.  Define
        Input_section_sort_compare.  Declare
        Input_section_sort_compare.  Declare
        sort_attached_input_sections.  Add new fields:
        sort_attached_input_sections.  Add new fields:
        may_sort_attached_input_sections_,
        may_sort_attached_input_sections_,
        must_sort_attached_input_sections_,
        must_sort_attached_input_sections_,
        attached_input_sections_are_sorted_.
        attached_input_sections_are_sorted_.
        * output.cc (Output_section::Output_section): Initialize new
        * output.cc (Output_section::Output_section): Initialize new
        fields.
        fields.
        (Output_section::add_input_section): Add an entry to
        (Output_section::add_input_section): Add an entry to
        input_sections_ if may_sort or must_sort are true.
        input_sections_ if may_sort or must_sort are true.
        (Output_section::set_final_data_size): Call
        (Output_section::set_final_data_size): Call
        sort_attached_input_sections if necessary.
        sort_attached_input_sections if necessary.
        (Output_section::Input_section_sort_entry): Define new class.
        (Output_section::Input_section_sort_entry): Define new class.
        (Output_section::Input_section_sort_compare::operator()): New
        (Output_section::Input_section_sort_compare::operator()): New
        function.
        function.
        (Output_section::sort_attached_input_sections): New function.
        (Output_section::sort_attached_input_sections): New function.
        * configure.ac: Check whether the compiler supports constructor
        * configure.ac: Check whether the compiler supports constructor
        priorities.  Define a CONSTRUCTOR_PRIORITY automake conditional.
        priorities.  Define a CONSTRUCTOR_PRIORITY automake conditional.
        * testsuite/initpri1.c: New file.
        * testsuite/initpri1.c: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
        * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
        CONSTRUCTOR_PRIORITY.
        CONSTRUCTOR_PRIORITY.
        (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
        (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
        (initpri1_LDFLAGS): New variable.
        (initpri1_LDFLAGS): New variable.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
        * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2008-03-27  Ian Lance Taylor  
2008-03-27  Ian Lance Taylor  
        * common.cc (Sort_commons::operator): Correct sorting algorithm.
        * common.cc (Sort_commons::operator): Correct sorting algorithm.
        * testsuite/common_test_1.c: New file.
        * testsuite/common_test_1.c: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
        * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
        (common_test_1_SOURCES): New variable.
        (common_test_1_SOURCES): New variable.
        (common_test_1_DEPENDENCIES): New variable.
        (common_test_1_DEPENDENCIES): New variable.
        (common_test_1_LDFLAGS): New variable.
        (common_test_1_LDFLAGS): New variable.
        * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
        * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
        and commons_ correctly when NAME/VERSION does not override
        and commons_ correctly when NAME/VERSION does not override
        NAME/NULL.
        NAME/NULL.
        * testsuite/ver_test_6.c: New file.
        * testsuite/ver_test_6.c: New file.
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
        * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
        (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
        (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
        (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
        (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
2008-03-26  Ian Lance Taylor  
2008-03-26  Ian Lance Taylor  
        * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
        * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
        of an undefined symbol from a version script.
        of an undefined symbol from a version script.
        * testsuite/Makefile.am (ver_test_5.so): New target.
        * testsuite/Makefile.am (ver_test_5.so): New target.
        (ver_test_5.o): New target.
        (ver_test_5.o): New target.
        (check_SCRIPTS): Add ver_test_5.sh.
        (check_SCRIPTS): Add ver_test_5.sh.
        (check_DATA): Add ver_test_5.syms.
        (check_DATA): Add ver_test_5.syms.
        (ver_test_5.syms): New target.
        (ver_test_5.syms): New target.
        * testsuite/ver_test_5.cc: New file.
        * testsuite/ver_test_5.cc: New file.
        * testsuite/ver_test_5.script: New file.
        * testsuite/ver_test_5.script: New file.
        * testsuite/ver_test_5.sh: New file.
        * testsuite/ver_test_5.sh: New file.
        * Makefile.in, testsuite/Makefile.in: Rebuild.
        * Makefile.in, testsuite/Makefile.in: Rebuild.
        PR gold/5986
        PR gold/5986
        Fix problems building gold with gcc 4.3.0.
        Fix problems building gold with gcc 4.3.0.
        * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
        * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
        (gold_error_at_location, gold_warning_at_location): Use it.
        (gold_error_at_location, gold_warning_at_location): Use it.
        * configure.ac: Check whether we can compile and use a template
        * configure.ac: Check whether we can compile and use a template
        function with a printf attribute.
        function with a printf attribute.
        * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
        * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
        when jumping over bytes.
        when jumping over bytes.
        * object.cc: Instantiate Object::read_section_data.
        * object.cc: Instantiate Object::read_section_data.
        * debug.h: Include 
        * debug.h: Include 
        * dwarf_reader.cc: Include 
        * dwarf_reader.cc: Include 
        * main.cc: Include .
        * main.cc: Include .
        * options.cc: Include .
        * options.cc: Include .
        * output.cc: Include .
        * output.cc: Include .
        * script.cc: Include .
        * script.cc: Include .
        * script.h: Include .
        * script.h: Include .
        * symtab.cc: Include  and .
        * symtab.cc: Include  and .
        * target-select.cc: Include .
        * target-select.cc: Include .
        * version.cc: Include .
        * version.cc: Include .
        * testsuite/testmain.cc: Include .
        * testsuite/testmain.cc: Include .
        * configure, config.in: Rebuild.
        * configure, config.in: Rebuild.
2008-03-25  Ian Lance Taylor  
2008-03-25  Ian Lance Taylor  
        * options.cc: Include "../bfd/bfdver.h".
        * options.cc: Include "../bfd/bfdver.h".
        (options::help): Print bug reporting address.
        (options::help): Print bug reporting address.
        * version.cc (print_version): Adjust output for current value of
        * version.cc (print_version): Adjust output for current value of
        BFD_VERSION_STRING.
        BFD_VERSION_STRING.
        * NEWS: New file.
        * NEWS: New file.
        * options.cc (options::help): Print list of supported targets.
        * options.cc (options::help): Print list of supported targets.
        * target-select.h: Include .
        * target-select.h: Include .
        (class Target_selector): Make machine_, size_, and is_big_endian_
        (class Target_selector): Make machine_, size_, and is_big_endian_
        fields const.  Add bfd_name_ and instantiated_target_ fields.
        fields const.  Add bfd_name_ and instantiated_target_ fields.
        (Target_selector::Target_selector): Add bfd_name parameter.
        (Target_selector::Target_selector): Add bfd_name parameter.
        (Target_selector::recognize): Make non-virtual, call
        (Target_selector::recognize): Make non-virtual, call
        do_recognize.
        do_recognize.
        (Target_selector::recognize_by_name): Make non-virtual, call
        (Target_selector::recognize_by_name): Make non-virtual, call
        do_recognize_by_name.
        do_recognize_by_name.
        (Target_selector::supported_names): New function.
        (Target_selector::supported_names): New function.
        (Target_selector::bfd_name): New function.
        (Target_selector::bfd_name): New function.
        (Target_selector::do_instantiate_target): New pure virtual
        (Target_selector::do_instantiate_target): New pure virtual
        function.
        function.
        (Target_selector::do_recognize): New virtual function.
        (Target_selector::do_recognize): New virtual function.
        (Target_selector::do_recognize_by_name): New virtual function.
        (Target_selector::do_recognize_by_name): New virtual function.
        (Target_selector::instantiate_target): New private function.
        (Target_selector::instantiate_target): New private function.
        (supported_target_names): Declare.
        (supported_target_names): Declare.
        * target-select.cc (Target_selector::Target_selector): Update for
        * target-select.cc (Target_selector::Target_selector): Update for
        new parameter and fields.
        new parameter and fields.
        (select_target_by_name): Check that the name matches before
        (select_target_by_name): Check that the name matches before
        calling recognize_by_name.
        calling recognize_by_name.
        (supported_target_names): New function.
        (supported_target_names): New function.
        * i386.cc (class Target_selector_i386): Update Target_selector
        * i386.cc (class Target_selector_i386): Update Target_selector
        constructor call.  Remove recognize and recognize_by_name.  Add
        constructor call.  Remove recognize and recognize_by_name.  Add
        do_instantiate_target.
        do_instantiate_target.
        * x86_64.cc (class Target_selector_x86_64): Likewise.
        * x86_64.cc (class Target_selector_x86_64): Likewise.
        * testsuite/testfile.cc (class Target_selector_test): Update for
        * testsuite/testfile.cc (class Target_selector_test): Update for
        changes to Target_selector.
        changes to Target_selector.
        * README: Rewrite, with some notes on unsupported features.
        * README: Rewrite, with some notes on unsupported features.
2008-03-24  Cary Coutant  
2008-03-24  Cary Coutant  
        * i386.cc (Target_i386::Got_type): New enum declaration.
        * i386.cc (Target_i386::Got_type): New enum declaration.
        (Target_i386::Scan::local): Updated callers of Output_data_got
        (Target_i386::Scan::local): Updated callers of Output_data_got
        member functions.
        member functions.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Scan::global): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::relocate): Likewise.
        (Target_i386::Relocate::relocate_tls): Likewise.
        (Target_i386::Relocate::relocate_tls): Likewise.
        * object.h (Got_offset_list): New class.
        * object.h (Got_offset_list): New class.
        (Sized_relobj::local_has_got_offset): Added got_type parameter.
        (Sized_relobj::local_has_got_offset): Added got_type parameter.
        (Sized_relobj::local_got_offset): Likewise.
        (Sized_relobj::local_got_offset): Likewise.
        (Sized_relobj::set_local_got_offset): Likewise.
        (Sized_relobj::set_local_got_offset): Likewise.
        (Sized_relobj::local_has_tls_got_offset): Removed.
        (Sized_relobj::local_has_tls_got_offset): Removed.
        (Sized_relobj::local_tls_got_offset): Removed.
        (Sized_relobj::local_tls_got_offset): Removed.
        (Sized_relobj::set_local_tls_got_offset): Removed.
        (Sized_relobj::set_local_tls_got_offset): Removed.
        (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
        (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
        * output.cc (Output_data_got::add_global): Added got_type parameter.
        * output.cc (Output_data_got::add_global): Added got_type parameter.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_pair_with_rel): New function.
        (Output_data_got::add_global_pair_with_rel): New function.
        (Output_data_got::add_global_pair_with_rela): New function.
        (Output_data_got::add_global_pair_with_rela): New function.
        (Output_data_got::add_local): Added got_type parameter.
        (Output_data_got::add_local): Added got_type parameter.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_pair_with_rel): New function.
        (Output_data_got::add_local_pair_with_rel): New function.
        (Output_data_got::add_local_pair_with_rela): New function.
        (Output_data_got::add_local_pair_with_rela): New function.
        (Output_data_got::add_global_tls): Removed.
        (Output_data_got::add_global_tls): Removed.
        (Output_data_got::add_global_tls_with_rel): Removed.
        (Output_data_got::add_global_tls_with_rel): Removed.
        (Output_data_got::add_global_tls_with_rela): Removed.
        (Output_data_got::add_global_tls_with_rela): Removed.
        (Output_data_got::add_local_tls): Removed.
        (Output_data_got::add_local_tls): Removed.
        (Output_data_got::add_local_tls_with_rel): Removed.
        (Output_data_got::add_local_tls_with_rel): Removed.
        (Output_data_got::add_local_tls_with_rela): Removed.
        (Output_data_got::add_local_tls_with_rela): Removed.
        * output.h (Output_data_got::add_global): Added got_type parameter.
        * output.h (Output_data_got::add_global): Added got_type parameter.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rel): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_with_rela): Likewise.
        (Output_data_got::add_global_pair_with_rel): New function.
        (Output_data_got::add_global_pair_with_rel): New function.
        (Output_data_got::add_global_pair_with_rela): New function.
        (Output_data_got::add_global_pair_with_rela): New function.
        (Output_data_got::add_local): Added got_type parameter.
        (Output_data_got::add_local): Added got_type parameter.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rel): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_with_rela): Likewise.
        (Output_data_got::add_local_pair_with_rel): New function.
        (Output_data_got::add_local_pair_with_rel): New function.
        (Output_data_got::add_local_pair_with_rela): New function.
        (Output_data_got::add_local_pair_with_rela): New function.
        (Output_data_got::add_global_tls): Removed.
        (Output_data_got::add_global_tls): Removed.
        (Output_data_got::add_global_tls_with_rel): Removed.
        (Output_data_got::add_global_tls_with_rel): Removed.
        (Output_data_got::add_global_tls_with_rela): Removed.
        (Output_data_got::add_global_tls_with_rela): Removed.
        (Output_data_got::add_local_tls): Removed.
        (Output_data_got::add_local_tls): Removed.
        (Output_data_got::add_local_tls_with_rel): Removed.
        (Output_data_got::add_local_tls_with_rel): Removed.
        (Output_data_got::add_local_tls_with_rela): Removed.
        (Output_data_got::add_local_tls_with_rela): Removed.
        * resolve.cc (Symbol::override_base_with_special): Removed
        * resolve.cc (Symbol::override_base_with_special): Removed
        reference to has_got_offset_ field.
        reference to has_got_offset_ field.
        * symtab.cc (Symbol::init_fields): Replaced initialization
        * symtab.cc (Symbol::init_fields): Replaced initialization
        of got_offset_ with got_offsets_.  Removed initialization
        of got_offset_ with got_offsets_.  Removed initialization
        of has_got_offset_
        of has_got_offset_
        * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
        * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
        (Symbol::got_offset): Likewise.
        (Symbol::got_offset): Likewise.
        (Symbol::set_got_offset): Likewise.
        (Symbol::set_got_offset): Likewise.
        (Symbol::has_tls_got_offset): Removed.
        (Symbol::has_tls_got_offset): Removed.
        (Symbol::tls_got_offset): Removed.
        (Symbol::tls_got_offset): Removed.
        (Symbol::set_tls_got_offset): Removed.
        (Symbol::set_tls_got_offset): Removed.
        (Symbol::got_offset_): Removed.
        (Symbol::got_offset_): Removed.
        (Symbol::tls_mod_got_offset_): Removed.
        (Symbol::tls_mod_got_offset_): Removed.
        (Symbol::tls_pair_got_offset_): Removed.
        (Symbol::tls_pair_got_offset_): Removed.
        (Symbol::got_offsets_): New field.
        (Symbol::got_offsets_): New field.
        (Symbol::has_got_offset): Removed.
        (Symbol::has_got_offset): Removed.
        (Symbol::has_tls_mod_got_offset): Removed.
        (Symbol::has_tls_mod_got_offset): Removed.
        (Symbol::has_tls_pair_got_offset): Removed.
        (Symbol::has_tls_pair_got_offset): Removed.
        * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
        * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
        (Target_x86_64::Scan::local): Updated callers of Output_data_got
        (Target_x86_64::Scan::local): Updated callers of Output_data_got
        member functions.
        member functions.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Scan::global): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocate::relocate): Likewise.
        (Target_x86_64::Relocate::relocate_tls): Likewise.
        (Target_x86_64::Relocate::relocate_tls): Likewise.
2008-03-25  Ben Elliston  
2008-03-25  Ben Elliston  
        * yyscript.y: Fix spelling error in comment.
        * yyscript.y: Fix spelling error in comment.
2008-03-24  Ian Lance Taylor  
2008-03-24  Ian Lance Taylor  
        * options.h (class General_options): Define build_id option.
        * options.h (class General_options): Define build_id option.
        * layout.h (class Layout): Declare write_build_id, create_note,
        * layout.h (class Layout): Declare write_build_id, create_note,
        create_build_id.  Add build_id_note_ member.
        create_build_id.  Add build_id_note_ member.
        * layout.cc: Include , , ,
        * layout.cc: Include , , ,
        "libiberty.h", "md5.h", "sha1.h".
        "libiberty.h", "md5.h", "sha1.h".
        (Layout::Layout): Initialize eh_frame_data_,
        (Layout::Layout): Initialize eh_frame_data_,
        eh_frame_hdr_section_, and build_id_note_.
        eh_frame_hdr_section_, and build_id_note_.
        (Layout::finalize): Call create_build_id.
        (Layout::finalize): Call create_build_id.
        (Layout::create_note): New function, broken out of
        (Layout::create_note): New function, broken out of
        Layout::create_gold_note.
        Layout::create_gold_note.
        (Layout::create_gold_note): Call create_note.
        (Layout::create_gold_note): Call create_note.
        (Layout::create_build_id): New function.
        (Layout::create_build_id): New function.
        (Layout::write_build_id): New function.
        (Layout::write_build_id): New function.
        (Close_task_runner::run): Call write_build_id.
        (Close_task_runner::run): Call write_build_id.
        * x86_64.cc: Correct license to GPLv3.
        * x86_64.cc: Correct license to GPLv3.
2008-03-23  Ian Lance Taylor  
2008-03-23  Ian Lance Taylor  
        * options.cc: Include "demangle.h".
        * options.cc: Include "demangle.h".
        (parse_optional_string): New function.
        (parse_optional_string): New function.
        (parse_long_option): Handle takes_optional_argument.
        (parse_long_option): Handle takes_optional_argument.
        (parse_short_option): Update dash_z initializer.  Handle
        (parse_short_option): Update dash_z initializer.  Handle
        takes_optional_argument.
        takes_optional_argument.
        (General_options::General_options): Initialize do_demangle_.
        (General_options::General_options): Initialize do_demangle_.
        (General_options::finalize): Set do_demangle_.  Handle demangling
        (General_options::finalize): Set do_demangle_.  Handle demangling
        style.
        style.
        * options.h (parse_optional_string): Declare.
        * options.h (parse_optional_string): Declare.
        (struct One_option): Add optional_arg field.  Update constructor.
        (struct One_option): Add optional_arg field.  Update constructor.
        Update call constructor calls.  Add takes_optional_argument
        Update call constructor calls.  Add takes_optional_argument
        function.
        function.
        (DEFINE_var): Add optional_arg__ parameter.  Change all callers.
        (DEFINE_var): Add optional_arg__ parameter.  Change all callers.
        (DEFINE_optional_string): Define.
        (DEFINE_optional_string): Define.
        (General_options::demangle): Change from DEFINE_bool to
        (General_options::demangle): Change from DEFINE_bool to
        DEFINE_optional_string.
        DEFINE_optional_string.
        (General_options::no_demangle): New function.
        (General_options::no_demangle): New function.
        (General_options::do_demangle): New function.
        (General_options::do_demangle): New function.
        (General_options::set_do_demangle): New function.
        (General_options::set_do_demangle): New function.
        (General_options::execstack_status_): Move definition to end of
        (General_options::execstack_status_): Move definition to end of
        class definition.
        class definition.
        (General_options::static_): Likewise.
        (General_options::static_): Likewise.
        (General_options::do_demangle_): New field.
        (General_options::do_demangle_): New field.
        * object.cc (big_endian>::get_symbol_location_info): Call
        * object.cc (big_endian>::get_symbol_location_info): Call
        Options::do_demangle, not Options::demangle.
        Options::do_demangle, not Options::demangle.
        * symtab.cc (demangle): Likewise.
        * symtab.cc (demangle): Likewise.
2008-03-22  Ian Lance Taylor  
2008-03-22  Ian Lance Taylor  
        * gold.h: Include  and 
        * gold.h: Include  and 
        * options.h: Include .
        * options.h: Include .
2008-03-21  Ian Lance Taylor  
2008-03-21  Ian Lance Taylor  
        * Added source code to GNU binutils.
        * Added source code to GNU binutils.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.