PR gold/12629
[external/binutils.git] / gold / ChangeLog
index 2626867..62ee3ca 100644 (file)
@@ -1,3 +1,420 @@
+2011-06-29  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12629
+       * object.cc (Sized_relobj_file::layout_section): Change shdr
+       parameter to be const.
+       (Sized_relobj_file::layout_eh_frame_section): New function, broken
+       out of do_layout.
+       (Sized_relobj_file::do_layout): Defer .eh_frame sections if
+       appropriate.  Call layout_eh_frame_section.
+       (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
+       sections.
+       * object.h (class Sized_relobj_file): Update declarations.
+
+2011-06-29  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12652
+       * script.cc (Token::integer_value): Accept trailing M/m/K/k
+       modifier.
+       (Lex::gather_token): Accept trailing M/m/K/k for integers.
+
+2011-06-29  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12675
+       * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
+       SHT_X86_64_UNWIND.
+       * layout.cc (Layout::layout_eh_frame): Likewise.
+
+2011-06-29  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12695
+       * layout.cc (Layout::symtab_section_shndx): New function.
+       * layout.h (class Layout): Declare symtab_section_shndx.
+       * output.cc (Output_section::write_header): Call it.
+
+2011-06-29  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12818
+       * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
+       symbols which are not used in a relocation.
+
+2011-06-28  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12898
+       * layout.cc (Layout::segment_precedes): Don't crash if a linker
+       script create indistinguishable segments.
+       (Layout::set_segment_offsets): Use stable_sort when sorting
+       segments.  Pass this to Compare_segments constructor.
+       * layout.h (class Layout): Make segment_precedes non-static.
+       (class Compare_segments): Change from struct to class.  Add
+       layout_ field.  Add constructor.
+       * script-sections.cc
+       (Script_sections::attach_sections_using_phdrs_clause): Rename
+       local orphan to is_orphan.  Don't report failure to put empty
+       section in segment.  On attachment failure, report name of
+       section, and attach to first PT_LOAD segment.
+
+2011-06-28  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12934
+       * target-select.cc (Target_selector::Target_selector): Add
+       emulation parameter.  Change all callers.
+       (select_target_by_bfd_name): Rename from select_target_by_name.
+       Change all callers.
+       (select_target_by_emulation): New function.
+       (supported_emulation_names): New function.
+       * target-select.h (class Target_selector): Add emulation_ field.
+       Update declarations.
+       (Target_selector::recognize_by_bfd_name): Rename from
+       recognize_by_name.  Change all callers.
+       (Target_selector::supported_bfd_names): Rename from
+       supported_names.  Change all callers.
+       (Target_selector::recognize_by_emulation): New function.
+       (Target_selector::supported_emulations): New function.
+       (Target_selector::emulation): New function.
+       (Target_selector::do_recognize_by_bfd_name): Rename from
+       do_recognize_by_name.  Change all callers.
+       (Target_selector::do_supported_bfd_names): Rename from
+       do_supported_names.  Change all callers.
+       (Target_selector::do_recognize_by_emulation): New function.
+       (Target_selector::do_supported_emulations): New function.
+       (select_target_by_bfd_name): Change name in declaration.
+       (select_target_by_emulation): Declare.
+       (supported_emulation_names): Declare.
+       * parameters.cc (parameters_force_valid_target): Try to find
+       target based on emulation from -m option.
+       * options.h (class General_options): Change doc string for -m.
+       * options.cc (help): Print emulations.
+       (General_options::parse_V): Likewise.
+       * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
+       Add emulation parameter.  Change all callers.
+
+2011-06-28  Ian Lance Taylor  <iant@google.com>
+
+       * target.h (class Target): Add osabi_ field.
+       (Target::osabi): New function.
+       (Target::set_osabi): New function.
+       (Target::Target): Initialize osabi_.
+       (Target::do_adjust_elf_header): Make pure virtual.
+       (Sized_target::do_adjust_elf_header): Declare.
+       * target.cc (Sized_target::do_adjust_elf_header): New function.
+       (class Sized_target): Instantiate all versions.
+       * freebsd.h (class Target_freebsd): Remove.
+       (Target_selector_freebsd::do_recognize): Call set_osabi on
+       Target.
+       (Target_selector_freebsd::do_recognize_by_name): Likewise.
+       (Target_selector_freebsd::set_osabi): Remove.
+       * i386.cc (class Target_i386): Inherit from Sized_target rather
+       than Target_freebsd.
+       * x86_64.cc (class Target_x86_64): Likewise.
+
+2011-06-28  Ian Lance Taylor  <iant@google.com>
+
+       * target.h (Target::can_check_for_function_pointers): Rewrite.
+       Make non-virtual.
+       (Target::can_icf_inline_merge_sections): Likewise.
+       (Target::section_may_have_icf_unsafe_poineters): Likewise.
+       (Target::Target_info): Add can_icf_inline_merge_sections field.
+       (Target::do_can_check_for_function_pointers): New virtual
+       function.
+       (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
+       * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
+       from can_check_for_function_pointers, move in file.
+       (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
+       section_may_have_icf_unsafe_poineters, move in file.
+       (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
+       * i386.cc (Target_i386::do_can_check_for_function_pointers):
+       Rename from can_check_for_function_pointers, move in file.
+       (Target_i386::can_icf_inline_merge_sections): Remove.
+       (Target_i386::i386_info): Initialize
+       can_icf_inline_merge_sections.
+       * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
+       Initialize can_icf_inline_merge_sections.
+       * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
+       * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
+       Rename from can_check_for_function_pointers, move in file.
+       (Target_x86_64::can_icf_inline_merge_sections): Remove.
+       (Target_x86_64::x86_64_info): Initialize
+       can_icf_inline_merge_sections.
+       * testsuite/testfile.cc (Target_test::test_target_info):
+       Likewise.
+       * icf.cc (get_section_contents): Correct formatting.
+
+2011-06-27  Ian Lance Taylor  <iant@google.com>
+
+       * symtab.cc (Symbol::versioned_name): New function.
+       (Symbol_table::add_to_final_symtab): Use versioned_name when
+       appropriate.
+       (Symbol_table::sized_write_symbol): Likewise.
+       * symtab.h (class Symbol): Declare versioned_name.
+       * stringpool.h (class Stringpool_template): Add variant of add
+       which takes a std::basic_string.
+       * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
+       (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
+       (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
+       (ver_test_12.o): New target.
+       * testsuite/Makefile.in: Rebuild.
+
+2011-06-27  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Arm_relocate_functions::thm_jump8,
+       Arm_relocate_functions::thm_jump11): Use a wider signed
+       type to compute offset.
+       * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
+       arm_thm_jump8.
+       * testsuite/Makefile.in: Regenerate.
+       * testsuite/arm_branch_in_range.sh: Check test results of
+       arm_thm_jump11 and arm_thm_jump8.
+       * testsuite/arm_thm_jump11.s: New test source file.
+       * testsuite/arm_thm_jump11.t: New linker script.
+       * testsuite/arm_thm_jump8.s: New test source file.
+       * testsuite/arm_thm_jump8.t: New linker script.
+
+2011-06-24  Ian Lance Taylor  <iant@google.com>
+
+       * layout.cc: Include "object.h".
+       (ctors_sections_in_init_array): New static variable.
+       (Layout::is_ctors_in_init_array): New function.
+       (Layout::layout): Add entry to ctors_sections_in_init_array if
+       appropriate.
+       * layout.h (class Layout): Declare is_ctors_in_init_array.
+       * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
+       is_ctors_reverse_view is set.
+       (Sized_relobj_file::write_sections): Add layout parameter.  Change
+       all callers.  Set is_ctors_reverse_view field of View_size.
+       (Sized_relobj_file::reverse_words): New function.
+       * object.h (Sized_relobj_file::View_size): Add
+       is_ctors_reverse_view field.
+       (class Sized_relobj_file): Update declarations.
+       * testsuite/initpri3.c: New test.
+       * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
+       initpri3b.
+       (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
+       (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
+       (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
+       (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
+       * testsuite/Makefile.in: Rebuild.
+
+2011-06-24  Cary Coutant  <ccoutant@google.com>
+
+       * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
+       (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
+       (debug_msg_cdebug.err): New targets.
+       * testsuite/Makefile.in: Regenerate.
+       * testsuite/debug_msg.sh: Check output of link with compressed debug.
+       Fix checks for link with shared library.
+
+2011-06-24  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
+       skip empty text sections.
+       * testsuite/arm_exidx_test.s: Test handling of an empty text section.
+
+2011-06-22  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12910
+       * options.h (class General_options): Add --ctors-in-init-array.
+       * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
+       friends as SHT_PROGBITS for merging sections.
+       (Layout::layout): Remove special handling of .init_array and
+       friends.  Don't sort if doing relocatable link.  Sort for .ctors
+       and .dtors if ctors_in_init_array.
+       (Layout::make_output_section): Force correct section types for
+       .init_array and friends.  Don't sort if doing relocatable link,
+       Don't sort .ctors and .dtors if ctors_in_init_array.
+       (Layout::section_name_mapping): Remove .ctors. and .dtorso.
+       (Layout::output_section_name): Add relobj parameter.  Change all
+       callers.  Handle .ctors. and .dtors. in code rather than table.
+       Handle .ctors and .dtors if ctors_in_init_array.
+       (Layout::match_file_name): New function, moved from output.cc.
+       * layout.h (class Layout): Update declarations.
+       * output.cc: Include "layout.h".
+       (Input_section_sort_entry::get_priority): New function.
+       (Input_section_sort_entry::match_file_name): Just call
+       Layout::match_file_name.
+       (Output_section::Input_section_sort_init_fini_compare::operator()):
+       Handle .ctors and .dtors.  Sort by explicit priority rather than
+       by name.
+       * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
+       * testsuite/initpri2.c: New test.
+       * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
+       (check_PROGRAMS): Add initpri2.
+       (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
+       (initpri2_LDFLAGS, initpri2_LDADD): New variables.
+       * configure, testsuite/Makefile.in: Rebuild.
+
+2011-06-19  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12880
+       * layout.cc (Layout::attach_allocated_section_to_segment): Add 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
+       clause in a linker script.
+       (Layout::finalize): Don't create a .interp section if we've
+       already create a PT_INTERP segment.
+       (Layout::create_interp): Always call choose_output_section (revert
+       patch of 2011-06-17).  Don't create PT_INTERP segment.
+       * script-sections.cc
+       (Script_sections::create_note_and_tls_segments): Add a .interp
+       section to a PT_INTERP segment even if we have seen a
+       --dynamic-linker option.
+
+2011-06-18  Ian Lance Taylor  <iant@google.com>
+
+       * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
+       merely because a non-PT_LOAD segment has a dynamic reloc.
+
+2011-06-18  Ian Lance Taylor  <iant@google.com>
+
+       * layout.cc (Layout::finish_dynamic_section): Don't create
+       DT_FLAGS entry if not needed.
+
+2011-06-18  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12745
+       * layout.cc (Layout::layout_eh_frame): Correct handling of
+       writable .eh_frame section.
+
+2011-06-17  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12893
+       * resolve.cc (Symbol_table::resolve): Don't give an error if a
+       symbol is redefined with the exact same object and value.
+
+2011-06-17  Ian Lance Taylor  <iant@google.com>
+
+       PR gold/12880
+       * layout.h (class Layout): Add interp_segment_ field.
+       * layout.cc (Layout::Layout): Initialize interp_segment_ field.
+       (Layout::attach_allocated_section_to_segment): If making shared
+       library, put .interp section in PT_INTERP segment.
+       (Layout::finalize): Also call create_interp if -dynamic-linker
+       option was used.
+       (Layout::create_interp): Assert that there is no PT_INTERP
+       segment.  If not using a SECTIONS clause, use make_output_section.
+       (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
+       * script-sections.cc
+       (Script_sections::create_note_and_tls_segments): If making shared
+       library, put .interp section in PT_INTERP segment.
+
+2011-06-17  Ian Lance Taylor  <iant@google.com>
+
+       * object.cc (Sized_relobj_file::do_layout): Keep warning sections
+       when making a shared library.
+
+2011-06-17  Ian Lance Taylor  <iant@google.com>
+
+       * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
+       parameter.  Change all callers.  Don't issue warning about PC32
+       against locally defined symbol.
+
+2011-06-16  Ian Lance Taylor  <iant@google.com>
+
+       * symtab.cc (Warnings::issue_warning): Don't warn if relocation
+       occurs in same object.
+
+2011-06-14  Alan Modra  <amodra@gmail.com>
+
+       * po/POTFILES.in: Regenerate.
+
+2011-06-09  Ian Lance Taylor  <iant@google.com>
+
+       * script-sections.cc
+       (Orphan_output_section::set_section_addresses): For a relocatable
+       link set address to 0.
+
+2011-06-09  Cary Coutant  <ccoutant@google.com>
+
+       PR gold/12804
+       * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
+       used with --compress-debug-sections.
+       * gold/object.cc (Sized_relobj_file::do_layout): Report
+       uncompressed size of compressed input sections.
+
+2011-06-08  Cary Coutant  <ccoutant@google.com>
+
+       PR gold/12804
+       * testsuite/two_file_test_2_v1.cc: Change initialization of
+       v2 to keep it in .data.
+
+2011-06-07  Cary Coutant  <ccoutant@google.com>
+
+       * common.cc (Symbol_table::do_allocate_commons_list): Call
+       gold_fallback.
+       * errors.cc (Errors::fatal): Adjust call to gold_exit.
+       (Errors::fallback): New function.
+       (gold_fallback): New function.
+       * errors.h (Errors::fallback): New function.
+       * gold.cc (gold_exit): Change status parameter to enum; adjust
+       all callers.
+       (queue_initial_tasks): Call gold_fallback.
+       * gold.h: Include cstdlib.
+       (Exit_status): New enum type.
+       (gold_exit): Change status parameter to enum.
+       (gold_fallback): New function.
+       * layout.cc (Layout::set_section_offsets): Call gold_fallback.
+       (Layout::create_symtab_sections): Likewise.
+       (Layout::create_shdrs): Likewise.
+       * main.cc (main): Adjust call to gold_exit.
+       * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
+       (Output_data_got::add_got_entry_pair): Likewise.
+       (Output_section::add_input_section): Likewise.
+       (Output_section::add_output_section_data): Likewise.
+       (Output_segment::set_section_list_addresses): Likewise.
+       * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
+
+2011-06-07  Cary Coutant  <ccoutant@google.com>
+
+       * layout.cc (Layout::set_segment_offsets): Don't adjust layout
+       for incremental links.
+       * output.cc (Output_segment::set_section_list_addresses): Remove
+       FIXME and test for TLS or BSS.
+
+2011-06-07  Cary Coutant  <ccoutant@google.com>
+
+       * testsuite/Makefile.am: Add incremental_copy_test,
+       incremental_common_test_1.
+       * testsuite/Makefile.in: Regenerate.
+       * testsuite/common_test_1_v1.c: New source file.
+       * testsuite/common_test_1_v2.c: New source file.
+       * testsuite/copy_test_v1.cc: New source file.
+
+2011-06-07  Cary Coutant  <ccoutant@google.com>
+
+       * common.cc (Symbol_table::do_allocate_commons_list): For incremental
+       update, allocate common from bss section's free list.
+       * incremental-dump.cc (dump_incremental_inputs): Print flag for
+       linker-defined symbols.
+       * incremental.cc (Sized_incremental_binary::do_process_got_plt):
+       Skip GOT and PLT entries that are no longer referenced.
+       (Output_section_incremental_inputs::write_info_blocks): Mark
+       linker-defined symbols.
+       (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
+       * output.cc (Output_section::allocate): New function.
+       * output.h (Output_section::allocate): New function.
+       * resolve.cc (Symbol_table::report_resolve_problem): Add case for
+       linker-defined symbols.
+       (Symbol::override_base_with_special): Copy is_predefined_ flag.
+       * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
+       (Symbol::init_base_output_data): Likewise.
+       (Symbol::init_base_output_segment): Likewise.
+       (Symbol::init_base_constant): Likewise.
+       (Sized_symbol::init_output_data): Likewise.
+       (Sized_symbol::init_output_segment): Likewise.
+       (Sized_symbol::init_constant): Likewise.
+       (Symbol_table::do_define_in_output_data): Likewise.
+       (Symbol_table::do_define_in_output_segment): Likewise.
+       (Symbol_table::do_define_as_constant): Likewise.
+       * symtab.h (Symbol::is_predefined): New function.
+       (Symbol::init_base_output_data): Add is_predefined parameter.
+       (Symbol::init_base_output_segment): Likewise.
+       (Symbol::init_base_constant): Likewise.
+       (Symbol::is_predefined_): New data member.
+       (Sized_symbol::init_output_data): Add is_predefined parameter.
+       (Sized_symbol::init_output_segment): Likewise.
+       (Sized_symbol::init_constant): Likewise.
+       (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
+
 2011-06-07  Cary Coutant  <ccoutant@google.com>
 
        * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc