URL
https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk
Subversion Repositories open8_urisc
[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [ChangeLog] - Rev 302
Go to most recent revision | Compare with Previous | Blame | View Log
2012-02-29 Cary Coutant <ccoutant@google.com>* object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.2012-02-29 Cary Coutant <ccoutant@google.com>* 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): CallObject::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 <ccoutant@google.com>* testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.* testsuite/Makefile.in: Regenerate.2012-02-14 Cary Coutant <ccoutant@google.com>* options.cc (General_options::finalize): Disallow -pie and -static.2012-02-03 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relocate_functions::abs8,Arm_relocate_functions::abs16): UseBits::has_signed_unsigned_overflow32.(Arm_relocate_functions::thm_abs8): Correct range ofoverflow check.* reloc.h (Bits class): Change minimum number of bits from 0 to 1in assertions.2012-02-02 Doug Kwan <dougkwan@google.com>* arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in allposition independent outputs, not just shared objects.2012-01-30 H.J. Lu <hongjiu.lu@intel.com>* configure.ac: Check if -fpic -mtls-dialect=gnu2 works.* configure: Regenerated.2012-01-27 Ian Lance Taylor <iant@google.com>* reloc.h (Bits): New class with static functions, copied fromnamespace utils in arm.cc.* arm.cc (namespace utils): Remove. Rewrite all uses to use Bitsinstead.2012-01-27 H.J. Lu <hongjiu.lu@intel.com>* incremental.cc (write_info_blocks): Correct relocation offset.2012-01-27 H.J. Lu <hongjiu.lu@intel.com>* x86_64.cc (Relocate::tls_gd_to_ie): Support x32.(Relocate::tls_gd_to_le): Likewise.2012-01-27 H.J. Lu <hongjiu.lu@intel.com>* x86_64.cc (Scan::global): Support x32 IFUNC function pointer.2012-01-27 H.J. Lu <hongjiu.lu@intel.com>* configure.ac: Check if -mcmodel=medium works.* configure: Regenerated.2012-01-24 Cary Coutant <ccoutant@google.com>* int_encoding.cc (read_unsigned_LEB_128): Replaced with inlinedefinition 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 <iant@google.com>PR gold/13617* i386.cc (Target_i386::do_code_fill): When using a jmpinstruction, pad with nop instructions.* x86_64.cc (Target_x86_64::do_code_fill): Likewise.2012-01-22 H.J. Lu <hongjiu.lu@intel.com>* x86_64.cc (gc_process_relocs): Add typename on types used intemplate.(scan_relocs): Likewise.(relocate_section): Likewise.(apply_relocation): Likewise.2012-01-10 H.J. Lu <hongjiu.lu@intel.com>* 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_32under x32.2012-01-09 H.J. Lu <hongjiu.lu@intel.com>* x86_64.cc: Initial support for x32.2012-01-03 Cary Coutant <ccoutant@google.com>* 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 todo_reserve_slot; Adjust callers.* gold/target.h (Sized_target::init_got_plt_for_update): Returnpointer to abstract base class.* gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.2011-12-18 Ian Lance Taylor <iant@google.com>* 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 fromlocal_has_got_offset.(Sized_relobj::do_local_got_offset): Rename from local_got_offset.(Sized_relobj::do_set_local_got_offset): Rename fromset_local_got_offset.(Sized_relobj_file::do_local_plt_offset): Rename fromlocal_plt_offset.(Sized_relobj_file::do_local_symbol_value): New function.* object.cc (Sized_relobj_file::do_local_plt_offset): Rename fromlocal_plt_offset.* output.cc (Output_data_got::Got_entry::write): Change object toRelobj. Use local_symbol_value.(Output_data_got::add_global_with_rel): Change rel_dyn toOutput_data_reloc_generic*. Use add_global_generic.(Output_data_got::add_global_with_rela): Remove. Change allcallers to use add_global_with_rel.(Output_data_got::add_global_pair_with_rel): Change rel_dyn toOutput_data_reloc_generic*. Use add_global_generic.(Output_data_got::add_global_pair_with_rela): Remove. Change allcallers 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*. Useadd_local_generic.(Output_data_got::add_local_with_rela): Remove. Change allcallers to use all_local_with_rel.(Output_data_got::add_local_pair_with_rel): Change object toRelobj*, change rel_dyn to Output_data_reloc_generic*. Useadd_output_section_generic.(Output_data_got::add_local_pair_with_rela): Remove. Change allcallers 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 virtualdeclarations for add_global_generic, add_local_generic,add_output_section_generic.(class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement newfunctions for Output_data_reloc_generic. Update declarations forchanges 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): Newfunction.(Sized_relobj_incr::do_local_plt_offset): New function.* copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Calladd_global_generic.2011-12-17 Cary Coutant <ccoutant@google.com>* 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 noparrays.* x86_64.cc (Target_x86_64::do_code_fill): Likewise.2011-12-16 Ian Lance Taylor <iant@google.com>* output.h (Output_data_reloc_generic::add): Only calladd_dynamic_reloc if this is a dynamic reloc section.2011-12-15 H.J. Lu <hongjiu.lu@intel.com>PR gold/13505* target-reloc.h (apply_relocation): Replace <64, false> with<size, big_endian>.2011-11-25 Nick Clifton <nickc@redhat.com>* po/it.po: New Italian translation.2011-11-17 Sterling Augustine <saugustine@google.com>* script.cc (script_include_directive): Implement.(read_script_file): New local variables name and search_path. Updatecomment. 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 <saugustine@google.com>* yyscript.y (section_cmd): Add support for INCLUDE directive.(file_or_sections_cmd): Likewise.2011-11-11 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_make_elf_object): Allow executable alsoif --just-symbols is given.2011-11-10 Doug Kwan <dougkwan@google.com>PR gold/13362* arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesseswhen processing data relocs.* reloc.h (Relocate_functions::rel_unaligned): New method.(Relocate_functions::pcrel_unaligned): Ditto.(Relocate_functions::rel32_unaligned): Ditto.(Relocate_functions::pcrel32_unaligned): Ditto.2011-11-09 Doug Kwan <dougkwan@google.com>PR gold/13362* arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):Use unaligned 4-byte relocs for static 32-bit data as required by EABI.* reloc.h (Relocatable_relocs::Reloc_strategy): New enumRELOC_ADJUST_FOR_SECTION_4_UNALIGNED.(Relocate_functions::rel_unaligned): New.(Relocate_functions::rel32_unaligned): New.* target-reloc.h (relocate_for_relocatable): Add code to handleRELOC_ADJUST_FOR_SECTION_4_UNALIGNED.* testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,arm_unaligned_reloc_r): New targets.* testsuite/Makefile.in: Regenerate.* arm_unaligned_reloc.sh: Check unaligned relocs in relocatablelinking.2011-11-02 Ian Lance Taylor <iant@google.com>* configure.ac: Add --with-lib-path option. Define LIB_PATH andNATIVE_LINKER.* Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.* options.cc (General_options::finalize): Use library search pathfrom configure script if specified. If not native and no sysroot,only search TOOLLIBDIR.* options.h (Search_directory::Search_directory): Change name toconst std::string&.(General_options::add_to_library_path_with_sysroot): Change arg toconst std::string&.* configure, Makefile.in, config.in: Rebuild.2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>* arm.cc (Target_arm::may_use_v5t_interworking): Check whetherwe are working around the ARM1176 Erratum.* options.h (General_options::fix_arm1176): Add option.* testsuite/Makefile.am: Add testcases, and keep current onesworking.* testsuite/Makefile.in: Regenerate.* testsuite/arm_fix_1176.s: New file.* testsuite/arm_fix_1176.sh: Likewise.2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>* arm.cc (Target_arm::Target_arm): Remove initialisation ofmay_use_blx_.(Target_arm::may_use_blx): Remove method.(Target_arm::set_may_use_blx): Likewise.(Target_arm::may_use_v4t_interworking): New method.(Target_arm::may_use_v5t_interworking): Likewise.(Target_arm::may_use_blx_): Remove member variable.(Arm_relocate_functions::arm_branch_common): Check for v5Tinterworking.(Arm_relocate_functions::thumb_branch_common): Likewise.(Reloc_stub::stub_type_for_reloc): Likewise.(Target_arm::do_finalize_sections): Correct interworking checks.* testsuite/Makefile.am: Add new tests.* testsuite/Makefile.in: Regenerate.* testsuite/arm_farcall_arm_arm.s: New test.* testsuite/arm_farcall_arm_arm.sh: Likewise.* testsuite/arm_farcall_arm_thumb.s: Likewise.* testsuite/arm_farcall_arm_thumb.sh: Likewise.* testsuite/arm_farcall_thumb_arm.s: Likewise.* testsuite/arm_farcall_thumb_arm.sh: Likewise.* testsuite/arm_farcall_thumb_thumb.s: Likewise.* testsuite/arm_farcall_thumb_thumb.sh: Likewise.2011-10-31 Cary Coutant <ccoutant@google.com>PR gold/13023* expression.cc (Expression::eval_with_dot): Addis_section_dot_assignment parameter.(Expression::eval_maybe_dot): Likewise. Adjust value when rhs isabsolute and assigning to dot within a section.* script-sections.cc(Output_section_element_assignment::set_section_addresses): Passdot_section to set_if_absolute.(Output_section_element_dot_assignment::finalize_symbols): Pass TRUEas is_section_dot_assignment flag to eval_with_dot.(Output_section_element_dot_assignment::set_section_addresses):Likewise.* script.cc (Symbol_assignment::set_if_absolute): Add dot_sectionparameter. Also set value if relative to dot_section; set thesymbol's output_section.* script.h (Expression::eval_with_dot): Add is_section_dot_assignmentparameter. Adjust all callers.(Expression::eval_maybe_dot): Likewise.(Symbol_assignment::set_if_absolute): Add dot_section parameter.Adjust all callers.* testsuite/script_test_2.t: Test assignment of an absolute valueto dot within an output section element.2011-10-31 Cary Coutant <ccoutant@google.com>* options.h (class General_options): Add --[no-]gnu-unique options.* symtab.cc (Symbol_table::sized_write_globals): ConvertSTB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.2011-10-31 Cary Coutant <ccoutant@google.com>PR gold/13359* i386.cc (Target_i386::Relocate::relocate_tls): Removeunnecessary assertion.* x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.2011-10-31 Sriraman Tallam <tmsriram@google.com>* symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename togc_mark_symbol.* symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename togc_mark_symbol.Change to just keep the section associated with symbol.(Symbol_table::add_from_relobj): Mark symbols as not garbage whenthey are externally visible and --export-dynamic is turned on.(Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.2011-10-19 Ian Lance Taylor <iant@google.com>PR gold/13163* script-sections.cc(Output_section_element_dot_assignment::needs_output_section): Newfunction.2011-10-19 Ian Lance Taylor <iant@google.com>PR gold/13204* layout.cc (Layout::segment_precedes): Don't assert failure if a--section-start option was seen.* options.h (General_options::any_section_start): New function.2011-10-18 David S. Miller <davem@davemloft.net>PR binutils/13301* sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): Newmember to track relocation locations that have moved during TLSreloc optimizations.(Target_sparc::Relocate::Relocate): Initialize to NULL.(Target_sparc::Relocate::relocate): Adjust view down by 4bytes if it matches reloc_adjust_addr_.(Target_sparc::Relocate::relocate_tls): Always move the__tls_get_addr call delay slot instruction forward 4 bytes whenperforming relaxation.2011-10-18 Cary Coutant <ccoutant@google.com>* output.cc (posix_fallocate): Return 0 on success, errno on failure.(Output_file::map_no_anonymous): Check for non-zeroreturn code from posix_fallocate.2011-10-17 Cary Coutant <ccoutant@google.com>PR gold/13245* plugin.cc (is_visible_from_outside): Check for symbolsreferenced from dynamic objects.* resolve.cc (Symbol_table::resolve): Don't count referencesfrom dynamic objects as references from real ELF files.* testsuite/plugin_test_2.sh: Adjust expected result.2011-10-17 Cary Coutant <ccoutant@google.com>* gold.cc: Include timer.h.(queue_middle_tasks): Stamp time.(queue_final_tasks): Likewise.* main.cc (main): Store timer in parameters. Print timersfor each pass.* parameters.cc (Parameters::Parameters): Initialize timer_.(Parameters::set_timer): New function.(set_parameters_timer): New function.* parameters.h (Parameters::set_timer): New function.(Parameters::timer): New function.(Parameters::timer_): New data member.(set_parameters_timer): New function.* timer.cc (Timer::stamp): New function.(Timer::get_pass_time): New function.* timer.h (Timer::stamp): New function.(Timer::get_pass_time): New function.(Timer::pass_times_): New data member.2011-10-17 Cary Coutant <ccoutant@google.com>* readsyms.cc (Read_symbols::run): Don't queue an unblockertask for members of lib groups.2011-10-17 Cary Coutant <ccoutant@google.com>PR gold/13288* fileread.cc (File_read::find_view): Add assert.(File_read::make_view): Move bounds check (replace with assert)...(File_read::find_or_make_view): ... to here.2011-10-12 Cary Coutant <ccoutant@google.com>* output.cc (Output_file::open_base_file): Handle case where::read returns less than requested size.2011-10-10 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_relobj_incr::Sized_relobj_incr):Initialize defined_count_.(Sized_relobj_incr::do_add_symbols): Count defined symbols.(Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.(Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.(Sized_incr_dynobj::do_add_symbols): Count defined symbols.(Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.* incremental.h (Sized_relobj_incr::defined_count_): New datamember.(Sized_incr_dynobj::defined_count_): New data member.* plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):Return zeroes instead of internal error.2011-10-10 Cary Coutant <ccoutant@google.com>PR gold/13249* output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.(Output_reloc::symbol_value): Return PLT offset if flag is set.* output.h (class Output_reloc): Add use_plt_offset flag.(Output_reloc::type_): Adjust size of bit field.(Output_reloc::use_plt_offset_): New bit field.(class Output_data_reloc): Adjust all calls to Output_reloc_type.(Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offsetflag. Adjust all callers.* x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC whencreating RELATIVE relocations.2011-10-10 Nick Clifton <nickc@redhat.com>* po/es.po: Updated Spanish translation.* po/fi.po: Updated Finnish translation.2011-10-03 Diego Novillo <dnovillo@google.com>* options.cc (parse_uint): Fix dereference of RETVAL.2011-09-29 Sriraman Tallam <tmsriram@google.com>* layout.h (section_order_map_): New member.(get_section_order_map): New member function.* output.cc (Output_section::add_input_section): Check for patternsonly when --section-ordering-file is specified.* gold.cc (queue_middle_tasks): Delay updating order of sections tilloutput_sections have been formed.* layout.cc (Layout_Layout): Initialize section_order_map_.* plugin.cc (update_section_order): Store order in order_map. Do notupdate the order.* testsuite/Makefile.am: Add test case for plugin_final_layout.* testsuite/Makefile.in: Regenerate.* testsuite/plugin_section_order.c: New file.* testsuite/plugin_final_layout.cc: New file.* testsuite/plugin_final_layout.sh: New file.2011-09-29 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_incremental_binary::do_process_got_plt):Check for NULL.* symtab.cc (Symbol_table::add_from_relobj): Ignore versionsymbols during incremental update.(Symbol_table::add_from_dynobj): Likewise.2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::define_special_symbol): Alwayscanonicalize version string.2011-09-26 Cary Coutant <ccoutant@google.com>* gold.cc (queue_initial_tasks): Move option checks ...* options.cc (General_options::finalize): ... to here. Disablesome options; make others fatal.2011-09-26 Cary Coutant <ccoutant@google.com>gcc PR lto/47247* plugin.cc (get_symbols_v2): New function.(Plugin::load): Add LDPT_GET_SYMBOLS_V2.(is_referenced_from_outside): New function.(Pluginobj::get_symbol_resolution_info): Add version parameter, returnLDPR_PREVAILING_DEF_IRONLY_EXP when using new version.(get_symbols): Pass version parameter.(get_symbols_v2): New function.* plugin.h (Pluginobj::get_symbol_resolution_info): Add versionparameter.* testsuite/plugin_test.c (get_symbols_v2): New static variable.(onload): Add LDPT_GET_SYMBOLS_V2.(all_symbols_read_hook): Use get_symbols_v2; check forLDPR_PREVAILING_DEF_IRONLY_EXP.* testsuite/plugin_test_3.sh: Update expected results.2011-09-23 Simon Baldwin <simonb@google.com>* configure.ac: Add new --with-gold-ldadd and --with-gold-ldflagsconfiguration options.* configure: Regenerate.* Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.* Makefile.in: Regenerate.* testsuite/Makefile.in: Regenerate.2011-09-19 Sriraman Tallam <tmsriram@google.com>* plugin.h (should_defer_layout): Modify to check for any_claimed_.2011-09-19 Cary Coutant <ccoutant@google.com>* incremental.cc (can_incremental_update): Fix typo in comment.* incremental.h (can_incremental_update): Likewise.2011-09-18 Cary Coutant <ccoutant@google.com>* incremental.cc (can_incremental_update): New function.* incremental.h (can_incremental_update): New function.* layout.cc (Layout::init_fixed_output_section): Call it.(Layout::make_output_section): Don't allow patch space in .eh_frame.* object.cc (Sized_relobj_file::do_layout): Callcan_incremental_update.2011-09-13 Cary Coutant <ccoutant@google.com>* configure.ac: Check for glibc support for gnu_indirect_functionsupport with static linking, setting automake conditionalIFUNC_STATIC.* Makefile.in: Regenerate.* configure: Regenerate.* testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)(ifuncmain4static, ifuncmain5static, ifuncmain7static): Add checkfor IFUNC_STATIC.* testsuite/Makefile.in: Regenerate.2011-09-13 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_relobj_incr::do_layout): Callreport_comdat_group for kept comdat sections.* testsuite/Makefile.am (incremental_comdat_test_1): New test.* testsuite/Makefile.in: Regenerate.* testsuite/incr_comdat_test_1.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_v3.cc: New source file.2011-09-13 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj_file::do_layout): Remove unused localvariable external_symbols_offset.2011-09-12 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj_file::do_layout): Remove assertion whichtriggered if object has no symbols.2011-09-09 David S. Miller <davem@davemloft.net>* output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.(Output_fill_debug_line::do_write): Likewise.2011-08-29 Cary Coutant <ccoutant@google.com>* output.cc: (Output_fill_debug_info::do_minimum_hole_size): Addcasts to match formatting specs.(Output_fill_debug_line::do_minimum_hole_size): Likewise.2011-08-26 Cary Coutant <ccoutant@google.com>* layout.cc (Free_list::allocate): Provide guarantee of minimumremaining hole size when allocating.(Layout::make_output_section): Set fill methods for debug sections.* layout.h (Free_list::Free_list_node): Move from private topublic.(Free_list::set_min_hole_size): New function.(Free_list::begin, Free_list::end): New functions.(Free_list::min_hole_): New data member.* output.cc: Include dwarf.h.(Output_fill_debug_info::do_minimum_hole_size): 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_write): New function.(Output_section::Output_section): Initialize new data member.(Output_section::set_final_data_size): Ensure patch space is largerthan minimum hole size.(Output_section::do_write): Fill holes in debug sections.* output.h (Output_fill): New class.(Output_fill_debug_info): New class.(Output_fill_debug_line): New class.(Output_section::set_free_space_fill): New function.(Output_section::free_space_fill_): New data member.* testsuite/Makefile.am (incremental_test_3): Add--incremental-patch option.(incremental_test_4): Likewise.(incremental_test_5): Likewise.(incremental_test_6): Likewise.(incremental_copy_test): Likewise.(incremental_common_test_1): Likewise.* testsuite/Makefile.in: Regenerate.2011-08-26 Nick Clifton <nickc@redhat.com>* po/es.po: Updated Spanish translation.2011-08-01 Cary Coutant <ccoutant@google.com>* gold/testsuite/Makefile.am (justsyms_exec): New testcase.* gold/testsuite/Makefile.in: Regenerate.* gold/testsuite/justsyms_exec.c: New source file.* gold/testsuite/justsyms_lib.c: New source file.2011-08-01 Cary Coutant <ccoutant@google.com>* layout.cc (Layout::set_segment_offsets): Don't realign textsegment if -Ttext was specified.* object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELFfile type.* object.h (Sized_relobj_file::e_type): New function.(Sized_relobj_file::e_type_): New data member.* symtab.cc (Symbol_table::add_from_relobj): Don't add sectionbase address for ET_EXEC files.* target.cc (Target::do_make_elf_object_implementation): AllowET_EXEC files with --just-symbols option.2011-07-28 Cary Coutant <ccoutant@google.com>* workqueue-internal.h (Workqueue_threader::should_cancel_thread):Add thread_number parameter.(Workqueue_threader_threadpool::should_cancel_thread): Likewise.* workqueue-threads.cc(Workqueue_threader_threadpool::should_cancel_thread): Cancelcurrent thread if its thread number is greater than desired threadcount.* workqueue.cc (Workqueue_threader_single::should_cancel_thread):Add thread_number parameter.(Workqueue::should_cancel_thread): Likewise.(Workqueue::find_runnable_or_wait): Pass thread_number toshould_cancel_thread.* workqueue.h (Workqueue::should_cancel_thread): Add thread_numberparameter.2011-07-22 Sriraman Tallam <tmsriram@google.com>* symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referencedonly after checking if it cannot be forced local.* symtab.h (is_externally_visible): Check if the symbol is not forcedlocal.2011-07-15 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add --print-output-format.Move -EL next to -EB, for better --help output.* target-select.cc: Include <cstdio>, "options.h", and"parameters.h".(Target_selector::do_target_bfd_name): New function.(print_output_format): New function.* target-select.h (class Target_selector): Update declarations.(Target_selector::target_bfd_name): New function.(print_output_format): Declare.* main.cc: Include "target-select.h".(main): Handle --print-output-format.* gold.cc: Include "target-select.h".(queue_initial_tasks): Handle --print-output-format when there areno input files.* parameters.cc (parameters_force_valid_target): Give a bettererror message if -EB/-EL does not match target.* freebsd.h (Target_selector_freebsd::do_target_bfd_name): Newfunction.2011-07-15 Ian Lance Taylor <iant@google.com>* i386.cc (class Output_data_plt_i386): Add layout_ field.(Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.(Output_data_plt_i386::do_write): Write address of .dynamicsection to first entry in .got.plt section.* x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.(Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:Initialize layout_.(Output_data_plt_x86_64::do_write): Write address of .dynamicsection to first entry in .got.plt section.* layout.h (Layout::dynamic_section): New function.2011-07-13 Sriraman Tallam <tmsriram@google.com>* archive.cc (Archive::get_elf_object_for_member): Add extra parameterto claim_file call.* layout.cc (Layout::Layout): Initialize section_ordering_specified_,input_section_position_, and input_section_glob_.(read_layout_from_file): Call function section_ordering_specified.* layout.h (is_section_ordering_specified): New function.(section_ordering_specified): New function.(section_ordering_specified_): New boolean member.* main.cc(main): Call load_plugins after layout object is defined.* output.cc (Output_section::add_input_section): Usefunction section_ordering_specified to check if section ordering isneeded.* output.cc (Output_section::add_relaxed_input_section): Usefunction section_ordering_specified to check if section ordering isneeded.(Output_section::update_section_layout): New function.(Output_section::sort_attached_input_sections): Check if input sectionmust be reordered.* output.h (Output_section::update_section_layout): New function.* plugin.cc (get_section_count): New function.(get_section_type): New function.(get_section_name): New function.(get_section_contents): New function.(update_section_order): New function.(allow_section_ordering): New function.(Plugin::load): Add the new interfaces to the transfer vector.(Plugin_manager::load_plugins): New parameter.(Plugin_manager::all_symbols_read): New parameter.(Plugin_manager::claim_file): New parameter. Save the elf object forunclaimed objects.(Plugin_manager::get_elf_object): New function.(Plugin_manager::get_view): Change to directly use the bool to checkif get_view is called from claim_file_hook.* plugin.h (input_objects): New function(Plugin__manager::load_plugins): New parameter.(Plugin_manager::claim_file): New parameter.(Plugin_manager::get_elf_object): New function.(Plugin_manager::in_claim_file_handler): New function.(Plugin_manager::in_claim_file_handler_): New member.(layout): New function.* readsyms.cc (Read_symbols::do_read_symbols): Call the claim_filehandler with an extra parameter. Make the elf object before callingclaim_file handler.* testsuite/plugin_test.c (get_section_count): New function pointer.(get_section_type): New function pointer.(get_section_name): New function pointer.(get_section_contents): New function pointer.(update_section_order): New function pointer.(allow_section_ordering): New function pointer.(onload): Check if the new interfaces exist.2011-07-13 Ian Lance Taylor <iant@google.com>* i386.cc (Target_i386::got_section): If -z now, make .got.plt arelro section.* x86_64.cc (Target_x86_64::got_section): Likewise.* testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.(relro_now_test_SOURCES): New variable.(relro_now_test_DEPENDENCIES): New variable.(relro_now_test_LDFLAGS): New variable.(relro_now_test_LDADD): New variable.(relro_now_test.so): New target.* testsuite/Makefile.in: Rebuild.2011-07-12 Ian Lance Taylor <iant@google.com>PR gold/12980* i386.cc (Target_i386::Scan::global): For a GOT reloc, use aGLOB_DAT relocation rather than a RELATIVE relocation for aprotected symbol when creating a shared library.* x86_64.cc (Target_x86_64::Scan::global): Likewise.* testsuite/protected_1.cc (f2, get_f2_addr): New functions.* testsuite/protected_main_1.cc (main): Test that protectedfunction has same address.2011-07-11 Ian Lance Taylor <iant@google.com>PR gold/12979* options.h (class General_options): Add -Bgroup.* options.cc (General_options::finalize): If -Bgroup is set,default to --unresolved-symbols=report-all.* layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.* target-reloc.h (issue_undefined_symbol_error): Handle--unresolved-symbols=report-all.2011-07-08 Ian Lance Taylor <iant@google.com>PR gold/11985* layout.cc (Layout::create_initial_dynamic_sections): Don't crashif linker script discards key sections.(Layout::create_dynamic_symtab): Likewise.(Layout::assign_local_dynsym_offsets): Likewise.(Layout::sized_create_version_sections): Likewise.(Layout::create_interp): Likewise.(Layout::finish_dynamic_section): Likewise.(Layout::set_dynamic_symbol_size): Likewise.2011-07-08 Ian Lance Taylor <iant@google.com>PR gold/12386* options.h (class General_options): Add --unresolved-symbols.* target-reloc.h (issue_undefined_symbol_error): Check--unresolved-symbols. Add comments.2011-07-08 Ian Lance Taylor <iant@google.com>* testsuite/odr_violation2.cc (Ordering::operator()): Makeexpression more complex.2011-07-08 Ian Lance Taylor <iant@google.com>PR gold/11317* target-reloc.h (issue_undefined_symbol_error): New inlinefunction, broken out of relocate_section.(relocate_section): Call issue_undefined_symbol_error.* i386.cc (Target_i386::Relocate::relocate_tls): Don't crash ifthere is no TLS segment if we are about to issue an undefinedsymbol error.* x86_64.cc (Target_x86_64::relocate_tls): Likewise.2011-07-08 Ian Lance Taylor <iant@google.com>PR gold/12279* resolve.cc (Symbol_table::should_override): Add fromtypeparameter. Change all callers. Give error when linking togetherTLS and non-TLS symbol.(Symbol_table::should_override_with_special): Add fromtypeparameter. Change all callers.* i386.cc (Target_i386::Relocate::relocate_tls): Don't crash ifthere is no TLS segment if we have reported some errors.* x86_64.cc (Target_x86_64::relocate_tls): Likewise.2011-07-08 Ian Lance Taylor <iant@google.com>PR gold/12372* target.h (Target::plt_address_for_global): New function.(Target::plt_address_for_local): New function.(Target::plt_section_for_global): Remove.(Target::plt_section_for_local): Remove.(Target::do_plt_address_for_global): New virtual function.(Target::do_plt_address_for_local): New virtual function.(Target::do_plt_section_for_global): Remove.(Target::do_plt_section_for_local): Remove.(Target::register_global_plt_entry): Add Symbol_table and Layoutparameters.* output.cc (Output_data_got::Got_entry::write): Useplt_address_for_global and plt_address_for_local.* layout.cc (Layout::add_target_dynamic_tags): Use size andaddress of output section.* i386.cc (class Output_data_plt_i386): Add irelative_rel_,got_irelative_, and irelative_count_ fields. Updatedeclarations.(Output_data_plt_i386::has_irelative_section): New function.(Output_data_plt_i386::entry_count): Add irelative_count_.(Output_data_plt_i386::set_final_data_size): Likewise.(class Target_i386): Add got_irelative_ and rel_irelative_fields. Update declarations.(Target_i386::Target_i386): Initialize new fields.(Target_i386::do_plt_address_for_global): New function replacingdo_plt_section_for_global.(Target_i386::do_plt_address_for_local): New function replacingdo_plt_section_for_local.(Target_i386::got_section): Create got_irelative_.(Target_i386::rel_irelative_section): New function.(Output_data_plt_i386::Output_data_plt_i386): Initialize newfields. Don't define __rel_iplt_{start,end}.(Output_data_plt_i386::add_entry): Add symtab and layoutparameters. Change all callers. Use different PLT and GOT forIFUNC symbols.(Output_data_plt_i386::add_local_ifunc_entry): Add symtab andlayout parameters. Change all callers. Use different PLT andGOT.(Output_data_plt_i386::rel_tls_desc): Fix formatting.(Output_data_plt_i386::rel_irelative): New function.(Output_data_plt_i386::address_for_global): New function.(Output_data_plt_i386::address_for_local): New function.(Output_data_plt_i386::do_write): Write out IRELATIVE area. UseIRELATIVE GOT when changing IFUNC GOT entries.(Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVEreloc.(Target_i386::do_finalize_sections): Create the __rel_iplt symbolsif we didn't create an IRELATIVE GOT.(Target_i386::Relocate::relocate): Use plt_address_for_global andplt_address_for_local.(Target_i386::do_dynsym_value): Use plt_address_for_global.* x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,got_irelative_, and irelative_count_ fields. Updatedeclarations.(Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:Initialize new fields. Remove symtab parameter. Change allcallers.(Output_data_plt_x86_64::get_tlsdesc_plt_offset): Addirelative_count_.(Output_data_plt_x86_64::has_irelative_section): New function.(Output_data_plt_x86_64::entry_count): Add irelative_count_.(class Target_x86_64): Add got_irelative_ and rel_irelative_fields. Update declarations.(Target_x86_64::Target_x86_64): Initialize new fields.(Target_x86_64::do_plt_address_for_global): New function replacingdo_plt_section_for_global.(Target_x86_64::do_plt_address_for_local): New function replacingdo_plt_section_for_local.(Target_x86_64::got_section): Create got_irelative_.(Target_x86_64::rela_irelative_section): New function.(Output_data_plt_x86_64::init): Remove symtab parameter. Changeall callers. Don't create __rel_iplt_{start,end}.(Output_data_plt_x86_64::add_entry): Add symtab and layoutparameters. Change all callers. Use different PLT and GOT forIFUNC symbols.(Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab andlayout parameters. Change all callers. Use different PLT andGOT.(Output_data_plt_x86_64::add_relocation): Add symtab and layoutparameters. Change all callers. Use different PLT and GOT forIFUNC symbols.(Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.(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_local): New function.(Output_data_plt_x86_64::set_final_data_size): Likewise.(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::register_global_plt_entry): Add symtab and layoutparameters.(Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVEreloc.(Target_x86_64::do_finalize_sections): Create the __rela_ipltsymbols if we didn't create an IRELATIVE GOT.(Target_x86_64::Relocate::relocate): Use plt_address_for_global andplt_address_for_local.(Target_x86_64::do_dynsym_value): Use plt_address_for_global.* testsuite/ifuncvar1.c: New test file.* testsuite/ifuncvar2.c: New test file.* testsuite/ifuncvar3.c: New test file.* testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.(ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.(ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.(ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.* testsuite/Makefile.in: Rebuild.2011-07-07 Cary Coutant <ccoutant@google.com>* testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.(two_file_test_1_ndebug.o): Likewise.(two_file_test_1b_ndebug.o): Likewise.(two_file_test_2_ndebug.o): Likewise.(two_file_test_main_ndebug.o): Likewise.(incremental_test_2): Link with no-debug versions.2011-07-06 Cary Coutant <ccoutant@google.com>* gold/incremental.cc(Output_section_incremental_inputs::write_info_blocks): Check forhidden and internal symbols.2011-07-06 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_incremental_binary::do_file_has_changed):Check disposition for startup file.(Incremental_inputs::report_command_line): Ignore--incremental-startup-unchanged option.* options.cc (General_options::parse_incremental_startup_unchanged):New function.(General_options::General_options): Initialize new data member.* options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.(General_options): Add --incremental-startup-unchanged option.(General_options::incremental_startup_disposition): New function.(General_options::incremental_startup_disposition_): New data member.2011-07-06 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_incremental_binary::setup_readers): Passinput file index to Script_info ctor.(Sized_incremental_binary::do_file_has_changed): Find thecommand-line argument for files named in scripts.* incremental.h (Script_info::Script_info): New ctorwith input file index.(Script_info::input_file_index): New function.(Script_info::input_file_index_): New data member.(Incremental_binary::get_library): Add const.(Incremental_binary::get_script_info): Add const.* readsyms.cc (Read_member::is_runnable): Check for this_blocker_.* testsuite/Makefile.am (incremental_test_5): New test case.(incremental_test_6): New test case.* testsuite/Makefile.in: Regenerate.2011-07-06 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_incremental_binary::do_check_inputs): Adddebug output when command lines differ.2011-07-06 Cary Coutant <ccoutant@google.com>* incremental.cc (Incremental_inputs::report_command_line): Ignore--incremental-patch option.* layout.cc (Free_list::allocate): Extend allocation beyond originalend if enabled.(Layout::make_output_section): Mark sections that should getpatch space.* options.cc (parse_percent): New function.* options.h (parse_percent): New function.(DEFINE_percent): New macro.(General_options): Add --incremental-patch option.* output.cc (Output_section::Output_section): Initialize new datamembers.(Output_section::add_input_section): Print section name when outof patch space.(Output_section::add_output_section_data): Likewise.(Output_section::set_final_data_size): Add patch space whendoing --incremental-full.(Output_section::do_reset_address_and_file_offset): Remove patchspace.(Output_segment::set_section_list_addresses): Print debug outputonly if --incremental-update.* output.h (Output_section::set_is_patch_space_allowed): New function.(Output_section::is_patch_space_allowed_): New data member.(Output_section::patch_space_): New data member.* parameters.cc (Parameters::incremental_full): New function.* parameters.h (Parameters::incremental_full): New function* testsuite/Makefile.am (incremental_test_2): Add test for--incremental-patch option.* testsuite/Makefile.in: Regenerate.* testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.(t18): Remove function body.2011-07-05 Doug Kwan <dougkwan@google.com>PR gold/12771* arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend andArm_Address type for relocation result.(Arm_relocate_functions::abs16): Use unaligned access. Also fixoverflow check.(Arm_relocate_functions::abs32): Use unaligned access.(Arm_relocate_functions::rel32): Ditto.(Arm_relocate_functions::prel31): Ditto.(Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.* testsuite/Makefile.am: Add new test arm_unaligned_reloc for unalignedstatic data relocations.* testsuite/Makefile.in: Regnerate.* testsuite/arm_unaligned_reloc.{s,sh}: New files.2011-07-05 Ian Lance Taylor <iant@google.com>PR gold/12392* i386.cc (Target_i386::do_finalize_sections): Define __rel_ipltsymbols if necessary.* x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.2011-07-05 Ian Lance Taylor <iant@google.com>PR gold/12952* resolve.cc (Symbol::override_base_with_special): Simply overrideversion with special symbol version, ignoring previous version.2011-07-05 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj_file::include_section_group): Addinformation to comment about signature location.2011-07-02 Ian Lance Taylor <iant@google.com>PR gold/12957* options.h (class General_options): Add -f and -F.* options.cc (General_options::finalize): Fatal error if -f/-Fare used without -shared.* layout.cc (Layout::finish_dynamic_section): Implement -f/-F.2011-07-02 Ian Lance Taylor <iant@google.com>* dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.2011-07-01 Ian Lance Taylor <iant@google.com>PR gold/12525PR gold/12952* resolve.cc (Symbol::override_base_with_special): Don't overridethe version if the overriding symbol has a different name.* dynobj.cc (Versions::add_def): Add dynpool parameter. Changeall callers. If we give an error about an undefined version,define the base version if necessary.* dynobj.h (class Versions): Update declaration.* testsuite/weak_alias_test_5.cc: New file.* testsuite/weak_alias_test.script: New file.* testsuite/weak_alias_test_main.cc: Check that versioned_symboland versioned_alias have the right value, and call t2.* testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Addweak_alias_test_5.so.(weak_alias_test_LDADD): Likewise.(weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.* testsuite/Makefile.in: Rebuild.2011-07-01 Ian Lance Taylor <iant@google.com>PR gold/12525* options.h (class General_options): Support -z notext.* testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use-Wl,-z,notext.(two_file_shared_nonpic.so): Likewise.(two_file_shared_mixed.so): Likewise.(two_file_shared_mixed_1.so): Likewise.(weak_undef_lib_nonpic.so): Likewise.(alt/weak_undef_lib_nonpic.so): Likewise.(tls_test_shared_nonpic.so): Likewise.* testsuite/Makefile.in: Rebuild.2011-07-01 Ian Lance Taylor <iant@google.com>PR gold/12525* configure.ac: Test whether static linking works, settingthe automake conditional HAVE_STATIC.* testsuite/Makefile.am: Disable tests using -static ifHAVE_STATIC is not true.* configure, testsuite/Makefile.in: Rebuild.2011-07-01 Ian Lance Taylor <iant@google.com>PR gold/12525* ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.Assert if we see DW_EH_PE_indirect.* target.h (Target::ehframe_datarel_base): New function.(Target::do_ehframe_datarel_base): New target function.* i386.cc (Target_i386::do_ehframe_datarel_base): New function.* x86_64.cc (Target_x86_64::do_ehframe_datarel_base): Newfunction.2011-07-01 Ian Lance Taylor <iant@google.com>PR gold/12571* options.h (class General_options): Add--ld-generated-unwind-info.* ehframe.cc (Fde::write): Add address parameter. Change allcallers. If associated with PLT, fill in address and size.(Cie::set_output_offset): Only add merge mapping if there is anobject.(Cie::write): Add address parameter. Change all callers.(Eh_frame::add_ehframe_for_plt): New function.* ehframe.h (class Fde): Update declarations. Move shndx_ andinput_offset_ fields into union u_, with new plt field.(Fde::Fde): Adjust for new union field.(Fde::Fde) [Output_data version]: New constructor.(Fde::add_mapping): Only add merge mapping if there is an object.(class Cie): Update declarations.(class Eh_frame): Declare add_ehframe_for_plt.* layout.cc (Layout::layout_eh_frame): Break out code intomake_eh_frame_section, and call it.(Layout::make_eh_frame_section): New function.(Layout::add_eh_frame_for_plt): New function.* layout.h (class Layout): Update declarations.* merge.cc (Merge_map::add_mapping): Add assertion.* i386.cc: Include "dwarf.h".(class Output_data_plt_i386): Make first_plt_entry,dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Addplt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,and plt_eh_frame_fde.(Output_data_plt_i386::Output_data_plt_i386): Align to 16-byteboundary. Call add_eh_frame_for_plt if appropriate.* x86_64.cc: Include "dwarf.h".(class Output_data_plt_x86_64): Align to 16-byte boundary. Makefirst_plt_entry, plt_entry and tlsdesc_plt_entry const. Addplt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,and plt_eh_frame_fde.(Output_data_plt_x86_64::init): Call add_eh_frame_for_plt ifappropriate.2011-06-29 Ian Lance Taylor <iant@google.com>PR gold/12629* object.cc (Sized_relobj_file::layout_section): Change shdrparameter to be const.(Sized_relobj_file::layout_eh_frame_section): New function, brokenout of do_layout.(Sized_relobj_file::do_layout): Defer .eh_frame sections ifappropriate. Call layout_eh_frame_section.(Sized_relobj_file::do_layout_deferred_sections): Handle .eh_framesections.* 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/kmodifier.(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 forSHT_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 undefinedsymbols 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 linkerscript create indistinguishable segments.(Layout::set_segment_offsets): Use stable_sort when sortingsegments. Pass this to Compare_segments constructor.* layout.h (class Layout): Make segment_precedes non-static.(class Compare_segments): Change from struct to class. Addlayout_ field. Add constructor.* script-sections.cc(Script_sections::attach_sections_using_phdrs_clause): Renamelocal orphan to is_orphan. Don't report failure to put emptysection in segment. On attachment failure, report name ofsection, 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): Addemulation 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 fromrecognize_by_name. Change all callers.(Target_selector::supported_bfd_names): Rename fromsupported_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 fromdo_recognize_by_name. Change all callers.(Target_selector::do_supported_bfd_names): Rename fromdo_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 findtarget 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 onTarget.(Target_selector_freebsd::do_recognize_by_name): Likewise.(Target_selector_freebsd::set_osabi): Remove.* i386.cc (class Target_i386): Inherit from Sized_target ratherthan 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 virtualfunction.(Target::do_section_may_have_icf_unsafe_pointers): Likewise.* arm.cc (Target_arm::do_can_check_for_function_pointers): Renamefrom can_check_for_function_pointers, move in file.(Target_arm::do_section_may_have_icf_unsafe_pointers): Rename fromsection_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): Initializecan_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): Initializecan_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 whenappropriate.(Symbol_table::sized_write_symbol): Likewise.* symtab.h (class Symbol): Declare versioned_name.* stringpool.h (class Stringpool_template): Add variant of addwhich 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 signedtype to compute offset.* testsuite/Makefile.am: Add new tests arm_thm_jump11 andarm_thm_jump8.* testsuite/Makefile.in: Regenerate.* testsuite/arm_branch_in_range.sh: Check test results ofarm_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 ifappropriate.* layout.h (class Layout): Declare is_ctors_in_init_array.* reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words ifis_ctors_reverse_view is set.(Sized_relobj_file::write_sections): Add layout parameter. Changeall callers. Set is_ctors_reverse_view field of View_size.(Sized_relobj_file::reverse_words): New function.* object.h (Sized_relobj_file::View_size): Addis_ctors_reverse_view field.(class Sized_relobj_file): Update declarations.* testsuite/initpri3.c: New test.* testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a andinitpri3b.(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 notskip 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 andfriends as SHT_PROGBITS for merging sections.(Layout::layout): Remove special handling of .init_array andfriends. Don't sort if doing relocatable link. Sort for .ctorsand .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 allcallers. 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 callLayout::match_file_name.(Output_section::Input_section_sort_init_fini_compare::operator()):Handle .ctors and .dtors. Sort by explicit priority rather thanby 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 PHDRSclause in a linker script.(Layout::finalize): Don't create a .interp section if we'vealready create a PT_INTERP segment.(Layout::create_interp): Always call choose_output_section (revertpatch of 2011-06-17). Don't create PT_INTERP segment.* script-sections.cc(Script_sections::create_note_and_tls_segments): Add a .interpsection 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_TEXTRELmerely 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 createDT_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 ofwritable .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 asymbol 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 sharedlibrary, put .interp section in PT_INTERP segment.(Layout::finalize): Also call create_interp if -dynamic-linkeroption was used.(Layout::create_interp): Assert that there is no PT_INTERPsegment. 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 sharedlibrary, 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 sectionswhen making a shared library.2011-06-17 Ian Lance Taylor <iant@google.com>* x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsymparameter. Change all callers. Don't issue warning about PC32against locally defined symbol.2011-06-16 Ian Lance Taylor <iant@google.com>* symtab.cc (Warnings::issue_warning): Don't warn if relocationoccurs 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 relocatablelink set address to 0.2011-06-09 Cary Coutant <ccoutant@google.com>PR gold/12804* gold/gold.cc (queue_initial_tasks): Warn if --incremental isused with --compress-debug-sections.* gold/object.cc (Sized_relobj_file::do_layout): Reportuncompressed 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 ofv2 to keep it in .data.2011-06-07 Cary Coutant <ccoutant@google.com>* common.cc (Symbol_table::do_allocate_commons_list): Callgold_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; adjustall 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 layoutfor incremental links.* output.cc (Output_segment::set_section_list_addresses): RemoveFIXME 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 incrementalupdate, allocate common from bss section's free list.* incremental-dump.cc (dump_incremental_inputs): Print flag forlinker-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): Marklinker-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 forlinker-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_relocinstead of emit_copy_reloc.(Copy_relocs::emit_copy_reloc): Refactor.(Copy_relocs::make_copy_reloc): New function.(Copy_relocs::add_copy_reloc): Remove.* copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to publicsection.(Copy_relocs::make_copy_reloc): New function.(Copy_relocs::add_copy_reloc): Remove.* gold.cc (queue_middle_tasks): Emit old COPY relocations fromunchanged input files.* incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.* incremental.cc (Sized_incremental_binary::do_reserve_layout):Reserve BSS space for COPY relocations.(Sized_incremental_binary::do_emit_copy_relocs): New function.(Output_section_incremental_inputs::write_info_blocks): Recordwhether a symbol is copied from a shared object.(Sized_incr_dynobj::do_add_symbols): Record COPY relocations.* incremental.h (enum Incremental_shlib_symbol_flags): New type.(INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.(Incremental_input_entry_reader::get_output_symbol_index): Addis_copy parameter.(Incremental_binary::emit_copy_relocs): New function.(Incremental_binary::do_emit_copy_relocs): New function.(Sized_incremental_binary::Sized_incremental_binary): Initializenew data member.(Sized_incremental_binary::add_copy_reloc): New function.(Sized_incremental_binary::do_emit_copy_relocs): New function.(Sized_incremental_binary::Copy_reloc): New struct.(Sized_incremental_binary::Copy_relocs): New typedef.(Sized_incremental_binary::copy_relocs_): New data member.* symtab.cc (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.* x86_64.cc (Target_x86_64::emit_copy_reloc): New function.2011-06-02 Cary Coutant <ccoutant@google.com>PR gold/12163* gold/archive.cc (Archive::Archive): Initialize new data member.(Archive::include_all_members): Return if archive has already beenincluded.* gold/archive.h (Archive::include_all_members_): New data member.2011-06-02 Nick Clifton <nickc@redhat.com>* dynobj.h: Fix spelling mistake in comment.* output.cc: Likewise.2011-05-31 Doug Kwan <dougkwan@google.com>Asier LlanoPR gold/12826* arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling ofarch value that equals to elfcpp::MAX_TAG_CPU_ARCH.* testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Removeredundant arm_exidx_test.so.* testsuite/Makefile.in: Regenerate.(check_SCRIPTS): Add pr12826.sh(check_DATA): Add pr12826.stdout(pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.* testsuite/pr12826.sh: New file.* testsuite/pr12826_1.s: Ditto.* testsuite/pr12826_1.s: Ditto.2011-05-30 Ian Lance Taylor <iant@google.com>* reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty relocsections.2011-05-29 Ian Lance Taylor <iant@google.com>PR gold/12804* testsuite/Makefile.am: Use different file name for two_file_testtemporary file for each incremental test.* testsuite/Makefile.in: Rebuild.2011-05-29 Ian Lance Taylor <iant@google.com>* binary.cc (Binary_to_elf::sized_convert): Don't crash if thebinary input file is empty.2011-05-27 Ian Lance Taylor <iant@google.com>* testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.(ver_test_9.so): Likewise.* testsuite/Makefile.in: Rebuild.2011-05-26 Cary Coutant <ccoutant@google.com>* incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.* incremental.cc (Incremental_inputs::report_input_section): Fixcomment, indentation.(Incremental_inputs::report_comdat_group): New function.(Output_section_incremental_inputs::set_final_data_size): Adjust sizeof data for incremental input file entry.(Output_section_incremental_inputs::write_info_blocks): Write COMDATgroup count, COMDAT group signatures.(Sized_incr_relobj::do_layout): Record kept COMDAT group info froman unchanged input file.* incremental.h (Incremental_object_entry::Incremental_object_entry):Initialize new data member.(Incremental_object_entry::add_comdat_group): New function.(Incremental_object_entry::get_comdat_group_count): New function.(Incremental_object_entry::get_comdat_signature_key): New function.(Incremental_object_entry::groups_): New data member.(Incremental_inputs::report_comdat_group): New function.(Incremental_input_entry_reader::get_symbol_offset): Adjust size ofdata for incremental input file entry.(Incremental_input_entry_reader::get_comdat_group_count): New function.(Incremental_input_entry_reader::get_input_section): Adjust size ofdata for incremental input file entry.(Incremental_input_entry_reader::get_global_symbol_reader): Likewise.(Incremental_input_entry_reader::get_comdat_group_signature): Newfunction.* object.cc (Sized_relobj::include_section_group): Report keptCOMDAT groups for incremental links.2011-05-24 David Meyer <pdox@google.com>* dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameterswith name parameter. Add found_name parameter.* fileread.cc (Input_file::find_file): Adjust code accordingly.* dirsearch.h (class Dirsearch): Update declaration.2011-05-24 Ian Lance Taylor <iant@google.com>* archive.cc (Library_base::should_include_member): Pull in objectfrom archive if it defines the entry symbol.* parameters.cc (Parameters::entry): New function.* parameters.h (class Parameters): Declare entry.* output.h (class Output_file_header): Remove entry_ field.* output.cc (Output_file_header::Output_file_header): Remove entryparameter. Change all callers.(Output_file_header::entry): Use parameters->entry.* gold.cc (queue_middle_tasks): Likewise.* plugin.cc (Plugin_hook::run): Likewise.2011-05-24 Cary Coutant <ccoutant@google.com>* gold.cc (queue_initial_tasks): Pass incremental base filenameto Output_file::open_base_file; don't print error message.* incremental-dump.cc (main): Adjust call toOutput_file::open_for_modification.* incremental-dump.cc (main): Likewise.* incremental.cc (Incremental_inputs::report_command_line):Ignore --incremental-base option when comparing command lines.Ignore parameter when given as separate argument.* options.h (class General_options): Add --incremental-base.* output.cc (Output_file::Output_file):(Output_file::open_base_file): Add base_name and writable parameters;read base file into new file; print error message here.(Output_file::map_no_anonymous): Add writable parameter; adjust allcallers.* output.h (Output_file::open_for_modification): Rename to...(Output_file::open_base_file): ...this; add base_name andwritable parameters; adjust all callers.(Output_file::map_no_anonymous): Add writable parameter; adjust allcallers.* testsuite/Makefile.am (incremental_test_4): Test--incremental-base.* testsuite/Makefile.in: Regenerate.2011-05-24 Cary Coutant <ccoutant@google.com>* testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,incremental_test_4.* testsuite/Makefile.in: Regenerate.* 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_2_v1.cc: New test source file.2011-05-24 Cary Coutant <ccoutant@google.com>* dynobj.h (Dynobj::do_dynobj): New function.* incremental-dump.cc (dump_incremental_inputs): Print as_neededflag and soname for shared objects.* incremental.cc (Incremental_inputs::report_object): Makeeither Incremental_object_entry or Incremental_dynobj_entry; addsoname to string table.(Incremental_inputs::report_input_section): Add assertion.(Output_section_incremental_inputs::set_final_data_size): Adjusttype of input file entry for shared libraries; adjust size ofshared library info entry.(Output_section_incremental_inputs::write_input_files): Writeas_needed flag for shared libraries.(Output_section_incremental_inputs::write_info_blocks): Adjust typeof input file entry for shared libraries; write soname.(Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag andsoname from incremental info.* incremental.h (enum Incremental_input_flags): AddINCREMENTAL_INPUT_AS_NEEDED.(Incremental_input_entry::Incremental_input_entry): Initialize newdata member.(Incremental_input_entry::set_as_needed): New function.(Incremental_input_entry::as_needed): New function.(Incremental_input_entry::do_dynobj_entry): New function.(Incremental_input_entry::as_needed_): New data member.(Incremental_object_entry::Incremental_object_entry): Don't checkfor shared library.(Incremental_object_entry::do_type): Likewise.(class Incremental_dynobj_entry): New class.(Incremental_input_entry_reader::as_needed): New function.(Incremental_input_entry_reader::get_soname): New function.(Incremental_input_entry_reader::get_global_symbol_count): Rewrite.(Incremental_input_entry_reader::get_output_symbol_index): Adjustsize of shared library info entry.* layout.cc (Layout::finish_dynamic_section): Don't test forincremental link when adding DT_NEEDED entries.* object.h (Object::Object): Initialize new data member.(Object::dynobj): New function.(Object::set_as_needed): New function.(Object::as_needed): New function.(Object::do_dynobj): New function.(Object::as_needed_): New data member.2011-05-24 Cary Coutant <ccoutant@google.com>* incremental-dump.cc (dump_incremental_inputs): Print dynamic relocinfo; adjust display of GOT entries.* incremental.cc (Sized_incremental_binary::setup_readers): Allocatevector of input objects; remove file_status_.(Sized_incremental_binary::do_reserve_layout): Remove file_status_.(Sized_incremental_binary::do_process_got_plt): Adjust calls togot_plt reader; call target hooks to reserve GOT entries.(Output_section_incremental_inputs::set_final_data_size): Adjust sizeof input file info header and GOT info entry.(Output_section_incremental_inputs::write_info_blocks): Write dynamicrelocation info.(Got_plt_view_info::got_descriptor): Remove.(Got_plt_view_info::sym_index): New data member.(Got_plt_view_info::input_index): New data member.(Local_got_offset_visitor::visit): Write input file index.(Global_got_offset_visitor::visit): Write 0 for input file index.(Global_symbol_visitor_got_plt::operator()): Replace got_descriptorwith sym_index and input_index.(Output_section_incremental_inputs::write_got_plt): Adjust size ofincremental info GOT entry; replace got_descriptor with input_index.(Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; recordmap from input file index to object.(Sized_relobj_incr::do_layout): Replace direct data member referencewith accessor function.(Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.* incremental.h (Incremental_input_entry_reader::get_symbol_offset):Adjust size of input file info header.(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_input_section): Adjust size ofinput file info header.(Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust sizeof incremental info GOT entry.(Incremental_got_plt_reader::get_got_desc): Remove.(Incremental_got_plt_reader::get_got_symndx): New function.(Incremental_got_plt_reader::get_got_input_index): New function.(Sized_incremental_binary::Sized_incremental_binary): Removefile_status_; add input_objects_.(Sized_incremental_binary::~Sized_incremental_binary): Remove.(Sized_incremental_binary::set_file_is_unchanged): Remove.(Sized_incremental_binary::file_is_unchanged): Remove.(Sized_incremental_binary::set_input_object): New function.(Sized_incremental_binary::input_object): New function.(Sized_incremental_binary::file_status_): Remove.(Sized_incremental_binary::input_objects_): New data member.(Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust allreferences.(Sized_relobj_incr::invalid_address): Move to base class.(Sized_relobj_incr::is_output_section_offset_invalid): Move to baseclass.(Sized_relobj_incr::do_output_section_offset): Likewise.(Sized_relobj_incr::do_for_all_local_got_entries): Likewise.(Sized_relobj_incr::section_offsets_): Likewise.* object.cc (Sized_relobj::do_for_all_local_got_entries): Newfunction.(Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.(Sized_relobj_file::layout_section): Replace refs to section_offsets_with accessor function.(Sized_relobj_file::do_layout): 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::compute_final_local_value): Replace refs tosection_offsets_ with accessor function.(Sized_relobj_file::do_finalize_local_symbols): Likewise.* object.h (Relobj::Relobj): Initialize new data members.(Relobj::add_dyn_reloc): New function.(Relobj::first_dyn_reloc): New function.(Relobj::dyn_reloc_count): New function.(Relobj::first_dyn_reloc_): New data member.(Relobj::dyn_reloc_count_): New data member.(Sized_relobj): Rename Sized_relobj_base to this; adjust allreferences.(Sized_relobj::Address): New typedef.(Sized_relobj::invalid_address): Move here from child class.(Sized_relobj::Sized_relobj): Initialize new data members.(Sized_relobj::sized_relobj): New function.(Sized_relobj::is_output_section_offset_invalid): Move here fromchild class.(Sized_relobj::get_output_section_offset): Likewise.(Sized_relobj::local_has_got_offset): Likewise.(Sized_relobj::local_got_offset): Likewise.(Sized_relobj::set_local_got_offset): Likewise.(Sized_relobj::do_for_all_local_got_entries): Likewise.(Sized_relobj::clear_got_offsets): New function.(Sized_relobj::section_offsets): Move here from child class.(Sized_relobj::do_output_section_offset): Likewise.(Sized_relobj::do_set_section_offset): Likewise.(Sized_relobj::Local_got_offsets): Likewise.(Sized_relobj::local_got_offsets_): Likewise.(Sized_relobj::section_offsets_): Likewise.(Sized_relobj_file): Rename Sized_relobj to this; adjust allreferences.(Sized_relobj_file::is_output_section_offset_invalid): Move to baseclass.(Sized_relobj_file::sized_relobj): New function(Sized_relobj_file::local_has_got_offset): Move to base class.(Sized_relobj_file::local_got_offset): Likewise.(Sized_relobj_file::set_local_got_offset): Likewise.(Sized_relobj_file::get_output_section_offset): Likewise.(Sized_relobj_file::do_for_all_local_got_entries): Likewise.(Sized_relobj_file::do_output_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::section_offsets_): Likewise.* output.cc (Output_reloc::Output_reloc): Adjust type of relobj(all constructors).(set_needs_dynsym_index): Convert relobj to derived class pointer.(Output_reloc::get_symbol_index): Likewise.(Output_reloc::local_section_offset): Likewise.(Output_reloc::get_address): Likewise.(Output_reloc::symbol_value): Likewise.(Output_data_got::reserve_slot): Move to class definition.(Output_data_got::reserve_local): New function.(Output_data_got::reserve_slot_for_global): Remove.(Output_data_got::reserve_global): New function.* output.h (Output_reloc::Output_reloc): Adjust type of relobj(all constructors, two instantiations).(Output_reloc::get_relobj): New function (two instantiations).(Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.(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_relative): Likewise.(Output_data_reloc::add_symbolless_global_addend): Likewise.(Output_data_reloc::add_local): Likewise.(Output_data_reloc::add_local_relative): Likewise.(Output_data_reloc::add_symbolless_local_addend): Likewise.(Output_data_reloc::add_local_section): Likewise.(Output_data_reloc::add_output_section): Likewise.(Output_data_reloc::add_absolute): Likewise.(Output_data_reloc::add_target_specific): Likewise.(Output_data_got::reserve_slot): Move definition here.(Output_data_got::reserve_local): New function.(Output_data_got::reserve_global): New function.* reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs tosection_offsets_ with accessor function.(Sized_relobj_file::write_sections): Likewise.(Sized_relobj_file::do_relocate_sections): Likewise.* target.h (Sized_target::reserve_local_got_entry): New function.(Sized_target::reserve_global_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::init_got_plt_for_update): Create rela_dyn section.2011-05-23 Cary Coutant <ccoutant@google.com>* gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.* incremental-dump.cc (dump_incremental_inputs): Mask high-orderbit when checking got_type.* incremental.cc (Sized_incremental_binary::setup_readers):Store symbol table and string table locations; initialize bit vectorof file status flags.(Sized_incremental_binary::do_reserve_layout): Set bit flag forunchanged files.(Sized_incremental_binary::do_process_got_plt): New function.(Sized_incremental_binary::get_symtab_view): Use stored locations.(Output_section_incremental_inputs::set_final_data_size): Recordfile index for each input file.(Output_section_incremental_inputs::write_got_plt): Store file indexinstead of input entry offset for each GOT entry.* incremental.h(Incremental_input_entry::Incremental_input_entry): Initialize newdata member.(Incremental_input_entry::set_offset): Store file index.(Incremental_input_entry::get_file_index): New function.(Incremental_input_entry::file_index_): New data member.(Incremental_binary::process_got_plt): New function.(Incremental_binary::do_process_got_plt): New function.(Sized_incremental_binary::Sized_incremental_binary): Initialize newdata members.(Sized_incremental_binary::~Sized_incremental_binary): New destructor.(Sized_incremental_binary::set_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::file_status_): New data member.(Sized_incremental_binary::main_symtab_loc_): New data member.(Sized_incremental_binary::main_strtab_loc_): New data member.* output.cc (Output_data_got::Got_entry::write): Add caseRESERVED_CODE.(Output_data_got::add_global): Call add_got_entry.(Output_data_got::add_global_plt): Likewise.(Output_data_got::add_global_with_rel): 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_rela): Likewise.(Output_data_got::add_local): Call add_got_entry.(Output_data_got::add_local_plt): Likewise.(Output_data_got::add_local_with_rel): 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_rela): Likewise.(Output_data_got::reserve_slot): 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_pair): New function.(Output_section::add_output_section_data): Edit FIXME.* output.h(Output_section_data_build::Output_section_data_build): Newconstructor with size parameter.(Output_data_space::Output_data_space): Likewise.(Output_data_got::Output_data_got): Initialize new data member; newconstructor with size parameter.(Output_data_got::add_constant): Call add_got_entry.(Output_data_got::reserve_slot): New function.(Output_data_got::reserve_slot_for_global): New function.(class Output_data_got::Got_entry): Add RESERVED_CODE.(Output_data_got::add_got_entry): New function.(Output_data_got::add_got_entry_pair): New function.(Output_data_got::free_list_): New data member.* target.h (Sized_target::init_got_plt_for_update): New function.(Sized_target::register_global_plt_entry): New function.* x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):Initialize new data member; call init; add constructor with PLT count.(Output_data_plt_x86_64::init): 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::free_list_): New data member.(Target_x86_64::init_got_plt_for_update): New function.(Target_x86_64::register_global_plt_entry): New function.(Output_data_plt_x86_64::add_entry): Allocate from free list forincremental updates.(Output_data_plt_x86_64::add_relocation): New function.* testsuite/object_unittest.cc (Object_test): Set default options.2011-05-16 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Make -i a synonym for -r.2011-05-16 Ian Lance Taylor <iant@google.com>* testsuite/tls_test_main.cc: Use semaphores instead of mutexes.2011-05-10 Cary Coutant <ccoutant@google.com>* object.cc (Sized_relobj::do_count_local_symbols): Check forstrip_all (-s).2011-05-06 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::layout): If the output section flags change,update the ordering.2011-04-25 Cary Coutant <ccoutant@google.com>* incremental-dump.cc (dump_incremental_inputs): Print localsymbol info for each input file.* incremental.cc(Output_section_incremental_inputs::set_final_data_size): Add localsymbol info to input file entries in incremental info.(Output_section_incremental_inputs::write_info_blocks): Likewise.(Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.(Sized_incr_relobj::do_add_symbols): Cosmetic change.(Sized_incr_relobj::do_count_local_symbols): Replace stub withimplementation.(Sized_incr_relobj::do_finalize_local_symbols): Likewise.(Sized_incr_relobj::do_relocate): Write the local symbols.(Sized_incr_dynobj::do_add_symbols): Cosmetic change.* incremental.h (Incremental_inputs_reader::get_symbol_offset):Adjust size of input file header.(Incremental_inputs_reader::get_local_symbol_offset): New function.(Incremental_inputs_reader::get_local_symbol_count): New function.(Incremental_inputs_reader::get_input_section): Adjust size of inputfile header.(Incremental_inputs_reader::get_global_symbol_reader): Likewise.(Sized_incr_relobj::This): New typedef.(Sized_incr_relobj::sym_size): New const data member.(Sized_incr_relobj::Local_symbol): New struct.(Sized_incr_relobj::do_output_local_symbol_count): New function.(Sized_incr_relobj::do_local_symbol_offset): New function.(Sized_incr_relobj::local_symbol_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_offset_): New data member.(Sized_incr_relobj::local_dynsym_offset_): New data member.(Sized_incr_relobj::local_symbols_): New data member.* object.h (Relobj::output_local_symbol_count): New function.(Relobj::local_symbol_offset): New function.(Relobj::do_output_local_symbol_count): New function.(Relobj::do_local_symbol_offset): New function.(Sized_relobj::do_output_local_symbol_count): New function.(Sized_relobj::do_local_symbol_offset): New function.2011-04-22 Vladimir Simonov <sv@sw.ru>* descriptors.cc (set_close_on_exec): New function.(Descriptors::open): Use set_close_on_exec.* output.cc (S_ISLNK): Define if not defined.2011-04-22 Cary Coutant <ccoutant@google.com>* incremental.cc (Sized_incremental_binary::setup_readers): Allocateglobal symbol map.(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_relocate): Remap section indices in incrementalrelocations.(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_local_got_entries): Likewise.* incremental.h(Incremental_inputs_reader::global_symbol_reader_at_offset): Newfunction.(Incremental_binary::apply_incremental_relocs): New function.(Incremental_binary::do_apply_incremental_relocs): New function.(Sized_incremental_binary::Sized_incremental_binary): Initialize newdata member.(Sized_incremental_binary::add_global_symbol): New function.(Sized_incremental_binary::global_symbol): New function.(Sized_incremental_binary::do_apply_incremental_relocs): New function.(Sized_incremental_binary::symbol_map_): New data member.* layout.cc (Layout_task_runner::run): Apply incremental relocations.* target.h (Sized_target::apply_relocation): New function.* target-reloc.h (apply_relocation): New function.* x86_64.cc (Target_x86_64::apply_relocation): New function.2011-04-22 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDERflag of a SHT_ARM_EXIDX section.* testsuite/Makefile.am (arm_exidx_test): New test rules.* testsuite/Makefile.in: Regenerate.* testsuite/arm_exidx_test.s: New file.* testsuite/arm_exidx_test.sh: Same.2011-04-20 Cary Coutant <ccoutant@google.com>PR gold/12689* archive.h (Incremental_archive_entry::Archive_member):Initialize arg_serial_ (second constructor).2011-04-17 Ian Lance Taylor <iant@google.com>* object.cc (Relocate_info::location): Simplify location string.* errors.cc (Errors::error_at_location): Don't print programname.(Errors::warning_at_location): Likewise.(Errors::undefined_symbol): Likewise.* testsuite/debug_msg.sh: Update accordingly.2011-04-14 Cary Coutant <ccoutant@google.com>* gold/layout.cc (Layout::symtab_section_offset): New function.* gold/layout.h (Layout::symtab_section_offset): New function.* gold/reloc.cc (Sized_relobj::do_relocate): Call it.2011-04-12 Ian Lance Taylor <iant@google.com>* configure.ac: Check for sys/mman.h and mmap. Check for mremapwith MREMAP_MAYMOVE.* output.h (class Output_file): Add map_is_allocated_ field.* output.cc: Only #include <sys/mman.h> if it exists. If mmap isnot available, provide stubs. If mremap is not available, #defineit to gold_mremap.(MREMAP_MAYMOVE): Define if not defined.(Output_file::Output_file): Initialize map_is_allocated_.(Output_file::resize): Check map_is_allocated_.(Output_file::map_anonymous): If mmap fails, use malloc.(Output_file::unmap): Don't do anything for an anonymous map.* fileread.cc: Only #include <sys/mman.h> if it exists. If mmapis not available, provide stubs.(File_read::View::~View): Use free rather than delete[].(File_read::make_view): Use malloc rather than new[]. If mmapfails, use malloc.(File_read::find_or_make_view): Use malloc rather than new[].* gold.h: Remove HAVE_REMAP code.* mremap.c: #include <errno.h>. Only #include <sys/mman.h> if itexists. Rename mremap to gold_mremap. If mmap is not availabledon't do anything.* configure, config.in: Rebuild.2011-04-11 Ian Lance Taylor <iant@google.com>* incremental.cc (Sized_incr_relobj::do_add_symbols): Alwaysinitialize local variable v.2011-04-11 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::include_member): Adjust call toreport_object.(Add_archive_symbols::run): Track argument serial numbers.(Lib_group::include_member): Likewise.(Add_lib_group_symbols::run): Adjust call to report_archive_begin.* archive.h (Incremental_archive_entry::Archive_member):Initialize arg_serial_.(Archive_member::arg_serial_): New data member.* dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.(Sized_dynobj::do_add_symbols): Track symbols when doing anincremental link.(Sized_dynobj::do_for_all_local_got_entries): New function.* dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): Newfunction.* fileread.cc (get_mtime): New function.* fileread.h (get_mtime): New function.* gold.cc (queue_initial_tasks): Check for incremental update.(process_incremental_input): New function.(queue_middle_tasks): Don't force valid target for incrementalupdate.* incremental-dump.cc (find_input_containing_global): Adjustsize of symbol info entry.(dump_incremental_inputs): Dump argument serial number andin_system_directory flag; bias shndx by 1; print symbol nameswhen dumping per-file symbol lists; use new symbol info readers.* incremental.cc(Output_section_incremental_inputs:update_data_size): New function.(Sized_incremental_binary::setup_readers): Setup input readersfor each input file; build maps for files added from librariesand scripts.(Sized_incremental_binary::check_input_args): New function.(Sized_incremental_binary::do_check_inputs): Build map of argumentserial numbers to input arguments.(Sized_incremental_binary::do_file_has_changed): Renamedo_file_is_unchanged to this; compare file modification times.(Sized_incremental_binary::do_init_layout): New function.(Sized_incremental_binary::do_reserve_layout): New function.(Sized_incremental_binary::do_get_input_reader): Remove.(Sized_incremental_binary::get_symtab_view): New function.(Incremental_checker::can_incrementally_link_output_file): Remove.(Incremental_inputs::report_command_line): Exclude --debug options.(Incremental_inputs::report_archive_begin): Add parameter; trackargument serial numbers; don't put input file entry for archivebefore archive members.(Incremental_inputs::report_archive_end): Put input file entryfor archive after archive members.(Incremental_inputs::report_object): Add parameter; track argumentserial numbers and in_system_directory flag.(Incremental_inputs::report_script): Add parameter; track argumentserial numbers.(Output_section_incremental_inputs::set_final_data_size): Adjustsize of symbol info entry; check for forwarding symbols.(Output_section_incremental_inputs::write_input_files): Writein_system_directory flag and argument serial number.(Output_section_incremental_inputs::write_info_blocks): Map sectionindices between incremental info and original input file; storeinput section index for each symbol.(class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;change operator() to visit().(class Global_got_offset_visitor): Likewise.(class Global_symbol_visitor_got_plt):(Output_section_incremental_inputs::write_got_plt): Use new visitorclasses.(Sized_incr_relobj::Sized_incr_relobj): New constructor.(Sized_incr_relobj::do_read_symbols): New function.(Sized_incr_relobj::do_layout): New function.(Sized_incr_relobj::do_layout_deferred_sections): New function.(Sized_incr_relobj::do_add_symbols): 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_local_got_entries): New function.(Sized_incr_relobj::do_section_size): New function.(Sized_incr_relobj::do_section_name): New function.(Sized_incr_relobj::do_section_contents): New function.(Sized_incr_relobj::do_section_flags): New function.(Sized_incr_relobj::do_section_entsize): New function.(Sized_incr_relobj::do_section_address): New function.(Sized_incr_relobj::do_section_type): New function.(Sized_incr_relobj::do_section_link): New function.(Sized_incr_relobj::do_section_info): New function.(Sized_incr_relobj::do_section_addralign): New function.(Sized_incr_relobj::do_initialize_xindex): New function.(Sized_incr_relobj::do_get_global_symbol_counts): New function.(Sized_incr_relobj::do_read_relocs): New function.(Sized_incr_relobj::do_gc_process_relocs): New function.(Sized_incr_relobj::do_scan_relocs): New function.(Sized_incr_relobj::do_count_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_offset): New function.(Sized_incr_relobj::do_relocate): New function.(Sized_incr_relobj::do_set_section_offset): New function.(Sized_incr_dynobj::Sized_incr_dynobj): New function.(Sized_incr_dynobj::do_read_symbols): New function.(Sized_incr_dynobj::do_layout): New function.(Sized_incr_dynobj::do_add_symbols): 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_local_got_entries): New function.(Sized_incr_dynobj::do_section_size): New function.(Sized_incr_dynobj::do_section_name): New function.(Sized_incr_dynobj::do_section_contents): New function.(Sized_incr_dynobj::do_section_flags): New function.(Sized_incr_dynobj::do_section_entsize): New function.(Sized_incr_dynobj::do_section_address): New function.(Sized_incr_dynobj::do_section_type): New function.(Sized_incr_dynobj::do_section_link): New function.(Sized_incr_dynobj::do_section_info): New function.(Sized_incr_dynobj::do_section_addralign): New function.(Sized_incr_dynobj::do_initialize_xindex): New function.(Sized_incr_dynobj::do_get_global_symbol_counts): New function.(make_sized_incremental_object): New function.(Incremental_library::copy_unused_symbols): New function.(Incremental_library::do_for_all_unused_symbols): New function.* incremental.h (enum Incremental_input_flags): New type.(class Incremental_checker): Remove.(Incremental_input_entry::Incremental_input_entry): Add argumentserial number.(Incremental_input_entry::arg_serial): New function.(Incremental_input_entry::set_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::is_in_system_directory_): New data member.(class Script_info): Move here from script.h.(Script_info::Script_info): Add filename parameter.(Script_info::filename): New function.(Script_info::filename_): New data member.(Incremental_script_entry::Incremental_script_entry): Add argumentserial number.(Incremental_object_entry::Incremental_object_entry): Likewise.(Incremental_object_entry::add_input_section): Build list of inputsections with map to original shndx.(Incremental_object_entry::get_input_section_index): New function.(Incremental_object_entry::shndx_): New data member.(Incremental_object_entry::name_key_): Rename; adjust all refs.(Incremental_object_entry::sh_size_): Rename; adjust all refs.(Incremental_archive_entry::Incremental_archive_entry): Add argumentserial number.(Incremental_inputs::report_archive_begin): Likewise.(Incremental_inputs::report_object): Likewise.(Incremental_inputs::report_script): Likewise.(class Incremental_global_symbol_reader): New class.(Incremental_input_entry_reader::Incremental_input_entry_reader): Readand store flags and input file type.(Incremental_input_entry_reader::arg_serial): New function.(Incremental_input_entry_reader::type): Extract type from flags.(Incremental_input_entry_reader::is_in_system_directory): New function.(Incremental_input_entry_reader::get_input_section_count): Callaccessor function for type.(Incremental_input_entry_reader::get_symbol_offset): Call accessorfunction for type; adjust size of global symbol entry.(Incremental_input_entry_reader::get_global_symbol_count): Callaccessor function for type.(Incremental_input_entry_reader::get_object_count): Likewise.(Incremental_input_entry_reader::get_object_offset): Likewise.(Incremental_input_entry_reader::get_member_count): Likewise.(Incremental_input_entry_reader::get_unused_symbol_count): Likewise.(Incremental_input_entry_reader::get_member_offset): Likewise.(Incremental_input_entry_reader::get_unused_symbol): Likewise.(Incremental_input_entry_reader::Global_symbol_info): Remove.(Incremental_input_entry_reader::get_global_symbol_info): Remove.(Incremental_input_entry_reader::get_global_symbol_reader): Newfunction.(Incremental_input_entry_reader::get_output_symbol_index): Newfunction.(Incremental_input_entry_reader::type_): Remove.(Incremental_input_entry_reader::flags_): New data member.(Incremental_inputs_reader::input_file_offset): New function.(Incremental_inputs_reader::input_file_index): New function.(Incremental_inputs_reader::input_file): Call input_file_offset.(Incremental_inputs_reader::input_file_at_offset): New function.(Incremental_relocs_reader::get_r_type): Reformat.(Incremental_relocs_reader::get_r_shndx): Reformat.(Incremental_relocs_reader::get_r_offset): Reformat.(Incremental_relocs_reader::data): New function.(Incremental_binary::Incremental_binary): Initialize new data members.(Incremental_binary::check_inputs): Add cmdline parameter.(Incremental_binary::file_is_unchanged): Remove.(Input_reader::arg_serial): New function.(Input_reader::get_unused_symbol_count): New function.(Input_reader::get_unused_symbol): New function.(Input_reader::do_arg_serial): New function.(Input_reader::do_get_unused_symbol_count): New function.(Input_reader::do_get_unused_symbol): New function.(Incremental_binary::input_file_count): New function.(Incremental_binary::get_input_reader): Change signature to useindex instead of filename.(Incremental_binary::file_has_changed): New function.(Incremental_binary::get_input_argument): New function.(Incremental_binary::get_library): New function.(Incremental_binary::get_script_info): New function.(Incremental_binary::init_layout): New function.(Incremental_binary::reserve_layout): New function.(Incremental_binary::output_file): New function.(Incremental_binary::do_check_inputs): New function.(Incremental_binary::do_file_is_unchanged): Remove.(Incremental_binary::do_file_has_changed): New function.(Incremental_binary::do_init_layout): New function.(Incremental_binary::do_reserve_layout): New function.(Incremental_binary::do_input_file_count): New function.(Incremental_binary::do_get_input_reader): Change signature.(Incremental_binary::input_args_map_): New data member.(Incremental_binary::library_map_): New data member.(Incremental_binary::script_map_): New data member.(Sized_incremental_binary::Sized_incremental_binary): Initializenew data members.(Sized_incremental_binary::output_section): New function.(Sized_incremental_binary::inputs_reader): Add const.(Sized_incremental_binary::symtab_reader): Add const.(Sized_incremental_binary::relocs_reader): Add const.(Sized_incremental_binary::got_plt_reader): Add const.(Sized_incremental_binary::get_symtab_view): New function.(Sized_incremental_binary::Inputs_reader): New typedef.(Sized_incremental_binary::Input_entry_reader): New typedef.(Sized_incremental_binary::do_check_inputs): Add cmdline parameter.(Sized_incremental_binary::do_file_is_unchanged): Remove.(Sized_incremental_binary::do_file_has_changed): New function.(Sized_incremental_binary::do_init_layout): New function.(Sized_incremental_binary::do_reserve_layout): New function.(Sized_input_reader::Inputs_reader): Remove.(Sized_input_reader::Input_entry_reader): Remove.(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): New function.(Sized_incremental_binary::do_input_file_count): New function.(Sized_incremental_binary::do_get_input_reader): Change signature;use index instead of filename.(Sized_incremental_binary::section_map_): New data member.(Sized_incremental_binary::input_entry_readers_): New data member.(class Sized_incr_relobj): New class.(class Sized_incr_dynobj): New class.(make_sized_incremental_object): New function.(class Incremental_library): New class.* layout.cc (Free_list::num_lists): New static data member.(Free_list::num_nodes): New static data member.(Free_list::num_removes): New static data member.(Free_list::num_remove_visits): New static data member.(Free_list::num_allocates): New static data member.(Free_list::num_allocate_visits): New static data member.(Free_list::init): New function.(Free_list::remove): New function.(Free_list::allocate): New function.(Free_list::dump): New function.(Free_list::print_stats): New function.(Layout_task_runner::run): Resize output file for incremental updates.(Layout::Layout): Initialize new data members.(Layout::set_incremental_base): New function.(Layout::init_fixed_output_section): New function.(Layout::layout_eh_frame): Do not build .eh_frame_hdr section forincremental updates.(Layout::create_gold_note): Do not create gold note section forincremental updates.(Layout::set_segment_offsets): Do not recalculate RELRO alignmentfor incremental updates.(Layout::set_section_offsets): For incremental updates, allocate spacefrom free list.(Layout::create_symtab_sections): Layout with offsets relative tostart of section; for incremental updates, allocate space from freelist.(Layout::create_shdrs): For incremental updates, allocate space fromfree list.(Layout::finish_dynamic_section): For incremental updates, do notcheck --as-needed (fixed in subsequent patch).* layout.h (class Free_list): New class.(Layout::set_incremental_base): New function.(Layout::incremental_base): New function.(Layout::init_fixed_output_section): New function.(Layout::allocate): New function.(Layout::incremental_base_): New data member.(Layout::free_list_): New data member.* main.cc (main): Print Free_list statistics.* object.cc (Relobj::finalize_incremental_relocs): Addclear_counts parameter; clear counts only when clear_counts is set.(Sized_relobj::Sized_relobj): Initialize new base class.(Sized_relobj::do_layout): Don't report special sections.(Sized_relobj::do_for_all_local_got_entries): New function.(Sized_relobj::write_local_symbols): Add symtab_off parameter; addsymtab_off to all symbol table offsets.(Sized_relobj::do_get_global_symbol_counts): Add typename keyword.* object.h (class Got_offset_list): Move to top of file.(Object::Object): Allow case where input_file == NULL.(Object::~Object): Likewise.(Object::input_file): Assert that input_file != NULL.(Object::lock): Allow case where input_file == NULL.(Object::unlock): Likewise.(Object::is_locked): Likewise.(Object::token): Likewise.(Object::release): Likewise.(Object::is_incremental): New function.(Object::get_mtime): New function.(Object::for_all_local_got_entries): New function.(Object::clear_view_cache_marks): Allow case where input_file == NULL.(Object::set_is_in_system_directory): New function.(Object::is_in_system_directory): New function.(Object::do_is_incremental): New function.(Object::do_get_mtime): New function.(Object::do_for_all_local_got_entries): New function.(Object::is_in_system_directory_): New data member.(Relobj::finalize_incremental_relocs): Add clear_counts parameter.(class Sized_relobj_base): New class.(class Sized_relobj): Derive from Sized_relobj_base.(class Sized_relobj::Symbols): Redeclare from base class.(class Sized_relobj::local_got_offset_list): Remove.(class Sized_relobj::Output_sections): Redeclare from base class.(class Sized_relobj::do_for_all_local_got_entries): New function.(class Sized_relobj::write_local_symbols): Add offset parameter.(class Sized_relobj::local_symbol_offset_): Update comment.(class Sized_relobj::local_dynsym_offset_): Update comment.* options.cc (Input_arguments::add_file): Remove const.* options.h (Input_file_argument::Input_file_argument):Initialize arg_serial_ (all constructors).(Input_file_argument::set_arg_serial): New function.(Input_file_argument::arg_serial): New function.(Input_file_argument::arg_serial_): New data member.(Input_arguments::Input_arguments): Initialize file_count_.(Input_arguments::add_file): Remove const.(Input_arguments::number_of_input_files): New function.(Input_arguments::file_count_): New data member.(Command_line::number_of_input_files): CallInput_arguments::number_of_input_files.* output.cc (Output_segment_headers::Output_segment_headers):Set current size.(Output_section::Input_section::current_data_size): New function.(Output_section::Output_section): Initialize new data members.(Output_section::add_input_section): Don't do merge sections foran incremental link; allocate space from free list for anincremental update.(Output_section::add_output_section_data): Allocate space fromfree list for an incremental update.(Output_section::update_data_size): New function.(Output_section::set_fixed_layout): New function.(Output_section::reserve): New function.(Output_segment::set_section_addresses): Remove const.(Output_segment::set_section_list_addresses): Remove const; allocatespace from free list for an incremental update.(Output_segment::set_offset): Adjust size of RELRO segment for anincremental update.* output.h (Output_data::current_data_size): Move here fromchild classes.(Output_data::pre_finalize_data_size): New function.(Output_data::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_data_strtab::update_data_size): New function.(Output_section::current_data_size): Move to Output_data.(Output_section::set_fixed_layout): New function.(Output_section::has_fixed_layout): New function.(Output_section::reserve): New function.(Output_section::update_data_size): New function.(Output_section::has_fixed_layout_): New data member.(Output_section::free_list_): New data member.(Output_segment::set_section_addresses): Remove const.(Output_segment::set_section_list_addresses): Remove const.* plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):New function.* plugin.h (Sized_pluginobj::do_for_all_local_got_entries):New function.* readsyms.cc (Read_symbols::do_read_symbols): Add libraryparameter when calling Add_symbols constructor; store argumentserial number for members of a lib group.(Add_symbols::locks): Allow case where token == NULL.(Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.(Read_member::~Read_member): New function.(Read_member::is_runnable): New function.(Read_member::locks): New function.(Read_member::run): New function.(Check_script::~Check_script): New function.(Check_script::is_runnable): New function.(Check_script::locks): New function.(Check_script::run): New function.(Check_library::~Check_library): New function.(Check_library::is_runnable): New function.(Check_library::locks): New function.(Check_library::run): New function.* readsyms.h (Add_symbols::Add_symbols): Add library parameter.(Add_symbols::library_): New data member.(class Read_member): New class.(class Check_script): New class.(class Check_library): New class.* reloc.cc (Read_relocs::is_runnable): Allow case wheretoken == NULL.(Read_relocs::locks): Likewise.(Scan_relocs::locks): Likewise.(Relocate_task::locks): Likewise.(Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocsto clear counters.(Sized_relobj::incremental_relocs_scan): Fix comment.(Sized_relobj::do_relocate): Pass output file offset towrite_local_symbols.(Sized_relobj::incremental_relocs_write_reltype): Use reloc_sizefrom class declaration.* script.cc (read_input_script): Allocate Script_info; passargument serial number to report_script.* script.h (class Script_info): Move to incremental.h.* symtab.cc (Symbol_table::add_from_incrobj): New function.* symtab.h (Symbol_table::add_from_incrobj): New function.(Symbol_table::set_file_offset): New function.2011-04-05 Cary Coutant <ccoutant@google.com>* incremental-dump.cc (dump_incremental_inputs): Change signatureto take a Sized_incremental_binary; change caller. Use readersin Sized_incremental_binary.* incremental.cc(Sized_incremental_binary::find_incremental_inputs_sections):Rename do_find_incremental_inputs_sections to this.(Sized_incremental_binary::setup_readers): New function.(Sized_incremental_binary::do_check_inputs): Checkhas_incremental_info_ flag; move setup code to setup_readers;use input readers.(Sized_incremental_binary::do_file_is_unchanged): New function.(Sized_incremental_binary::do_get_input_reader): New function.* incremental.h (class Incremental_binary): Move to end of file.(Incremental_binary::file_is_unchanged): New function.(Incremental_binary::do_file_is_unchanged): New function.(Incremental_binary::Input_reader): New class.(Incremental_binary::get_input_reader): New function.(class Sized_incremental_binary): Move to end of file.(Sized_incremental_binary::Sized_incremental_binary): Setup theinput section reader classes.(Sized_incremental_binary::has_incremental_info): New function.(Sized_incremental_binary::inputs_reader): New function.(Sized_incremental_binary::symtab_reader): New function.(Sized_incremental_binary::relocs_reader): New function.(Sized_incremental_binary::got_plt_reader): New function.(Sized_incremental_binary::do_file_is_unchanged): New function.(Sized_incremental_binary::Sized_input_reader): New class.(Sized_incremental_binary::get_input_reader): New function.(Sized_incremental_binary::find_incremental_inputs_sections):Rename do_find_incremental_inputs_sections to this.(Sized_incremental_binary::setup_readers): New function.(Sized_incremental_binary::has_incremental_info_): New data member.(Sized_incremental_binary::inputs_reader_): New data member.(Sized_incremental_binary::symtab_reader_): New data member.(Sized_incremental_binary::relocs_reader_): New data member.(Sized_incremental_binary::got_plt_reader_): New data member.(Sized_incremental_binary::current_input_file_): New data member.2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>PR gold/12640* dwarf_reader.cc (Sized_dwarf_line_info): Fix vector boundsviolation.2011-03-30 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::include_member): Adjust call to report_object.(Add_archive_symbols::run): Add script_info to call toreport_archive_begin.(Lib_group::include_member): Adjust call to report_object.(Add_lib_group_symbols::run): Adjust call to report_object.* incremental-dump.cc (dump_incremental_inputs): Remove unnecessaryblocks. Add object count for script input files.* incremental.cc (Incremental_inputs::report_archive_begin): Addscript_info parameter; change all callers.(Incremental_inputs::report_object): Add script_info parameter;change all callers.(Incremental_inputs::report_script): Store backpointer toincremental info entry.(Output_section_incremental_inputs::set_final_data_size): Recordadditional information for scripts.(Output_section_incremental_inputs::write_info_blocks): Likewise.* incremental.h (Incremental_script_entry::add_object): New function.(Incremental_script_entry::get_object_count): New function.(Incremental_script_entry::get_object): New function.(Incremental_script_entry::objects_): New data member; adjustconstructor.(Incremental_inputs::report_archive_begin): 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_offset): New function.* options.cc (Input_arguments::add_file): Return reference tonew input argument.* options.h (Input_argument::set_script_info): New function.(Input_argument::script_info): New function.(Input_argument::script_info_): New data member; adjust allconstructors.(Input_file_group::add_file): Return reference to new input argument.(Input_file_lib::add_file): Likewise.(Input_arguments::add_file): Likewise.* readsyms.cc (Add_symbols::run): Adjust call to report_object.* script.cc (Parser_closure::Parser_closure): Add script_infoparameter; adjust all callers.(Parser_closure::script_info): New function.(Parser_closure::script_info_): New data member.(read_input_script): Report scripts earlier to incremental info.(script_add_file): Set script_info in Input_argument.(script_add_library): Likewise.* script.h (Script_options::Script_info): Rewrite class.2011-03-29 Cary Coutant <ccoutant@google.com>* archive.cc (Library_base::should_include_member): Movemethod here from class Archive.(Archive::Archive): Initialize base class.(Archive::should_include_member): Move to base class.(Archive::do_for_all_unused_symbols): New function.(Add_archive_symbols::run): Remove redundant access toincremental_inputs.(Lib_group::Lib_group): Initialize base class.(Lib_group::do_filename): New function.(Lib_group::include_member): Pass pointer to Lib_group toreport_object.(Lib_group::do_for_all_unused_symbols): New function.(Add_lib_group_symbols::run): Report archive information forincremental links.* archive.h (class Library_base): New base class.(class Archive): Derive from Library_base.(Archive::filename): Move to base class.(Archive::set_incremental_info): Likewise.(Archive::incremental_info): Likewise.(Archive::Should_include): Likewise.(Archive::should_include_member): Likewise.(Archive::Armap_entry): Remove.(Archive::Unused_symbol_iterator): Remove.(Archive::unused_symbols_begin): Remove.(Archive::unused_symbols_end): Remove.(Archive::do_filename): New function.(Archive::do_get_mtime): New function.(Archive::do_for_all_unused_symbols): New function.(Archive::task_): Move to base class.(Archive::incremental_info_): Likewise.(class Lib_group): Derive from Library_base.(Lib_group::do_filename): New function.(Lib_group::do_get_mtime): New function.(Lib_group::do_for_all_unused_symbols): New function.(Lib_group::task_): Move to base class.* dynobj.cc (Sized_dynobj::do_for_all_global_symbols): Newfunction.* dynobj.h (Sized_dynobj::do_for_all_global_symbols): Newfunction.* incremental.cc (Incremental_inputs::report_archive_begin):Use Library_base; call library's get_mtime; add incremental inputsentry before members.(class Unused_symbol_visitor): New class.(Incremental_inputs::report_archive_end): Use Library_base; usevisitor class to record unused symbols; don't add incremental inputsentry after members.(Incremental_inputs::report_object): Use Library_base.* incremental.h(Incremental_archive_entry::Incremental_archive_entry): Removeunused Archive parameter.(Incremental_inputs::report_archive_begin): Use Library_base.(Incremental_inputs::report_archive_end): Likewise.(Incremental_inputs::report_object): Likewise.* object.cc (Sized_relobj::do_for_all_global_symbols): Newfunction.* object.h (Object::for_all_global_symbols): New function.(Object::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): Newfunction.* plugin.h (Sized_pluginobj::do_for_all_global_symbols): Newfunction.2011-03-27 Ian Lance Taylor <iant@google.com>* archive.cc (Archive::interpret_header): Return -1 if somethinggoes wrong. Change callers accordingly.2011-03-25 Cary Coutant <ccoutant@google.com>* testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.* testsuite/Makefile.in: Regenerate.2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>* plugin.cc (get_view): New.(Plugin::load): Pass get_view to the plugin.(Plugin_manager::get_view): New.2011-03-21 Ian Lance Taylor <iant@google.com>* testsuite/final_layout.sh: Rewrite to not use dc.* testsuite/relro_test.sh: Fail if dc is not present.2011-03-21 Sriraman Tallam <tmsriram@google.com>* testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.Change == to -eq.* testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.* testsuite/icf_safe_test.sh: Add #!/bin/sh to start.Change == to -eq.* testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.* testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.2011-03-14 Ian Lance Taylor <iant@google.com>* script-sections.cc (Sort_output_sections::script_compare):Rename from is_before, change return type.(Sort_output_sections::operator()): Adjust accordingly.2011-03-11 Jeffrey Yasskin <jyasskin@google.com>PR gold/12572* testsuite/odr_violation2.cc: Add comment to make all error linenumbers double digits.* testsuite/debug_msg.sh: Adjust expected errors.2011-03-09 Jeffrey Yasskin <jyasskin@google.com>* dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,but mark earlier ones as non-canonical(offset_to_iterator): Update search target and example(do_addr2line): Return extra lines in a vector*(format_file_lineno): Extract from do_addr2line(one_addr2line): Add vector* out-param* dwarf_reader.h (Offset_to_lineno_entry): New field recordingwhen a lineno entry appeared last for its instruction(Dwarf_line_info): Add vector* out-param* object.cc (Relocate_info): Pass NULL for the vector* out-param* symtab.cc (Odr_violation_compare): Include the lineno in thecomparison again.(linenos_from_loc): New. Combine the canonical line for anaddress with its other lines.(True_if_intersect): New. Helper functor to makestd::set_intersection a query.(detect_odr_violations): Compare sets of lines instead of justone line for each function. This became less deterministic, buthas fewer false positives.* symtab.h: Declarations.* testsuite/Makefile.am (odr_violation2.o): Compile with -O2 tomix an optimized and non-optimized object in the same binary(odr_violation2.so): Same.* testsuite/Makefile.in: Regenerate from Makefile.am.* testsuite/debug_msg.cc (main): Make OdrDerived classes.* testsuite/debug_msg.sh: Update line numbers and addassertions.* testsuite/odr_violation1.cc: Use OdrDerived, in anon-optimized context.* testsuite/odr_violation2.cc: Make sure Ordering::operator()isn't inlined, and use OdrDerived in an optimized context.* testsuite/odr_header1.h: Defines OdrDerived, whereoptimization will change thefirst-instruction-in-the-destructor's file and line number.* testsuite/odr_header2.h: Defines OdrBase.2011-03-09 Ian Lance Taylor <iant@google.com>* fileread.cc (File_read::clear_views): Don't delete the wholefile view.2011-03-08 Ian Lance Taylor <iant@google.com>PR gold/12525* fileread.cc: #include <climits>.(GOLD_IOV_MAX): Define.(File_read::read_multiple): Limit number of entries by iov_max.* fileread.h (class File_read): Always set max_readv_entries to128.2011-03-07 Ian Lance Taylor <iant@google.com>PR gold/12525* options.h (class General_options): Add -dy and -dn.2011-03-02 Cary Coutant <ccoutant@google.com>* testsuite/script_test_9.t: Add TLS segment.2011-03-02 Simon Baldwin <simonb@google.com>* configure.ac: Add check for gnu_indirect_function support inthe toolchain building binutils.* configure: Rebuild.2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>* symtab.cc (Symbol::should_add_dynsym_entry) Return false forplugin only symbols.(Symbol_table::sized_finalize_symbol) Mark symbol only presentin plugin files as not needed in the symbol table.2011-02-11 Sriraman Tallam <tmsriram@google.com>* output.cc (Output_section::add_input_section): Delay fillgeneration for section ordering.2011-02-09 Ian Lance Taylor <iant@google.com>PR gold/12316* object.h (class Sized_relobj): Remove clear_local_symbols.* reloc.cc (Sized_relobj::do_relocate): Don't callclear_local_symbols.2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>* plugin.cc (is_visible_from_outside): Return true for symbolsin the -u option.2011-02-04 Jeffrey Yasskin <jyasskin@google.com>* symtab.cc (Odr_violation_compare::operator()): Sort by just thefilename.2011-02-02 Sriraman Tallam <tmsriram@google.com>* icf.h (is_section_foldable_candidate): Change type of parameterto std::string.* icf.cc (Icf::find_identical_sections): Change type of local variablesection_name to be std::string.(is_function_ctor_or_dtor): Change type of parameter to std::string.2011-01-25 Ian Lance Taylor <iant@google.com>* script.cc (script_add_extern): Rewrite to useadd_symbol_reference.2011-01-25 Doug Kwan <dougkwan@google.com>* icf.cc (get_section_contents): Always lock section's object.2011-01-24 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Accept--no-detect-odr-violations.2011-01-24 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Bump to 1.11.2011-01-24 Ian Lance Taylor <iant@google.com>* plugin.cc (class Plugin_rescan): Define new class.(Plugin_manager::claim_file): Set any_claimed_.(Plugin_manager::save_archive): New function.(Plugin_manager::save_input_group): New function.(Plugin_manager::all_symbols_read): Create Plugin_rescan task ifnecessary.(Plugin_manager::new_undefined_symbol): New function.(Plugin_manager::rescan): New function.(Plugin_manager::rescannable_defines): New function.(Plugin_manager::add_input_file): Set any_added_.* plugin.h (class Plugin_manager): define new fields rescannable_,undefined_symbols_, any_claimed_, and any_added_. DeclarePlugin_rescan as friend. Declare new functions.(Plugin_manager::Rescannable): Define type.(Plugin_manager::Rescannable_list): Define type.(Plugin_manager::Undefined_symbol_list): Define type.(Plugin_manager::Plugin_manager): Initialize new fields.* archive.cc (Archive::defines_symbol): New function.(Add_archive_symbols::run): Pass archive to plugins if any.* archive.h (class Archive): Declare defines_symbol.* readsyms.cc (Input_group::~Input_group): New function.(Finish_group::run): Pass input_group to plugins if any.* readsyms.h (class Input_group): Declare destructor.* symtab.cc (add_from_object): Pass undefined symbol to plugins ifany.2011-01-10 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::layout_eh_frame): Mark a writable .eh_framesection as relro.(Layout::set_segment_offsets): Reset increase_relro before callingset_section_addresses a second time.2011-01-04 Cary Coutant <ccoutant@google.com>* script-sections.cc (Sort_output_sections::operator()): Sort TLSsections before NOBITS sections.2011-01-01 H.J. Lu <hongjiu.lu@intel.com>* version.cc (print_version): Update copyright to 2011.2010-12-23 Cary Coutant <ccoutant@google.com>* output.h (Output_data_reloc::add_output_section): Pass OD insteadof OS to this->add. Add OD parameter to second form of the function.2010-12-20 Ian Lance Taylor <iant@google.com>* dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keepsecond of two consecutive entries with same offset.2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* testsuite/Makefile.am (ifuncmain2static_LDADD)(ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)(ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,to avoid unneeded links against $(LDADD).* testsuite/Makefile.in: Regenerate.2010-12-15 Ian Lance Taylor <iant@google.com>PR gold/12324* x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an errorfor R_X86_64_32 and R_X86_64_PC32.* testsuite/Makefile.am (ver_matching_def.so): Depend on and usever_matching_def_pic.o.(ver_matching_def_pic.o): New target.2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* fileread.cc (file_counts_lock, file_counts_initialize_lock)(total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):Move definition before File_read::View member definitions.(File_read::View::~View): Initialize and hold lock beforeupdating current_mapped_bytes.2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* dwarf_reader.cc: Remove outdated comment.* gold-threads.cc: Fix typo in error message.* archive.cc: Fix typos in comments.* archive.h: Likewise.* arm-reloc-property.cc: Likewise.* arm-reloc-property.h: Likewise.* arm-reloc.def: Likewise.* arm.cc: Likewise.* attributes.h: Likewise.* cref.cc: Likewise.* ehframe.cc: Likewise.* fileread.h: Likewise.* gold.h: Likewise.* i386.cc: Likewise.* icf.cc: Likewise.* incremental.h: Likewise.* int_encoding.cc: Likewise.* layout.h: Likewise.* main.cc: Likewise.* merge.h: Likewise.* object.cc: Likewise.* object.h: Likewise.* options.cc: Likewise.* readsyms.cc: Likewise.* reduced_debug_output.cc: Likewise.* reloc.cc: Likewise.* script-sections.cc: Likewise.* sparc.cc: Likewise.* symtab.h: Likewise.* target-reloc.h: Likewise.* target.cc: Likewise.* target.h: Likewise.* timer.cc: Likewise.* timer.h: Likewise.* x86_64.cc: Likewise.2010-12-09 Cary Coutant <ccoutant@google.com>* layout.cc (Layout::layout_gnu_stack): Add warnings for executablestack.* layout.h (Layout::layout_gnu_stack): Add pointer to Objectparameter; change all callers.* object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.* options.h (warn_execstack): New option.2010-12-07 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31like function call relocations.2010-12-07 Ian Lance Taylor <iant@google.com>* archive.cc (Archive::get_elf_object_for_member): Permitpunconfigured to be NULL.(Archive::read_symbols): Pass NULL to get_elf_object_for_member.(Archive::include_member): Pass NULL to get_elf_object_for_memberif we searched for the archive and this is the first includedobject.2010-12-01 Ian Lance Taylor <iant@google.com>* dwarf_reader.h (class Sized_dwarf_line_info): Addtrack_relocs_type_ field.* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Set track_relocs_type_.(Sized_dwarf_line_info::process_one_opcode): Ignore the sectioncontents when using RELA relocs.(Sized_dwarf_line_info::read_relocs): Add the reloc addend toreloc_map_.* reloc.cc (Track_relocs::next_addend): New function.* reloc.h (class Track_relocs): Declare next_addend.2010-12-01 Ian Lance Taylor <iant@google.com>* testsuite/icf_virtual_function_folding_test.cc (class Bar): Addvirtual destructor.2010-12-01 Ian Lance Taylor <iant@google.com>* README: Update compilers known to work and fail.2010-11-23 Matthias Klose <doko@ubuntu.com>* configure.in: For --enable-gold, handle value `default' instead of`both*'. Always install ld as ld.bfd, install as ld if gold isnot the default.* configure: Regenerate.2010-11-18 Doug Kwan <dougkwan@google.com>* expression.cc (BINARY_EXPRESSION): Initialize left_alignmentand right_alignment to be zero. Store result alignment only if it isgreater than existing alignment.2010-11-16 Cary Coutant <ccoutant@google.com>PR gold/12220* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Check for ".zdebug_line".2010-11-16 Doug Kwan <dougkwan@google.com>Cary Coutant <ccoutant@google.com>* output.h (Output_segment::set_section_addresses): Pass increase_relroby reference; adjust all callers.* output.cc (Output_segment::set_section_addresses): Adjust referencesto increase_relro. Add padding to *increase_relro when ORDER_RELRO_LASTlist is empty.(Output_segment::set_offset): Assert if PT_GNU_RELRO segment does notend at page boundary.2010-11-16 Cary Coutant <ccoutant@google.com>PR gold/12220* layout.cc (Layout::choose_output_section): Transform names ofcompressed sections even when using a script with a SECTIONS clause.(Layout::output_section_name): Remove code to transformcompressed debug section names.* output.cc (Output_section::add_input_section): Use uncompressedsection size when tracking input sections.2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>* symtab.h (Symbol::NON_PIC_REF): Remove.(Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.(Symbol::FUNCTION_CALL): Renumber. Reword comment.(Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.(Symbol::use_plt_offset): Take a flags argument and pass itdirectly to needs_dynamic_reloc. Restrict check for undefinedweak symbols to function calls.* arm.cc (Target_arm::Scan::get_reference_flags): New function.(Target_arm::Scan::global): Use it.(Target_arm::Scan::scan_reloc_for_stub): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm::Relocate::should_apply_static_reloc): Replace flagsparameter with an r_type parameter. Use get_reference_flagsto get the flags.(Target_arm::Relocate::relocate): Update accordingly.* i386.cc (Target_i386::Scan::get_reference_flags): New function.(Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.(Target_i386::Scan::global): Likewise.(Target_i386::Relocate::relocate): Likewise.(Target_i386::Relocate::should_apply_static_reloc): Replace flagsparameter with an r_type parameter. Use get_reference_flagsto get the flags.(Target_i386::Relocate::relocate): Update accordingly.* powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.(Target_powerpc::Scan::global): Use it.(Target_powerpc::Scan::scan_reloc_for_stub): Likewise.(Target_powerpc::Relocate::relocate): Likewise.* sparc.cc (Target_sparc::Scan::get_reference_flags): New function.(Target_sparc::Scan::global): Use it.(Target_sparc::Scan::scan_reloc_for_stub): Likewise.(Target_sparc::Relocate::relocate): Likewise.* 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::global): Likewise.(Target_x86_64::Relocate::relocate): Likewise.2010-11-08 Doug Kwan <dougkwan@google.com>Cary Coutant <ccoutant@google.com>* arm.cc (Arm_exidx_merge_section::build_contents): New method.(Arm_exidx_merge_section::section_contents_): New data member.(Arm_input_section::Arm_input_section): Initialize original_contents_.(Arm_input_section::~Arm_input_section): De-allocate memory.(Arm_input_section::original_contents_): New data member.(Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contentsin parameters instead of calling Object::section_contents withoutlocking.(Arm_output_section::group_section): New parameter TASK. Pass itto callees that need locking objects.(Arm_output_section::fix_exidx_coverage): New parameter TASK. Use itto lock EXIDX input sections. Fix a formatting issue. CallArm_exidx_merged_section::build_contents to create merged sectioncontents.(Arm_output_section::create_stub_group): New parameter TASK. Use itto lock object of stub table owner.(Arm_exidx_input_section::Arm_exidx_input_section): Add new parameterTEXT_SIZE to initialize data member TEXT_SIZE_.(Arm_exidx_input_section::addralign): Fix typo in comment.(Arm_exidx_input_section::text_size): New method.(Target_arm::do_relax): New parameter TASK. Pass it to calleesthat require locking objects. Lock objects before scanning for stubsand updating local symbols.(Arm_input_section<big_endian>::init): Copy contents of originalinput section.(Arm_input_section<big_endian>::do_write): Use saved contents oforiginal input section instead of calling Object::section_contentswithout locking.(Arm_exidx_cantunwind::do_fixed_endian_write): Find out text sectionsize without calling Object::section_size().(Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity checkfor size. Allocate a buffer for merged EXIDX entries.(Arm_exidx_merged_section::build_contents): New method.(Arm_exidx_merged_section::do_write): Move merge section contentsbuilding code to Arm_exidx_merged_section::build_contetns. Writeout contetns in buffer instead of building it on the fly.(Arm_relobj::make_exidx_input_section): Also pass text section sizeto Arm_exidx_input_section constructor.(Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.(Arm_dynobj::do_read_symbols): Fix memory leak.* layout.cc (Layout::finalize): Pass TASK to Target::relax().* target.h: (class Task): Add forward declaration.(Target::relax): Add new parameter TASK and pass it toTarget::do_relax().(Target::do_relax):: New parameter TASK. Fix a formatting issue.2010-11-05 Cary Coutant <ccoutant@google.com>PR gold/10708* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on theobject when reading from the file.* gold.cc (queue_middle_tasks): Hold a lock on the object when doingsecond layout pass.* icf.cc (preprocess_for_unique_sections): Hold a lock on the objectwhen reading section contents.(get_section_contents): Likewise.(icf::find_identical_sections): Likewise.* mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on theobject when reading from the file.* plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock onthe object when doing deferred section layout.2010-11-03 Nick Clifton <nickc@redhat.com>PR gold/12001* script.h (class Symbol_assignment: name): New member. Returnsthe name of the symbol.* scrfipt.cc (Script_options::is_pending_assignment): New member.Returns true if the given symbol name is on the list ofassignments wating to be processed.* archive.cc (should_incldue_member): If the symbol is undefined,check to see if it is on the list of symbols pending assignment.2010-11-03 Ryan Mansfield <rmansfield@qnx.com>* script-sections.cc (Script_sections::find_memory_region): Checkfor a NULL output section pointer.2010-10-29 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call toOutput_section::add_relaxed_input_section.* output.cc (Output_section::add_relaxed_input_section): Add newarguments LAYOUT and NAME. Set section order index.(Output_section::convert_input_sections_in_list_to_relaxed_sections):Copy section order index.* output.h (Output_section::add_relaxed_input_section): Add newarguments LAYOUT and NAME.2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>* testsuite/Makefile.am: Move gcctestdir/ld rule toNATIVE_OR_CROSS_LINKER.* testsuite/Makefile.in: Regenerate.2010-10-20 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sectionswithout SHF_LINK_ORDER flags.* layout.cc (Layout::choose_output_section): Do not filterSHF_LINK_ORDER flag in a relocatable link.2010-10-17 Cary Coutant <ccoutant@google.com>* output.h (Output_segment::set_section_addresses): Change functionsignature. Update all callers.* output.cc (Output_segment::is_first_section_relro): Ignore TLSsections.(Output_segment::set_section_addresses): Align after last TLSsection. Add padding before last relro section instead of after.2010-10-17 Doug Kwan <dougkwan@google.com>* gold/arm.cc (Target_arm::got_section): Use correct order and setGOT output section to be writable.2010-10-14 Cary Coutant <ccoutant@google.com>* debug.h (DEBUG_INCREMENTAL): New flag.(debug_string_to_enum): Add DEBUG_INCREMENTAL).* gold.cc (queue_initial_tasks): Check parameters for incremental linkmode.* incremental.cc (report_command_line): Ignore all forms of--incremental.* layout.cc (Layout::Layout): Check parameters for incremental linkmode.* options.cc (General_options::parse_incremental): New function.(General_options::parse_no_incremental): New function.(General_options::parse_incremental_full): New function.(General_options::parse_incremental_update): New function.(General_options::incremental_mode_): New data member.(General_options::finalize): Check incremental_mode_.* options.h (General_options): Update help text for --incremental.Add --no-incremental, --incremental-full, --incremental-update.(General_options::Incremental_mode): New enum type.(General_options::incremental_mode): New function.(General_options::incremental_mode_): New data member.* parameters.cc (Parameters::incremental_mode_): New data member.(Parameters::set_options): Set incremental_mode_.(Parameters::set_incremental_full): New function.(Parameters::incremental): New function.(Parameters::incremental_update): New function.(set_parameters_incremental_full): New function.* parameters.h (Parameters::set_incremental_full): New function.(Parameters::incremental): New function.(Parameters::incremental_update): New function.(Parameters::incremental_mode_): New data member.(set_parameters_incremental_full): New function.* plugin.cc (Plugin_manager::add_input_file): Check parameters forincremental link mode.* reloc.cc (Sized_relobj::do_read_relocs): Likewise.(Sized_relobj::do_relocate_sections): Likewise.* testsuite/Makefile.am (incremental_test): Use --incremental-fulloption.* testsuite/Makefile.in: Regenerate.* testsuite/incremental_test.sh: Filter all forms of --incremental.2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>* script-sections.h (class Script_sections): MakeSections_elements typedef public.* script-sections.cc (class Sort_output_sections): Add elements_field. Add constructor which sets it; change all callers.(Sort_output_sections::is_before): New function.(Sort_output_sections::operator()): Call is_before.* configure.ac (NATIVE_OR_CROSS_LINKER): New automakeconditional.* testsuite/script_test_10.sh: New test. Test script sectionorder.* testsuite/script_test_10.t: Likewise.* testsuite/script_test_10.s: Likewise.* testsuite/Makefile.am: Wrap the cross linker tests and thecommon tests into NATIVE_OR_CROSS_LINKER.(check_SCRIPTS): Add script_test_10.sh.(check_DATA): Add script_test_10.stdout.(script_test_10.o, script_test_10): New targets.(script_test_10.stdout): New target.* configure, testsuite/Makefile.in: Regenerate.2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Target_arm::Scan::local): Report the unsupported relocerror for the deprecated relocations.(Target_arm::Scan::global): Likewise.(Target_arm::Relocate::relocate): Likewise.2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>* fileread.cc (Input_file::find_file): Initialize *found_nameand *namep when using the fallback search for case 4.2010-10-11 Cary Coutant <ccoutant@google.com>* options.h (class General_options): Redefine -z lazy as an alias forthe negation of -z now.2010-10-11 Ian Lance Taylor <iant@google.com>* resolve.cc (symbol_to_bits): Report the value of the unsupportedbinding.2010-10-06 Nick Clifton <nickc@redhat.com>* script-sections.cc(class Memory_region): Removecurrent_lma_offset_ field. Rename current_vma_offset_ tocurrent_offset_. Add last_section_ field.(Memory_region::get_current_vma_address): Rename toget_current_address.(Memory_region::get_current_lma_address): Delete.(Memory_region::increment_vma_offset): Rename toincrement_offset.(Memory_region::increment_lma_offset): Delete.(Memory_region::attributes_compatible): New method. Returnstrue if the provided section is compatible with the region.(Memory_region::get_last_section): New method. Returns the lastsection to use the region.(Memory_region::set_last_section): New method. Stores the lastsection to use the region.(Script_sections::block_in_region): New method. Returns true ifa block of memory is contained within a region.(Script_sections::find_memory_region): New method. Locates amemory region to be used to set a VMA or LMA address.(Output_section_definition::set_section_addresses): Add code tocheck for addresses set by memory regions.(Output_segment::set_section_addresses): Remove memory regionwalking code.(Script_sections::create_segment): Add a warning if a headersegment is created outside of any region.* script-sections.h (class Script_sections): Add prototypes forfind_memory_region and block_in_region methods.* testsuite/memory_test.s: Use .long instead of .word.* testsuite/memory_test.t: Add some more output sections.* testsuite/memory_test.sh: Update expected output.2010-10-02 Doug Kwan <dougkwan@google.com>* symtab.cc (Symbol_table::Symbol_table_hash::operator()): Movedefintion to symtab.h* symtab.h (Symbol_table::Symbol_table_hash::operator()): Changedeclaration to defintion.2010-10-01 Nick Clifton <nickc@redhat.com>* expression.cc (eval): Replace dummy argument with NULL.(eval_maybe_dot): Check for a NULL result section pointer.(Symbol_expression::value): Likewise.(Dot_expression::value): Likewise.(BINARY_EXPRESSION): Likewise.(Max_expression::value): Likewise.(Min_expression::value): Likewise.(Absolute_expression::value): Likewise.(Addr_expression::value_from_output_section): Likewise.(Loaddddr_expression::value_from_output_section): Likewise.(Segment_start_expression::value): Likewise.* script-sections.cc(Sections_elememt_dot_assignment::finalize_symbols): Replace dummyargument with NULL.(Sections_elememt_dot_assignment::set_section_addresses):Likewise.(Output_data_expression::do_write_to_buffer): Likewise.(Output_section_definition::finalize_symbols): Likewise.(Output_section_definition::set_section_addresses): Likewise.2010-09-30 Doug Kwan <dougkwan@google.com>* gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.2010-09-28 Sriraman Tallam <tmsriram@google.com>* target.h (Target::can_icf_inline_merge_sections): New virtualfunction.* x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): Newvirtual function.* i386.cc (Target_i386::can_icf_inline_merge_sections): Newvirtual function.* icf.cc (get_section_contents): Inline merge sections only whentarget allows it.2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* configure: Regenerate.2010-09-17 Ian Lance Taylor <iant@google.com>* testsuite/memory_test.sh: Adjust for change of 2010-09-10.* testsuite/Makefile.am (memory_test.o): New target.(memory_test): Depend on memory_test.o, gcctestdir/ld, andmemory_test.t.* testsuite/Makefile.in: Rebuild.2010-09-17 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Relocate::relocate): Ignore symbol type anddefintion if relocation uses GOT entries of the symbol.* testsuite/icf_safe_test.sh: Fix test.* testsuite/icf_safe_so_test.sh: Fix test.2010-09-16 Cary Coutant <ccoutant@google.com>* script_sections.cc (class Memory_region): Remove "NULL" fromvector initializations.2010-09-15 Cary Coutant <ccoutant@google.com>* incremental.cc (Output_section_incremental_inputs::write_info_blocks):Resolve forwarding symbols.2010-09-15 Doug Kwan <dougkwan@google.com>* gold/testsuite/script_test_3.t: Add ARM special sections.* gold/testsuite/script_test_4.t: Same.* gold/testsuite/script_test_5.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/thumb_blx_out_of_range.s: Fix instruction alignment.2010-09-14 Cary Coutant <ccoutant@google.com>* x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.(Target_x86_64::Relocate::relocate_tls): Replace check forsaw_tls_block_reloc_ with test for executable section.2010-09-12 Cary Coutant <ccoutant@google.com>* symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls fromposition-independent executables to shared libraries need dynamicrelocations.(Symbol::may_need_copy_reloc): Do not generate COPY relocs inposition-independent executables.* testsuite/Makefile.am (two_file_mixed_pie_test): New test.* testsuite/Makefile.in: Regenerate.2010-09-10 Nick Clifton <nickc@redhat.com>PR gold/11997* testsuite/memory_test.t: Discard any sections that are notneeded.2010-09-09 H.J. Lu <hongjiu.lu@intel.com>PR gold/11996* object.cc (Sized_relobj::do_finalize_local_symbols): Remove"This::" to work around a bug in gcc 4.2.* testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).2010-09-09 Rafael Espindola <espindola@google.com>* layout.cc (Layout::attach_allocated_section_to_segment): Don't putsections with different PF_X flags in the same segment.(Layout::find_first_load_seg): Search all segments to find the firstone.* options.h (rosegment): New.2010-09-08 Rafael Espindola <espindola@google.com>* layout.cc (Layout::set_segment_offsets): Always advance to a new page.2010-09-08 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.(Arm_relobj::do_relocate_sections): Add new parameter for outputfile to match the parent.(Target_arm::scan_reloc_section_for_stubs): Use would-be final valuesof local symbols instead of input values. Update code to trackchanges in gold::relocate_section.* object.cc (Sized_relobj::compute_final_local_value): New methods.(Sized_relobj::compute_final_local_value_internal): New methods.(Sized_relobj::do_finalize_local_symbols): Move code from loopbody into private version of Sized_relobj::compute_final_local_value.Call the inline method.* object.h (Symbol_value::Symbol_value): Define destructor. Freemerged symbol value if there is one.(Symbol_value::has_output_value): New method defintiion.(Sized_relobj::Compute_final_local_value_status): New enum type.(Sized_relobj::compute_final_local_value): New methods.(Sized_relobj::compute_final_local_value_internal): New methods.* Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.shand arm_cortex_a8.sh.(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):New tests.* Makefile.in: Regenerate.* testsuite/arm_bl_out_of_range.s: Update test.* testsuite/thumb_bl_out_of_range.s: Ditto.* testsuite/thumb_blx_out_of_range.s: Ditto.* testsuite/arm_branch_out_of_range.sh: New file.* testsuite/arm_cortex_a8.sh: Ditto.* testsuite/arm_cortex_a8_b.s: Ditto.* testsuite/arm_cortex_a8_b_cond.s: Ditto.* testsuite/arm_cortex_a8_b_local.s: Ditto.* testsuite/arm_cortex_a8_bl.s: Ditto.* testsuite/arm_cortex_a8_blx.s: Ditto.* testsuite/arm_cortex_a8_local.s: Ditto.* testsuite/arm_cortex_a8_local_reloc.s: Ditto.* testsuite/thumb_bl_out_of_range_local.s: Ditto.2010-09-08 Rafael Espindola <espindola@google.com>* Makefile.am (memory_test.stdout): Run readelf with -W.* Makefile.in: Regenerate.* testsuite/memory_test.sh: Make the regexps accept both 32 and64 bit output.2010-09-08 Rafael Espindola <espindola@google.com>* script-sections.cc (Script_sections::add_memory_region): Convertfield precision to int.* script.cc (script_set_section_region, script_set_section_region):Convert field precision to int.2010-09-08 Rafael Espindola <espindola@google.com>* arm.cc (do_finalize_sections): Create the __exidx_start and__exdix_end symbols even when the section is missing.2010-09-08 Nick Clifton <nickc@redhat.com>* README: Remove claim that MEMORY is not supported.* expression.cc (script_exp_function_origin)(script_exp_function_length): Move from here to ...* script.cc: ... here.(script_set_section_region, script_add_memory)(script_parse_memory_attr, script_include_directive): Newfunctions.* script-sections.cc(class Memory_region): New class.(class Output_section_definition): Add set_memory_region,set_section_vma, set_section_lma and get_section_name methods.(class Script_Sections): Add add_memory_region,find_memory_region, find_memory_region_origin,find_memory_region_length and set_memory_region methods.Have set_section_addresses method walk the list of set memoryregions.Extend the print methos to display memory regions.* script-sections.h: Add prototypes for new methods.Add enum for MEMORY region attributes.* yyscript.y: Add support for parsing MEMORY regions.* script-c.h: Add prototypes for new functions.* testsuite/Makefile.am: Add test of MEMORY region functionality.* testsuite/Makefile.in: Regenerate.* testsuite/memory_test.sh: New script.* testsuite/memory_test.s: New assembler source file.* testsuite/memory_test.t: New linker script.2010-08-27 Doug Kwan <dougkwan@google.com>* gold/resolve.cc (Symbol_table::should_override): Let a weakreference override an existing dynamic weak reference.* testsuite/Makefile.am: Add new test dyn_weak_ref.* testsuite/Makefile.in: Regenerate.* testsuite/dyn_weak_ref.sh: New file.* testsuite/dyn_weak_ref_1.c: Ditto.* testsuite/dyn_weak_ref_2.c: Ditto.2010-08-27 Ian Lance Taylor <iant@google.com>* incremental.h (class Incremental_input_entry): Add virtualdestructor.2010-08-27 Ian Lance Taylor <iant@google.com>* testsuite/start_lib_test_3.c: Mark t3 as used.2010-08-27 Nick Clifton <nickc@redhat.com>* options.cc (version_script): Fix small typo in previouswhitespace tidyup.2010-08-25 Nick Clifton <nickc@redhat.com>* archive.cc: Formatting fixes: Remove whitespace betweentypename and following asterisk. Remove whitespace betweenfunction name and opening parenthesis.* archive.h: Likewise.* arm.cc: Likewise.* attributes.cc: Likewise.* attributes.h: Likewise.* common.cc: Likewise.* copy-relocs.cc: Likewise.* dirsearch.h: Likewise.* dynobj.cc: Likewise.* ehframe.cc: Likewise.* ehframe.h: Likewise.* expression.cc: Likewise.* fileread.cc: Likewise.* fileread.h: Likewise.* gc.h: Likewise.* gold-threads.cc: Likewise.* gold.cc: Likewise.* i386.cc: Likewise.* icf.h: Likewise.* incremental-dump.cc: Likewise.* incremental.cc: Likewise.* layout.cc: Likewise.* layout.h: Likewise.* main.cc: Likewise.* merge.cc: Likewise.* merge.h: Likewise.* object.cc: Likewise.* object.h: Likewise.* options.cc: Likewise.* options.h: Likewise.* output.cc: Likewise.* output.h: Likewise.* plugin.cc: Likewise.* plugin.h: Likewise.* powerpc.cc: Likewise.* reloc.cc: Likewise.* script-c.h: Likewise.* script-sections.cc: Likewise.* script.cc: Likewise.* stringpool.cc: Likewise.* symtab.cc: Likewise.* symtab.h: Likewise.* target.cc: Likewise.* timer.cc: Likewise.* timer.h: Likewise.* version.cc: Likewise.* x86_64.cc: Likewise.2010-08-24 Nick Clifton <nickc@redhat.com>PR 11899* layout.cc (segment_precedes): Sort segments by their physicaladdresses, if they have been set.2010-08-23 Cary Coutant <ccoutant@google.com>* archive.cc (Lib_group::add_symbols): Lock object before deleting itssymbols data.(Lib_group::include_member): Unlock object after deleting itssymbols data.* testsuite/start_lib_test_3.c: Remove all global symbols to triggerthe bug fixed here.2010-08-19 Neil Vachharajani <nvachhar@google.com>Cary Coutant <ccoutant@google.com>* gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjustconstructor, and set_blocker.* gold/archive.cc (Add_lib_group_symbols::is_runnable): Also checkreadsyms_blocker_.* gold/readsyms.cc (Read_symbols::do_lib_group): Also passthis->this_blocker_ to Add_lib_group_symbols::set_blocker.* testsuite/Makefile.am (start_lib_test): New test case.* testsuite/Makefile.in: Regenerate.* testsuite/start_lib_test_main.c: New file.* testsuite/start_lib_test_1.c: New file.* testsuite/start_lib_test_2.c: New file.* testsuite/start_lib_test_3.c: New file.2010-08-19 Ian Lance Taylor <iant@google.com>* Makefile.in: Rebuild with automake 1.11.1.* aclocal.m4: Likewise.* testsuite/Makefile.in: Likewise.2010-08-19 Ian Lance Taylor <iant@google.com>PR 10893* i386.cc (class Output_data_plt_i386): Update declarations.Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ andlocal_ifuncs_ fields.(Target_i386::do_plt_section_for_global): New function.(Target_i386::do_plt_section_for_local): New function.(Output_data_plt_i386::Output_data_plt_i386): Add symtabparameter; change all callers. Initialize global_ifuncs_ andlocal_ifuncs_. If doing a static link define __rel_iplt_start and__rel_iplt_end.(Output_data_plt_i386::add_entry): Handle IFUNC symbols.(Output_data_plt_i386::add_local_ifunc_entry): New function.(Output_data_plt_i386::do_write): Fix GOT entries for IFUNCsymbols.(Target_i386::make_plt_section): New function, broken out ofmake_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_local_ifunc_plt_entry): New function.(Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.(Target_i386::Scan::local): Handle IFUNC symbols. AddR_386_IRELATIVE to switch.(Target_i386::Scan::global): Likewise.(Target_i386::Relocate::relocate): Likewise.(Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE toswitch.* 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_local): New function.(Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtabparameter; change all callers. If doing a static link define__rela_iplt_start and __rela_iplt_end.(Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.(Output_data_plt_x86_64::add_local_ifunc_entry): New function.(Target_x86_64::make_plt_section): Set sh_info field of .rel.pltto point to .plt.(Target_x86_64::make_local_ifunc_plt_entry): New function.(Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE toswitch.(Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.(Target_x86_64::Scan::local): Handle IFUNC symbols. AddR_X86_64_IRELATIVE to switch.(Target_x86_64::Scan::global): Likewise.(Target_x86_64::Relocate::relocate): Likewise.(Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE toswitch.* target.h (class Target): Add plt_section_for_global andplt_section_for_local functions. Add do_plt_section_for_globaland do_plt_section_for_local virtual functions.* symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Addclarifying comments.(Symbol::use_plt_offset): Handle IFUNC symbol.* object.cc (Sized_relobj::Sized_relobj): Initializelocal_plt_offsets_.(Sized_relobj::local_has_plt_offset): New function.(Sized_relobj::local_plt_offset): New function.(Sized_relobj::set_local_plt_offset): New function.(Sized_relobj::do_count): Handle IFUNC symbol.* object.h (class Symbol_value): Add is_ifunc_symbol_ field. Takea bit away from input_shndx_ field. Add set_is_func_symbol andis_ifunc_symbol functions.(class Sized_relobj): Update declarations. Remove Tls_got_entryand Local_tls_got_offsets. Define Local_plt_offsets. Addlocal_plt_offsets_ field.(Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.* output.h (class Output_section_data): Add non-constoutput_section function.(class Output_data_got): Update declarations.(class Output_data_got::Got_entry): Add use_plt_offset_ field.Add use_plt_offset parameter to global and local constructors.Change all callers. Change local_sym_index_ field to 31 bits.Change GSYM_CODE and CONSTANT_CODE accordingly.* output.cc (Output_data_reloc_base::do_adjust_output_section): Ifdoing a static link don't set sh_link field.(Output_data_got::Got_entry::write): Use PLT offset ifappropriate.(Output_data_got::add_global_plt): New function.(Output_data_got::add_local_plt): New function.* target-reloc.h (relocate_section): Handle IFUNC symbol.* defstd.cc (in_section): Remove entries for __rel_iplt_start,__rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.* configure.ac: Set IFUNC automake conditional for glibc >= 2.11.* testsuite/Makefile.am: Add a bunch of IFUNC tests, all withinIFUNC conditional.* testsuite/ifunc-sel.h: New file.* testsuite/ifuncmain1.c: New file.* testsuite/ifuncmain1vis.c: New file.* testsuite/ifuncmod1.c: New file.* testsuite/ifuncdep2.c: New file.* testsuite/ifuncmain2.c: New file.* testsuite/ifuncmain3.c: New file.* testsuite/ifuncmod3.c: New file.* testsuite/ifuncmain4.c: New file.* testsuite/ifuncmain5.c: New file.* testsuite/ifuncmod5.c: New file.* testsuite/ifuncmain6pie.c: New file.* testsuite/ifuncmod6.c: New file.* testsuite/ifuncmain7.c: New file.* configure, testsuite/Makefile.in: Rebuild.2010-08-18 Ian Lance Taylor <iant@google.com>* incremental.cc(Output_section_incremental_inputs::write_input_files): Add castto avoid signed/unsigned comparison warning.(Output_section_incremental_inputs::write_info_blocks): Likewise.2010-08-12 Cary Coutant <ccoutant@google.com>* common.cc (Sort_commons::operator()): Remove unnecessary code.2010-08-13 Ian Lance Taylor <iant@google.com>* testsuite/incremental_test_1.c: Add prototype to avoid warning.2010-08-12 Cary Coutant <ccoutant@google.com>Doug Kwan <dougkwan@google.com>* resolve.cc (Symbol_table::should_override): When a weak dynamicdefintion overrides non-weak undef, remember that the original undefis not weak.* symtab.cc (Symbol_table::sized_write_global): For undef withoutan original weak binding, set binding to global in output.* testsuite/Makefile.am: Add new test strong_ref_weak_def.* testsuite/Makefile.in: Regenerate.* testsuite/strong_ref_weak_def.sh: New file.* testsuite/strong_ref_weak_def_1.c: Ditto.* testsuite/strong_ref_weak_def_2.c: Ditto.2010-08-12 Cary Coutant <ccoutant@google.com>* testsuite/incremental_test.sh: Rewrite.* testsuite/incremental_test_1.c: Rewrite.* testsuite/incremental_test_2.c: Rewrite.2010-08-12 Cary Coutant <ccoutant@google.com>* arm.cc (Target_arm::got_size): Add const.(Target_arm::got_entry_count): New function.(Target_arm::plt_entry_count): New function.(Target_arm::first_plt_entry_offset): New function.(Target_arm::plt_entry_size): New function.(Output_data_plt_arm::entry_count): New function.(Output_data_plt_arm::first_plt_entry_offset): New function.(Output_data_plt_arm::get_plt_entry_size): New function.* i386.cc (Target_i386::got_size): Add const.(Target_i386::got_entry_count): New function.(Target_i386::plt_entry_count): New function.(Target_i386::first_plt_entry_offset): New function.(Target_i386::plt_entry_size): New function.(Output_data_plt_i386::entry_count): New function.(Output_data_plt_i386::first_plt_entry_offset): New function.(Output_data_plt_i386::get_plt_entry_size): New function.* incremental-dump.cc (dump_incremental_inputs): Adjust call tofind_incremental_inputs_sections. Dump incremental_got_plt section.* incremental.cc: Include target.h.(Sized_incremental_binary::do_find_incremental_inputs_sections): Addparameter. Adjust all callers. Find incremental_got_plt section.(Incremental_inputs::create_data_sections): Create incremental_got_pltsection.(Output_section_incremental_inputs::set_final_data_size): Calculatesize of incremental_got_plt section.(Output_section_incremental_inputs::do_write): Write theincremental_got_plt section.(Got_plt_view_info): New struct.(Local_got_offset_visitor): New class.(Global_got_offset_visitor): New class.(Global_symbol_visitor_got_plt): New class.(Output_section_incremental_inputs::write_got_plt): New function.* incremental.h (Incremental_binary::find_incremental_inputs_sections):Add parameter. Adjust all callers.(Incremental_binary::do_find_incremental_inputs_sections): Likewise.(Incremental_inputs::got_plt_section): New function.(Incremental_inputs::got_plt_section_): New data member.(Incremental_got_plt_reader): New class.* layout.cc (Layout::create_incremental_info_sections): Add theincremental_got_plt section.* object.h (Got_offset_list::get_list): New function.(Got offset_list::for_all_got_offsets): New function.(Sized_relobj::local_got_offset_list): New function.* powerpc.cc (Target_powerpc::got_size): Add const.(Target_powerpc::got_entry_count): New function.(Target_powerpc::plt_entry_count): New function.(Target_powerpc::first_plt_entry_offset): New function.(Target_powerpc::plt_entry_size): New function.(Output_data_plt_powerpc::entry_count): New function.(Output_data_plt_powerpc::first_plt_entry_offset): New function.(Output_data_plt_powerpc::get_plt_entry_size): New function.* sparc.cc (Target_sparc::got_size): Add const.(Target_sparc::got_entry_count): New function.(Target_sparc::plt_entry_count): New function.(Target_sparc::first_plt_entry_offset): New function.(Target_sparc::plt_entry_size): New function.(Output_data_plt_sparc::entry_count): New function.(Output_data_plt_sparc::first_plt_entry_offset): New function.(Output_data_plt_sparc::get_plt_entry_size): New function.* symtab.h (Symbol::got_offset_list): New function.(Symbol_table::for_all_symbols): New function.* target.h (Sized_target::got_entry_count): New function.(Sized_target::plt_entry_count): New function.(Sized_target::plt_entry_size): New function.* x86_64.cc (Target_x86_64::got_size): Add const.(Target_x86_64::got_entry_count): New function.(Target_x86_64::plt_entry_count): New function.(Target_x86_64::first_plt_entry_offset): New function.(Target_x86_64::plt_entry_size): 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::get_plt_entry_size): New function.2010-08-12 Cary Coutant <ccoutant@google.com>* archive.cc: Include incremental.h.(Archive::Archive): Initialize incremental_info_.(Archive::include_member): Record archive members in incremental info.(Add_archive_symbols::run): Record begin and end of an archive inincremental info.(Lib_group::include_member): Record objects in incremental info.* archive.h (Incremental_archive_entry): Forward declaration.(Archive::set_incremental_info): New member function.(Archive::incremental_info): New member function.(Archive::Unused_symbol_iterator): New class.(Archive::unused_symbols_begin): New member function.(Archive::unused_symbols_end): New member function.(Archive::incremental_info_): New data member.* incremental-dump.cc (find_input_containing_global): New function.(dump_incremental_inputs): Dump new incremental info sections.* incremental.cc: Include symtab.h.(Output_section_incremental_inputs): New class.(Sized_incremental_binary::do_find_incremental_inputs_sections): Supportnew incremental info sections.(Sized_incremental_binary::do_check_inputs): Likewise.(Incremental_inputs::report_archive): Remove.(Incremental_inputs::report_archive_begin): New function.(Incremental_inputs::report_archive_end): New function.(Incremental_inputs::report_object): New function.(Incremental_inputs::finalize_inputs): Remove.(Incremental_inputs::report_input_section): New function.(Incremental_inputs::report_script): Rewrite.(Incremental_inputs::finalize): Do nothing but finalize string table.(Incremental_inputs::create_incremental_inputs_section_data): Remove.(Incremental_inputs::sized_create_inputs_section_data): Remove.(Incremental_inputs::create_data_sections): New function.(Incremental_inputs::relocs_entsize): New function.(Output_section_incremental_inputs::set_final_data_size): New function.(Output_section_incremental_inputs::do_write): New function.(Output_section_incremental_inputs::write_header): 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_symtab): New function.* incremental.h (Incremental_script_entry): Forward declaration.(Incremental_object_entry): Forward declaration.(Incremental_archive_entry): Forward declaration.(Incremental_inputs): Forward declaration.(Incremental_inputs_header_data): Remove.(Incremental_inputs_header): Remove.(Incremental_inputs_header_write): Remove.(Incremental_inputs_entry_data): Remove.(Incremental_inputs_entry): Remove.(Incremental_inputs_entry_write): Remove.(enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.(Incremental_binary::find_incremental_inputs_sections): Add parameters.(Incremental_binary::do_find_incremental_inputs_sections): Likewise.(Sized_ncremental_binary::do_find_incremental_inputs_sections):Likewise.(Incremental_input_entry): New class.(Incremental_script_entry): New class.(Incremental_object_entry): New class.(Incremental_archive_entry): New class.(Incremental_inputs::Incremental_inputs): Initialize new data members.(Incremental_inputs::report_inputs): Remove.(Incremental_inputs::report_archive): Remove.(Incremental_inputs::report_archive_begin): New function.(Incremental_inputs::report_archive_end): New function.(Incremental_inputs::report_object): Change prototype.(Incremental_inputs::report_input_section): New function.(Incremental_inputs::report_script): Change prototype.(Incremental_inputs::get_reloc_count): New function.(Incremental_inputs::set_reloc_count): New function.(Incremental_inputs::create_data_sections): New function.(Incremental_inputs::create_incremental_inputs_section_data): Remove.(Incremental_inputs::inputs_section): New function.(Incremental_inputs::symtab_section): New function.(Incremental_inputs::relocs_section): New function.(Incremental_inputs::get_stringpool): Add const.(Incremental_inputs::command_line): Add const.(Incremental_inputs::inputs): Remove.(Incremental_inputs::command_line_key): New function.(Incremental_inputs::input_file_count): New function.(Incremental_inputs::input_files): New function.(Incremental_inputs::relocs_entsize): New function.(Incremental_inputs::sized_create_inputs_section_data): Remove.(Incremental_inputs::finalize_inputs): Remove.(Incremental_inputs::Input_info): Remove.(Incremental_inputs::lock_): Remove.(Incremental_inputs::inputs_): Change type.(Incremental_inputs::inputs_map_): Remove.(Incremental_inputs::current_object_entry_): New data member.(Incremental_inputs::inputs_section_): New data member.(Incremental_inputs::symtab_section_): New data member.(Incremental_inputs::relocs_section_): New data member.(Incremental_inputs::reloc_count_): New data member.(Incremental_inputs_reader): New class.(Incremental_symtab_reader): New class.(Incremental_relocs_reader): New class.* layout.cc (Layout::finalize): Move finalization of incremental infoand creation of incremental info sections to follow finalization ofsymbol table. Set offsets for postprocessing sections.(Layout::create_incremental_info_sections): CallIncremental_inputs::create_data_sections. Add incremental symtaband relocs sections. Set sh_entsize and sh_link fields. Arrange forsections to layout after input sections.* layout.h (struct Timespec): Forward declaration.(Layout::incremental_inputs): Add const.(Layout::create_incremental_info_sections): Add parameter.* main.cc (main): Remove call to Incremental_inputs::report_inputs.* object.cc: Include incremental.h.(Relobj::finalize_incremental_relocs): New function.(Sized_relobj::do_layout): Record input sections in incremental info.* object.h (Object::output_section): New function.(Object::output_section_offset): Moved from Relobj.(Object::get_incremental_reloc_base): New function.(Object::get_incremental_reloc_count): New function.(Object::do_output_section): New function.(Object::do_output_section_offset): Moved from Relobj.(Object::do_get_incremental_reloc_base): New function.(Object::do_get_incremental_reloc_count): New function.(Object::Object): Initialize new data members.(Relobj::output_section): Renamed do_output_section and moved toprotected.(Relobj::output_section_offset): Moved to Object.(Relobj::do_get_incremental_reloc_base): New function.(Relobj::do_get_incremental_reloc_count): New function.(Relobj::allocate_incremental_reloc_counts): New function.(Relobj::count_incremental_reloc): New function.(Relobj::finalize_incremental_relocs): New function.(Relobj::next_incremental_reloc_index): New function.(Relobj::reloc_counts_): New data member.(Relobj::reloc_bases_): New data member.(Sized_relobj::do_relocate_sections): Add parameter. Change caller.(Sized_relobj::relocate_sections): Add parameter. Change all callers.(Sized_relobj::incremental_relocs_scan): New function.(Sized_relobj::incremental_relocs_scan_reltype): New function.(Sized_relobj::incremental_relocs_write): New function.(Sized_relobj::incremental_relocs_write_reltype): New function.* plugin.cc (Plugin_manager::add_input_file): Rewrite test forincremental link.* readsyms.cc (Read_symbols::do_read_symbols): Move reporting ofarchives and object files elsewhere.(Add_symbols::run): Report object files here.(Finish_group::run): Report end of archive at end of group.* reloc.cc: Include layout.h, incremental.h.(Sized_relobj::do_read_relocs): Need 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_reltype): New function.(Sized_relobj::do_relocate_sections): Write incremental relocations.(Sized_relobj::incremental_relocs_write): New function.(Sized_relobj::incremental_relocs_write_reltype): New function.* script.cc (read_input_script): Rewrite test for incremental link.Change call to Incremental_inputs::report_script.* symtab.h (Symbol_table::first_global_index): New function.(Symbol_table::output_count): New function.2010-08-12 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::merge_object_attributes): Check command lineoptions --no-wchar-size-warning and --no-enum-size-warning.* options.h (General_options): Add ld-compatible options--no-enum-size-warning and --no-wchar-size-warning.2010-08-04 Ian Lance Taylor <iant@google.com>* x86_64.cc (Target_x86_64::Scan::local): UseR_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT andR_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.(Target_x86_64::Scan::global): Likewise.(Target_x86_64::Relocate::relocate): Likewise.(Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.2010-08-03 Cary Coutant <ccoutant@google.com>* merge.cc (Output_merge_string::do_add_input_section): Count stringsto reserve space in merged_strings vector. Keep total input sizefor stats.(Output_merge_string::do_print_merge_stats): Print total input size.* merge.h (Output_merge_string): Add input_size_ field.* stringpool.cc (Stringpool_template::string_length): Moveimplementations out of Stringpool_template class and place instringpool.h.* stringpool.h (string_length): Move out of Stringpool_template.2010-08-03 Ian Lance Taylor <iant@google.com>PR 11712* layout.cc (relaxation_loop_body): If address of load segment isset, adjust address to include headers if possible.2010-08-03 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Bump to 1.10.2010-08-03 Ian Lance Taylor <iant@google.com>PR 11805* layout.h (enum Output_section_order): Define.(class Layout): Update declarations.* layout.cc (Layout::get_output_section): Add order parameter.Remove is_interp, is_dynamic_linker_section, is_last_relro, andis_first_non_relro parameters. Change all callers.(Layout::choose_output_section): Likewise.(Layout::add_output_section_data): Likewise.(Layout::make_output_section): Likewise. Set order.(Layout::default_section_order): New function.(Layout::layout_eh_frame): Call add_output_section_to_nonload.* output.cc (Output_section::Output_section): Initialize order_.Don't initialize deleted fields.(Output_segment::Output_segment): Don't initialize deletedfields.(Output_segment::add_output_section_to_load): New functionreplacing add_output_section. Change all callers to call this oradd_output_section_to_nonload.(Output_segment::add_output_section_to_nonload): New function.(Output_segment::remove_output_section): Rewrite.(Output_segment::add_initial_output_data): Likewise.(Output_segment::has_any_data_sections): Likewise.(Output_segment::is_first_section_relro): Likewise.(Output_segment::maximum_alignment): Likewise.(Output_segment::has_dynamic_reloc): New function replacingdynamic_reloc_count. Change all callers.(Output_segment::has_dynamic_reloc_list): New function replacingdynamic_reloc_count_list. Change all callers.(Output_segment::set_section_addresses): Rewrite.(Output_segment::set_offset): Rewrite.(Output_segment::find_first_and_last_list): Remove.(Output_segment::set_tls_offsets): Rewrite.(Output_segment::first_section_load_address): Likewise.(Output_segment::output_section_count): Likewise.(Output_segment::section_with_lowest_load_address): Likewise.(Output_segment::write_section_headers): Likewise.(Output_segment::print_sections_to_map): Likewise.* output.h (class Output_data): Remove dynamic_reloc_count_field. Add has_dynamic_reloc_ field. Make bools into bitfields.(Output_data::add_dynamic_reloc): Rewrite.(Output_data::has_dynamic_reloc): New function.(Output_data::dynamic_reloc_count): Remove.(class Output_section): Add order_ field. Remvoe is_relro_local_,is_last_relro_, is_first_non_relro_, is_interp_,is_dynamic_linker_section_ fields. Add order and set_orderfunctions. Remove is_relro_local, set_is_relro_local,is_last_relro, set_is_last_relro, is_first_non_relro,set_is_first_non_relro functions, is_interp, set_is_interp,is_dynamic_linker_section, and set_is_dynamic_linker_sectionfunctions.(class Output_segment): Change Output_data_list from std::list tostd:;vector. Add output_lists_ field. Remove output_data_ andoutput_bss_ fields. Update declarations.2010-08-02 Ian Lance Taylor <iant@google.com>* arm.cc (Target_arm::gc_process_relocs): Use typename.* powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.* sparc.cc (Target_sparc::gc_process_relocs): Likewise.2010-08-02 Ian Lance Taylor <iant@google.com>PR 11855* script.cc (Script_options::Script_options): Initializesymbol_definitions_ and symbol_references_.(Script_options::add_symbol_assignment): Updatesymbol_definitions_ and symbol_references_.(Script_options::add_symbol_reference): New function.(script_symbol): New function.* script.h (class Script_options): Add symbol_definitions_ andsymbol_references_ fields.(Script_options::referenced_const_iterator): New type.(Script_options::referenced_begin): New function.(Script_options::referenced_end): New function.(Script_options::is_referenced): New function.(Script_options::any_unreferenced): New function.* script-c.h (script_symbol): Declare.* yyscript.y (exp): Call script_symbol.* symtab.cc: Include "script.h".(Symbol_table::gc_mark_undef_symbols): Add layout parameter.Change all callers. Check symbols referenced by scripts.(Symbol_table::add_undefined_symbols_from_command_line): Addlayout parameter. Change all callers.(Symbol_table::do_add_undefined_symbols_from_command_line):Likewise. Break out loop body. Check symbols referenced byscripts.(Symbol_table::add_undefined_symbol_from_command_line): Newfunction broken out ofdo_add_undefined_symbols_from_command_line.* symtab.h (class Symbol_table): Update declarations.* archive.cc: Include "layout.h".(Archive::should_include_member): Add layout parameter. Changeall callers. Check for symbol mentioned in expression.* archive.h (class Archive): Update declaration.* object.cc (Sized_relobj::do_should_include_member): Add layoutparameter.* object.h (Object::should_include_member): Add layout parameter.Change all callers.(Object::do_should_include_member): Add layout parameter.(class Sized_relobj): Update declaration.* dynobj.cc (Sized_dynobj::do_should_include_member): Add layoutparameter.* dynobj.h (class Sized_dynobj): Update declaration.* plugin.cc (Sized_pluginobj::do_should_include_member): Addlayout parameter.* plugin.h (class Sized_pluginobj): Update declaration.2010-08-02 Ian Lance Taylor <iant@google.com>PR 11866* output.cc (Output_segment::set_offset): Search for the first andlast sections rather than assuming that the list is in order.(Output_segment::find_first_and_last_list): New function.* output.h (class Output_segment): Update declarations.* testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.(relro_strip_test_SOURCES): New variable.(relro_strip_test_DEPENDENCIES): New variable.(relro_strip_test_LDFLAGS): New variable.(relro_strip_test_LDADD): New variable.(relro_strip_test.so): New target.2010-08-02 Ian Lance Taylor <iant@google.com>* i386.cc (class Target_i386): Add got_tlsdesc_ field.(Target_i386::Target_i386):: Initialize got_tlsdesc_.(Target_i386::got_tlsdesc_section): New function.(Target_i386::got_section): Create space for GOT entries forTLSDESC relocations.(Target_i386::Scan::local): Use TLSDESC GOT for unoptimizedR_386_TLS_GOTDESC.(Target_i386::Scan::global): Likewise.(Target_i386::Relocate::relocate_tls): Adjust GOT offset whenusing TLSDESC GOT.* x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.(Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.(Target_x86_64::got_tlsdesc_section): New function.(Target_x86_64::got_section): Create space for GOT entries forTLSDESC relocations.(Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimizedR_386_TLS_GOTDESC.(Target_x86_64::Scan::global): Likewise.(Target_x86_64::Relocate::relocate_tls): Adjust GOT offset whenusing TLSDESC GOT.2010-08-02 Ian Lance Taylor <iant@google.com>* testsuite/final_layout.sh: Use dc to convert from hex todecimal.2010-07-29 Sriraman Tallam <tmsriram@google.com>* arm.cc (Target_arm<big_endian>::gc_process_relocs): Add templateparamter to the call to gold::gc_process_relocs.* i386.cc (Target_i386<big_endian>::gc_process_relocs): Add templateparamter to the call to gold::gc_process_relocs.* x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add templateparameter to the call to gold::gc_process_relocs.* powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Addtemplate parameter to the call to gold::gc_process_relocs.* sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add templateparamter to the call to gold::gc_process_relocs.* gc.h (get_embedded_addend_size): New function.(gc_process_relocs): Save the size of the reloc for use by ICF.* icf.cc (get_section_contents): Get the addend from the text sectionfor SHT_REL relocation sections.* icf.h (Icf::Reloc_addend_size_info): New typedef.(Icf::Reloc_info): Add new member reloc_addend_size_info.* int_encoding.h (read_from_pointer): New overloaded function.* 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_1.cc: New file.* testsuite/icf_sht_rel_addend_test_2.cc: New file.2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.* Makefile.in: Regenerate.* testsuite/Makefile.in: Regenerate.2010-07-27 Jeffrey Yasskin <jyasskin@google.com>* testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.* gold/testsuite/debug_msg.cc: Likewise.* gold/testsuite/odr_violation1.cc* gold/testsuite/odr_violation2.cc2010-07-21 Cary Coutant <ccoutant@google.com>* merge.h (Output_merge_string::Merged_string): Remove object, shndx,string, and length fields.(Output_merge_string::Merged_strings_list): New type.(Output_merge_string::Merged_strings_lists): New typedef.(Output_merge_string): Replace merged_strings_ withmerged_strings_lists_.* merge.cc (Output_merge_string::do_add_input_section): Allocate newMerged_strings_list per input object and section. Don't store pointerto the string. Don't store length with each merged string entry.(Output_merge_string::finalize_merged_data): Loop over list of mergedstrings lists. Recompute length of each merged string.2010-07-15 Cary Coutant <ccoutant@google.com>* plugin.cc (Plugin_finish::run): Don't call cleanup handlers fromhere.2010-07-14 Ian Lance Taylor <iant@google.com>* descriptors.cc (Descriptors::open): Report correct name in errormessage.2010-07-13 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_input_section::Arm_input_section): For aSHT_ARM_EXIDX section, always keeps the input sections.(Arm_input_section::set_exidx_section_link): New method.(Arm_exidx_input_section::Arm_exidx_input_section): Initializehas_errors_ to false.(Arm_exidx_input_section::has_errors,Arm_exidx_input_section::set_has_errors): New methods.(Arm_exidx_input_section::has_errors_): New data member.(Arm_relobj::get_exidx_shndx_list): New method.(Arm_output_section::append_text_sections_to_list): Do not skipsection without SHF_EXECINSTR.(Arm_output_section::fix_exidx_coverage): Skip input sections witherrors.(Arm_relobj::make_exidx_input_section): Add new parameter for textsection header. Make error messages more verbose. Check fora non-executable section linked to an EXIDX section.(Arm_relobj::do_read_symbols): Remove error checking, which has beenmoved to Arm_relobj::make_exidx_input_section. Add an assertion tocheck that there is no deferred EXIDX section if we exit early.Instead of not making an EXIDX section in case of an error, make oneand set the has_errors flag of it.(Target_arm::do_finalize_sections): Fix up links of EXIDX sectionsin a relocatable link.(Target_arm::do_relax): Look for the EXIDX output section instead ofassuming that it is called .ARM.exidx.(Target_arm::fix_exidx_coverage): Add a new parameter for inputsection list. Do not check for SHF_EXECINSTR section flags butskip any input section with errors.* output.cc (Output_section::Output_section): Initializealways_keeps_input_sections_ to false.(Output_section::add_input_section): Check foralways_keeps_input_sections_.* output.h (Output_section::always_keeps_input_sections,Output_section::set_always_keeps_input_sections): New methods.(Output_section::always_keeps_input_sections): New data member.2010-07-13 Rafael Espindola <espindola@google.com>* fileread.cc (try_extra_search_path, find_file): Move to Input_file.* fileread.h (Input_file): Add try_extra_search_path and find_file.2010-07-13 Philip Herron <herron.philip@googlemail.com>Ian Lance Taylor <iant@google.com>* output.h (Output_section_lookup_maps::add_merge_section):Correct check of whether value was inserted.(Output_section_lookup_maps::add_merge_input_section): Likewise.(Output_section_lookup_maps::add_relaxed_input_section):Likewise.* arm.cc (Target_arm::got_section): Remove used local os.* i386.cc (Target_i386::got_section): Likewise.* x86_64.cc (Target_x86_64::got_section): Likewise.* sparc.cc (Target_sparc::got_section): Likewise.(Target_sparc::relocate): Remove unused local have_got_offset.* powerpc.cc (Target_powerpc::relocate): Likewise.2010-07-13 Ian Lance Taylor <iant@google.com>* compressed_output.cc (zlib_decompress): Fix signature in!HAVE_ZLIB_H case.* archive.cc (Archive::include_member): Unlock an external memberof a thin archive. Don't bother to delete an object we know isNULL.2010-07-12 Cary Coutant <ccoutant@google.com>* compressed_output.cc (zlib_decompress): New function.(get_uncompressed_size): New function.(decompress_input_section): New function.* compressed_output.h (get_uncompressed_size): New function.(decompress_input_section): New function.* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)Handle compressed debug sections.* layout.cc (is_compressed_debug_section): New function.(Layout::output_section_name): Map compressed section names tocanonical names.* layout.h (is_compressed_debug_section): New function.(is_debug_info_section): Recognize compressed debug sections.* merge.cc: Include compressed_output.h.(Output_merge_data::do_add_input_section): Handle compresseddebug sections.(Output_merge_string::do_add_input_section): Handle compresseddebug sections.* object.cc: Include compressed_output.h.(Sized_relobj::Sized_relobj): Initialize new data members.(build_compressed_section_map): New function.(Sized_relobj::do_read_symbols): Handle compressed debug sections.* object.h (Object::section_is_compressed): New method.(Object::do_section_is_compressed): New method.(Sized_relobj::Compressed_section_map): New type.(Sized_relobj::do_section_is_compressed): New method.(Sized_relobj::compressed_sections_): New data member.* output.cc (Output_section::add_input_section): Handle compresseddebug sections.* reloc.cc: Include compressed_output.h.(Sized_relobj::write_sections): Handle compressed debug sections.2010-07-08 Cary Coutant <ccoutant@google.com>* resolve.cc (Symbol_table::resolve): Remember whether undef wasweak when resolving to a dynamic def.(Symbol_table::should_override): Add adjust_dyndef flag; set itfor weak undef/dynamic def cases. Adjust callers.* symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ andundef_binding_weak_.(Symbol_table::sized_write_globals): Adjust symbol binding.(Symbol_table::sized_write_symbol): Add binding parameter.* symtab.h (Symbol::set_undef_binding): New method.(Symbol::is_undef_binding_weak): New method.(Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.(Symbol_table::should_override): Add new parameter.(Symbol_table::sized_write_symbol): Add new parameter.* testsuite/weak_undef_file1.cc: Add new test case.* testsuite/weak_undef_file2.cc: Fix header comment.* testsuite/weak_undef_test.cc: Add new test case.2010-06-29 Doug Kwan <dougkwan@google.com>* arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):Initialize USE_SYMBOL_.* arm-reloc-property.h (Arm_reloc_property::uses_symbol): New methoddefinition.(Arm_reloc_property::uses_symbol_): New data member declaration.* arm.cc (Target_arm::Relocate::relocate): Exit early if relocationuses symbol value and symbol is undefined but not weakly undefined.2010-06-28 Rafael Espindola <espindola@google.com>* plugin.cc (Plugin::load): Use dlerror.2010-06-26 Jeffrey Yaskin <jyasskin@google.com>* symtab.cc (detect_odr_violations): When reporting an ODRviolation, report an object where the symbol is defined.2010-06-25 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::can_check_for_functions_pointers): Return true.(Target_arm::section_may_have_icf_unsafe_pointers): New methoddefinition.(Target_arm::Scan::local_reloc_may_be_function_pointer,Target_arm::Scan::global_reloc_may_be_function_pointer): Implementtarget hook to detect function points.(Target_arm::Scan::possible_function_pointer_reloc): New method.* icf.h (Icf::check_section_for_function_pointers): Change type ofparameter SECTION_NAME to const reference to std::string. Usetarget hook to determine if section may have unsafe pointers.* target.h (Target::section_may_have_icf_unsafe_pointers): Newmethod definition.2010-06-21 Rafael Espindola <espindola@google.com>* fileread.cc (Input_file::find_fie): New(Input_file::open): Use Input_file::find_fie.* fileread.h (Input_file::find_fie): New* plugin.cc (set_extra_library_path): New.(Plugin::load): Add set_extra_library_path to the transfer vector.(Plugin_manager::set_extra_library_path): New.(Plugin_manager::add_input_file): Use the extra search path if set.(set_extra_library_path(): New.* plugin.h (Plugin_manager): Add set_extra_library_path andextra_search_path_.2010-06-19 Cary Coutant <ccoutant@google.com>* layout.cc (gdb_sections): Add .debug_types.(lines_only_debug_sections): Likewise.2010-06-18 Rafael Espindola <espindola@google.com>* plugin.cc (add_input_file,add_input_library)(Plugin_manager::add_input_file): Make filename arguments const.* plugin.h (Plugin_manager::add_input_file): Make filename argumentsconst.2010-06-16 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_finalize_sections): Do not emit an.ARM.attributes section if we have not merged any inputattributes sections.2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc: Allow combining objects with no EABI versioninformation.2010-06-15 Rafael Espindola <espindola@google.com>* plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>* fileread.cc: Only #include <sys/uio.h> if HAVE_READV.(struct iovec): Correct !HAVE_READV definition.2010-06-10 Cary Coutant <ccoutant@google.com>* object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.(Sized_relobj::do_layout_deferred_sections): Do layout for deferredreloc sections.* object.h (Sized_relobj::deferred_layout_relocs_): New data member.PR 11683* symtab.h (Symbol::is_placeholder): New member function.* target-reloc.h (relocate_section): Check for placeholder symbols.* testsuite/Makefile.am (plugin_test_8): New test.(plugin_test_9): New test.* testsuite/Makefile.in: Regenerate.2010-06-09 Nick Clifton <nickc@redhat.com>* yyscript.y (input_list_element): Allow strings prefixed withthe '-' character. Treat these as libraries.* script.cc (script_add_library): New function. Adds a libraryspecified by "-l<name>" found in an input script.* script-c.h: Add prototype for script_add_library.2010-06-07 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_relax): Reserve more space for stubs.Restrict stub-group size to be within long conditional branchrange when working around cortex-A8 erratum.2010-06-07 Damien Diederen <dd@crosstwine.com>* gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct#ifdef typo.2010-06-03 Sriraman Tallam <tmsriram@google.com>PR gold/11658* output.cc(Output_section::Input_section_sort_entry::compare_section_ordering):Change to return non-zero correctly.(Output_section::Input_section_sort_section_order_index_compare::operator()): Change to fix ambiguity in comparisons.2010-06-01 Sriraman Tallam <tmsriram@google.com>* gold.h (is_wildcard_string): New function.* layout.cc (Layout::layout): Pass this pointer to add_input_section.(Layout::layout_eh_frame): Ditto.(Layout::find_section_order_index): New method.(Layout::read_layout_from_file): New method.* layout.h (Layout::find_section_order_index): New method.(Layout::read_layout_from_file): New method.(Layout::input_section_position_): New private member.(Layout::input_section_glob_): New private member.* main.cc (main): Call read_layout_from_file here.* options.h (--section-ordering-file): New option.* output.cc (Output_section::input_section_order_specified_): Newmember.(Output_section::Output_section): Initialize new member.(Output_section::add_input_section): Add new parameter.Keep input sections when --section-ordering-file is used.(Output_section::set_final_data_size): Sort input sections whensection ordering file is specified.(Output_section::Input_section_sort_entry): Add new parameter.Check sorting type.(Output_section::Input_section_sort_entry::compare_section_ordering):New method.(Output_section::Input_section_sort_compare::operator()): Change toconsider section_order_index.(Output_section::Input_section_sort_init_fini_compare::operator()):Change to consider section_order_index.(Output_section::Input_section_sort_section_order_index_compare::operator()): New method.(Output_section::sort_attached_input_sections): Change to sortaccording to section order when specified.(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<32, 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_section::input_section_order_specified): Newmethod.(Output_section::set_input_section_order_specified): New method.(Input_section::Input_section): Initialize section_order_index_.(Input_section::section_order_index): New method.(Input_section::set_section_order_index): New method.(Input_section::section_order_index_): New member.(Input_section::Input_section_sort_section_order_index_compare): Newstruct.(Output_section::input_section_order_specified_): New member.* script-sections.cc (is_wildcard_string): Delete and move modifiedmethod to gold.h.(Output_section_element_input::Output_section_element_input): Modifycall to is_wildcard_string.(Output_section_element_input::Input_section_pattern::Input_section_pattern): Ditto.(Output_section_element_input::Output_section_element_input): Ditto.* testsuite/Makefile.am (final_layout): New test case.* testsuite/Makefile.in: Regenerate.* testsuite/final_layout.cc: New file.* testsuite/final_layout.sh: New file.2010-06-01 Rafael Espindola <espindola@google.com>* plugin.cc (Plugin::load): Pass the output name to the plugin.2010-06-01 Rafael Espindola <espindola@google.com>* plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set thevisibility of symbols.2010-05-27 Doug Kwan <dougkwan@google.com>* object.cc (Sized_relobj::do_finalize_local_symbols): Use offsetfrom start of output section instead of address for a local symbolin a merged or relaxed section when doing a relocatable link.2010-05-26 Rafael Espindola <espindola@google.com>PR 11604* gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoidadding sections the garbage collector removed.* gold/testsuite/Makefile.am: Add test.* gold/testsuite/Makefile.in: Regenerate.* gold/testsuite/plugin_test_7.sh: New.* gold/testsuite/plugin_test_7_1.c: New.* gold/testsuite/plugin_test_7_2.c: New.2010-05-26 Rafael Espindola <espindola@google.com>* script-sections.cc (Output_section_definition::set_section_addresses):Check for --section-start.2010-05-26 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_scan_relocatable_relocs): New class.(Target_arm::relocate_special_relocatable): New method.(Arm_relocate_functions::arm_branch_common): Handle relocatable link.(Arm_relocate_functions::thumb_branch_common): Same.(Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocsinstead of Default_scan_relocatable_relocs.* target-reloc.h (relocate_for_relocatable): Let target handlerelocation strategy Relocatable_relocs::RELOC_SPECIAL.* target.h (Sized_target::relocate_special_relocatable): New method.2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>* timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.2010-05-23 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_input_section::do_output_offset): Use convert_typesinstead of a cast.(Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branchwith a direct branch, not a conditional branch, to a stub.* merge.cc (Output_merge_base::record_input_section): New methoddefintion.(Output_merge_data::do_add_input_section): Record input section ifkeeps-input-sections flag is set.(Output_merge_string::do_add_input_section): Ditto.* merge.h (Output_merge_base::Output_merge_base): Initialize new datamembers KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ andINPUT_SECTIONS_.(Output_merge_base::keeps_input_sections,Output_merge_base::set_keeps_input_sections,Output_merge_base::first_relobj, Output_merge_base::first_shndx): Newmethod definitions.(Output_merge_base::Input_sections): New type declaration.(Output_merge_base::input_sections_begin,Output_merge_base::input_sections_end,Output_merge_base::do_set_keeps_input_sections): New method definitions.(Output_merge_base::bool keeps_input_sections_,Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,Output_merge_base::input_sections_): New data members.(Output_merge_data::do_set_keeps_input_sections): New methoddefintion.(Output_merge_string::do_set_keeps_input_sections): Ditto.* output.cc (Output_section::Input_section::relobj): Move methoddefintion from class declaration to here and handle merge sections.(Output_section::Input_section::shndx): Ditto.(Output_section::Output_section): Remove initializations of removeddata members and initialize new data member LOOKUP_MAPS_.(Output_section::add_input_section): Set keeps-input-sections flagfor a newly created merge output section as appropriate. Adjust codeto use Output_section_lookup_maps class.(Output_section::add_relaxed_input_section): Adjst code for lookupmaps code refactoring.(Output_section::add_merge_input_section): Add a new parameterKEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_mapsclass. If adding input section to a newly created merge outputsection fails, remove the new merge section.(Output_section::convert_input_sections_in_list_to_relaxed_input_sections):Adjust code for use of the Output_section_lookup_maps class.(Output_section::find_merge_section): Ditto.(Output_section::build_lookup_maps): New method defintion.(Output_section::find_relaxed_input_section): Adjust code to useOutput_section_lookup_maps class.(Output_section::get_input_sections): Export merge sections. Adjustcode to use Output_section_lookup_maps class.(Output_section:::add_script_input_section): Adjust code to useOutput_section_lookup_maps class. Update lookup maps for mergesections also.(Output_section::discard_states): Use Output_section_lookup_maps.(Output_section::restore_states): Same.* output.h (Merge_section_properties): Move class defintion out ofOutput_section.(Output_section_lookup_maps): New class.(Output_section::Input_section::is_merge_section): New methoddefintion.(Output_section::Input_section::relobj): Move defintion out of classdefintion. Declare method only.(Output_section::Input_section::shndx): Ditto.(Output_section::Input_section::output_merge_base): New method defintion.(Output_section::Input_section::u2_.pomb): New union field.(Output_section::Merge_section_by_properties_map,Output_section::Output_section_data_by_input_section_map,Output_section::Ouptut_relaxed_input_section_by_input_section_map):Remove types.(Output_section::add_merge_input_section): Add new parameterKEEPS_INPUT_SECTIONS.(Output_section::build_lookup_maps): New method declaration.(Output_section::merge_section_map_,Output_section::merge_section_by_properties_map_,Output_section::relaxed_input_section_map_,Output_section::is_relaxed_input_section_map_valid_): Remove datamembers.(Output_section::lookup_maps_): New data member.2010-05-21 Doug Kwan <dougkwan@google.com>PR gold/11619* arm.cc (Arm_input_section::do_output_offset): Add a cast toavoid a compilation error.2010-05-19 Rafael Espindola <espindola@google.com>* script-sections.cc (Output_section_definition::allocate_to_segment):Update the phdrs_list even when the output section is NULL.* testsuite/Makefile.am: Add test.* testsuite/Makefile.in: Regenerate.* testsuite/script_test_9.cc: New.* testsuite/script_test_9.sh: New.* testsuite/script_test_9.t: New.2010-05-19 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_input_section::original_size): New method.(Arm_input_section::do_addralign): Add a cast.(Arm_input_section::do_output_offset): Remove static cast.(Arm_input_section::original_addralign,Arm_input_section::original_size_): Change type to uint32_t.(Arm_input_section::init): Add safe casts for section alignmentand size.(Arm_input_section::set_final_data_size): Do not set address andoffset of stub table.(Arm_output_section::fix_exidx_coverage): Change use of ofOutput_section::Simple_input_section to that ofOutput_section::Input_section.(Target_arm::do_relax): Set addresses and file offsets of Stub_tablesexcept for the first pass.* output.cc (Output_section::get_input_sections): Change type ofinput_sections to std::list<Input_section>.(Output_section::add_script_input_section): Rename fromOutput_section::add_simple_input_section. Change type of SISparameter from Simple_input_section to Input_section.* output.h (Output_section::Simple_input_section): Remove class.(Output_section::Input_section): Change class visibility to public.(Output_section::Input_section::addralign): Use stored alignmentsfor special input sections if set.(Output_section::Input_section::set_addralign): New method.(Output_section::get_input_sections): Change parameter type fromlist of Simple_input_section to list of Input_section.(Output_section::add_script_input_section): Rename fromOutput_section::add_simple_input_section. Change first parameter'stype from Simple_input_section to Input_section and remove thesecond and third parameters.* script-sections.cc (Input_section::Input_section_list): Changetype to list of Output_section::Input_section/(Input_section_info::Input_section_info): Change parameter type ofINPUT_SECTION to Output_section::Input_section.(Input_section_info::input_section): Change return type.(Input_section_info::input_section_): Change type toOutput_section::Input_section.(Output_section_element_input::set_section_addresses): Adjust codeto use Output_section::Input_section instead ofOutput_section::Simple_input_section. Adjust code for renamingof Output_section::add_simple_input_section.(Orphan_output_section::set_section_addresses): Ditto.2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* gold.h (Unordered_multimap, Unordered_map): Fix defines forwhen neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.2010-05-18 Rafael Espindola <espindola@google.com>* options.cc (General_options::finalize): Handle -nostdlib.* options.h (nostdlib): New option.* script.cc (script_add_search_dir): Handle -nostdlib.2010-05-12 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_finalize_sections): Create an emptyattributes section only if there no attributes section after merging.(Target_arm::merge_object_attributes): Move value ofTag_MPextension_use_legacy to that of Tag_MPextension_use.Handle Tag_DIV_use and Tag_MPextension_use_legacy.* testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh(check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdoutand arm_attr_merge_7.stdout.(arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.oarm_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_7b.o): New rules.(MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r andarm_attr_merge_7* testsuite/Makefile.in: Regenerate.* testsuite/arm_attr_merge.sh: New file.* testsuite/arm_attr_merge_[67][ab].s: Same.2010-05-05 Nick Clifton <nickc@redhat.com>* po/es.po: Updated Spanish translation.2010-04-27 H.J. Lu <hongjiu.lu@intel.com>* Makefile.am (install-exec-local): Properly install gold asdefault cross linker.* Makefile.in: Regenerated.2010-04-27 H.J. Lu <hongjiu.lu@intel.com>Nick Clifton <nickc@redhat.com>* configure.ac (install_as_default): Define and set to falseunless --enable-gold or --enable-gold=both/gold has beenspecified.* configure: Regenerate.* Makefile.am (install-exec-local): Install the executable as'ld.gold'. If install_as_default is true then also install it as'ld'.* Makefile.in: Regenerated.2010-04-24 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::layout_reloc): In relocatable link don'tcombine reloc sections for grouped sections.2010-04-23 Sriraman Tallam <tmsriram@google.com>* gc.h (gc_process_relocs): Pass information on relocs pointing tosections that are not ordinary to icf.* icf.cc (get_section_contents): Handle relocation pointing to sectionwith no object or shndx information.* testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh* testsuite/Makefile.in: Regenerate.* testsuite/icf_virtual_function_folding_test.cc: Remove printf.* testsuite/icf_virtual_function_folding_test.sh: Delete file.2010-04-22 Ian Lance Taylor <iant@google.com>* expression.cc (Expression::Expression_eval_info): Addresult_alignment_pointer field.(Expression::eval_with_dot): Add result_alignment_pointerparameter. Change all callers.(Expression::eval_maybe_dot): Likewise.(class Binary_expression): Add alignment_pointer parameter toleft_value and right_value. Change all callers.(BINARY_EXPRESSION): Set result alignment.(class Trinary_expression): Add alignment_pointer parameter toarg2_value and arg3_value. Change all callers.(Trinary_cond::value): Set result alignment.(Max_expression::value, Min_expression::value): Likewise.(Align_expression::value): Likewise.* script-sections.cc (class Sections_element): Add dot_alignmentparameter to set_section_addresses virtual function. Updateinstantiations.(class Output_section_element): Likewise.(Script_sections::create_segments): Add dot_alignment parameter.Change all callers.(Script_sections::create_segments_from_phdrs_clause): Likewise.(Script_sections::set_phdrs_clause_addresses): Likewise.* script-sections.h: Update declarations.* script.h: Update declarations.* output.h (Output_segment::set_minimum_p_align): Don't decreasemin_p_align.* testsuite/script_test_3.t: Set large alignment.* testsuite/script_test_3.sh: Make sure that at least one LOADsegment has expected alignment.2010-04-22 Nick Clifton <nickc@redhat.com>* po/gold.pot: Updated by the Translation project.* po/vi.po: Updated Vietnamese translation.2010-04-22 H.J. Lu <hongjiu.lu@intel.com>* testsuite/Makefile.am (check_PROGRAMS): Addicf_virtual_function_folding_test.* testsuite/Makefile.in: Regenerated.2010-04-15 Andrew Haley <aph@redhat.com>* options.h (merge_exidx_entries): New option.* arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.(class Arm_exidx_fixup::merge_exidx_entries_): New member.(Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.(Target_arm::merge_exidx_entries): New function.(process_exidx_entry): Don't merge if merge_exidx_entries_ is false.(Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entriesto Arm_exidx_fixup constructor.Add new arg, merge_exidx_entries.(Target_arm::fix_exidx_coverage): pass merge_exidx_entries toArm_output_section::fix_exidx_coverage.2010-04-18 Sriraman Tallam <tmsriram@google.com>* icf.cc (get_section_contents): Check for preemptible functions.Ignore addend when appropriate.* symtab.cc (should_add_dynsym_entry): Add new parameter. Check forsection folded.(add_from_relobj): Check for section folded.(set_dynsym_indexes): Fix call to should_add_dynsym_entry.* symtab.h (should_add_dynsym_entry): Add new parameter.* target-reloc.h (scan_relocs): Check for section folded.* x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):Check reloc types for function pointers in shared objects.* testsuite/Makefile.am (icf_virtual_function_folding_test): New testcase.(icf_preemptible_functions_test): New test case.(icf_string_merge_test): New test case.* testsuite.Makefile.in: Regenerate.* testsuite/icf_safe_so_test.sh: Change to not fold foo_glob andbar_glob. Refactor code.* testsuite/icf_preemptible_functions_test.cc: New file.* testsuite/icf_preemptible_functions_test.sh: New file.* testsuite/icf_string_merge_test.cc: 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.sh: New file.2010-04-14 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_output_section::fix_exidx_coverage): Mark objectfor local symbol recounting if we remove a section due to ICF.* gold.cc (queue_middle_gc_tasks): Create a dummy blocker ifthere are no regular objects in input.2010-04-13 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_input_section::set_final_data_size): Computeaccurate final data size instead of using current data size.2010-04-09 Doug Kwan <dougkwan@google.com>* layout.cc (Layout::choose_output_section): Handle script sectiontypes.(Layout::make_output_section_for_script): Add section type parameter.Handle script section types.* layout.h (Layout::make_output_section_for_script): Add sectiontype parameter.* output.cc (Output_section::Output_section): Initialize data memberis_noload_.(Output_section::do_reset_address_and_file_offset): Do not set addressto 0 if section is a NOLOAD section.* output.h (Output_section::is_noload): New method.(Output_section::set_is_noload): Ditto.(Output_section::is_noload_): New data member.* script-c.h (Script_section_type): New enum type.(struct Parser_output_section_header): Add new file section_type.* script-sections.cc (Sections_element::output_section_name): Addparameter for returning script section type.(Output_section_definition::output_section_name): Ditto.(Output_section_definition::section_type)P; New method.(Output_section_definiton::script_section_type_name): Ditto.(Output_section_definition::script_section_type_): New data member.(Output_section_definition::Output_section_definition): Initializedata member Output_section_definition::script_section_type_.(Output_section_definition::create_sections): Pass script section typeto Layout::make_output_section_for_script.(Output_section_definition::output_section_name): Return scriptsection type to caller.(Output_section_definition::set_section_address): Do not advancedot value and load address if section type is NOLOAD. Set addressof NOLOAD sections regardless of section flags.(Output_section_definition::print): Print section type if it isnot SCRIPT_SECTION_TYPE_NONE.(Output_section_definition::section_type): New method.(Output_section_definition::script_section_type_name): Ditto.(Script_sections::output_section_name): Add new parameterPSECTION_TYPE for returning script section type. Pass it tosection elements. Handle discard sections.(Sort_output_sections::operator()): Handle NOLOAD sections.* script-sections.h (Script_sections::Section_type): New enum type.(Script_sections::output_section_name): Add a new parameter forreturning script section type.* script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,INFO and NOLOAD.* yyscript.y (union): Add new field SECTION_TYPE.(COPY, DSECT, INFO, NOLOAD): New tokens.(opt_address_and_section_type): Change type to output_section_header.(section_type): New non-terminal(section_header): Handle section type.(opt_address_and_section_type): Return section type value.2010-04-09 H.J. Lu <hongjiu.lu@intel.com>* testsuite/plugin_common_test_1.c (foo): Add prototype.* testsuite/plugin_common_test_2.c (foo): Likewise.2010-04-08 Doug Kwan <dougkwan@google.com>* merge.cc (Output_merge_data::set_final_data_size): Handle emptyOutput_merge_data.* output.cc (Output_section::add_merge_input_section): Simplifycode and return status of Output_merge_base::add_input_section.Update merge section map only if Output_merge_base::add_input_sectionreturns true.2010-04-07 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warnif section is marked as containing instructions but has no mappingsymbols.(Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to getcorrect section index.(Arm_relobj::find_linked_text_section): Ditto.2010-04-07 Cary Coutant <ccoutant@google.com>* archive.cc (include_member): Destroy Read_symbols_data object beforereleasing file.* object.cc (Read_symbols_data::~Read_symbols_data) New destructor.* object.h (Read_symbols_data::Read_symbols_data) New constructor.(Read_symbols_data::~Read_symbols_data) New destructor.(Section_relocs::Section_relocs) New constructor.(Section_relocs::~Section_relocs) New destructor.(Read_relocs_data::Read_relocs_data) New constructor.(Read_relocs_data::~Read_relocs_data) New destructor.* testsuite/binary_unittest.cc (Sized_binary_test): Set sd memberpointers to NULL after deleting.2010-04-07 Doug Kwan <dougkwan@google.com>* arm.cc: Replace "endianity" with "endianness" in comments.(Arm_exidx_cantunwind): Ditto.(Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.(Arm_relobj::merge_flags_and_attributes): New method.(Arm_relobj::merge_flags_and_attributes_): New data member.(Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.(Arm_relobj::scan_sections_for_stubs): Ditto.(Arm_relobj::do_read_symbols): Check to see if we really want tomerge processor-specific flags and attributes. Exit early ifan object is empty except for section names and the undefined symbol.(Target_arm::do_finalize_sections): Move check for ELF format toArm_relobj::do_read_symbols. Merge processor specific flags andattributes from a regular object only when we have determined thatit is aapropriate. Do not create an .ARM.attributes section inoutput if there is no regular input object.(Target_arm::merge_processor_specific_flags): Check--warn-mismatch before printing any error.(Target_arm::merge_object_attributes): Ditto.* gold.cc (queue_middle_tasks): Handle the case in which there isno regular object in input.* options.cc (General_options::parse_EB): New method.(General_options::parse_EL): Same.(General_options::General_options): Initialize endianness_.* options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):New options.(General_options::Endianness): New enum.(General_options::endianness): New method.(General_options::endianness_): New data member.* parameters.cc (Parameters::set_options): Check target endianness.(Parameters::set_target_once): Ditto.(Parameters::check_target_endianness): New method.(parameters_force_valid_target): If either -EL or -EB is specified,use it to define endianness of default target.* parameters.h (Parameters::check_target_endianness): New methoddeclaration.* target.h (class Target): Change "endianity" to "endianness"in comments.2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.* configure: Regenerate.* Makefile.in: Regenerate.* testsuite/Makefile.in: Regenerate.2010-04-06 Cary Coutant <ccoutant@google.com>gcc PR lto/42757* plugin.cc (Pluginobj::get_symbol_resolution_info): Check forprevailing definitions of common symbols.* testsuite/plugin_test_6.sh: New test case.* testsuite/plugin_common_test_1.c: New test case.* testsuite/plugin_common_test_2.c: New test case.* testsuite/Makefile.am (plugin_test_6): New test case.* testsuite/Makefile.in: Regenerate.2010-04-06 Nick Clifton <nickc@redhat.com>* po/vi.po: New Vietnamese translation.2010-03-30 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::using_thumb_only): Handle v6-M2010-03-25 Doug Kwan <dougkwan@google.com>* gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange codeto avoid a conversion warning on a 32-bit host.2010-03-24 Ian Lance Taylor <iant@google.com>* testsuite/script_test_3.t: Add a TLS segment.* testsuite/Makefile.am (check_PROGRAMS): Addtls_phdrs_script_test.(tls_phdrs_script_test_SOURCES): Define.(tls_phdrs_script_test_DEPENDENCIES): Define.(tls_phdrs_script_test_LDFLAGS): Define.(tls_phdrs_script_test_LDADD): Define.* testsuite/Makefile.in: Rebuild.2010-03-23 Cary Coutant <ccoutant@google.com>* fileread.cc (find_or_make_view): Fix comment.2010-03-23 Ian Lance Taylor <iant@google.com>* script-sections.cc (class Orphan_section_placement): DefinePLACE_TLS and PLACE_TLS_BSS.(Orphan_section_placement::Orphan_section_placement): Initializenew places.(Orphan_section_placement::find_place): Handle SHF_TLS sections.* testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.(tls_script_test_SOURCES): Define.(tls_script_test_DEPENDENCIES): Define.(tls_script_test_LDFLAGS): Define.(tls_script_test_LDADD): Define.* testsuite/Makefile.in: Rebuild.2010-03-22 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relocate_functions::abs8,Arm_relocate_functions::abs16): Use correct check for overflowspecified in the ARM ELF specs.(Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branchtarget of a BLX instruction specially.(Reloc_stub::stub_type_for_reloc): Ditto.(Relocate::relocate): Use symbolic names instead of numeric relocationcodes to report error.(Target_arm::do_relox): Reduce default stub-group size for Cortex-A8workaround.* testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout andthumb2_blx_out_of_range.stdout(thumb_bl_out_of_range, thumb_bl_out_of_range.o,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_out_of_range.stdout, thumb_blx_out_of_range,thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,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.o): New rules.(MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,thumb2_blx_in_range and thumb2_blx_out_of_range.* testsuite/Makefile.in: Regenerate.* arm_branch_in_range.sh: Add tests for THUMB BLX.* testsuite/thumb_blx_in_range.s: New file.* testsuite/thumb_blx_out_of_range.s: New file.2010-03-22 Rafael Espindola <espindola@google.com>* archive.cc (Should_include): Move to archive.h.(should_include_member): Make it a member of Archive.(Lib_group): New.(Add_lib_group_symbols): New.* archive.h: Include options.h.(Archive_member): Moved from Archive.(Should_include): Moved from archive.cc.(Lib_group): New.(Add_lib_group_symbols): New.* dynobj.cc (do_should_include_member): New.* dynobj.h (do_should_include_member): New.* gold.cc (queue_initial_tasks): Update call to queue.* main.cc (main): Print lib group stats.* object.cc (do_should_include_member): New.* object.h: Include archive.h.(Object::should_include_member): New.(Object::do_should_include_member): New.(Sized_relobj::do_should_include_member): New.* options.cc (General_options::parse_start_lib): New.(General_options::parse_end_lib): New.(Input_arguments::add_file): Handle lib groups.(Input_arguments::start_group): Check we are not in a lib.(Input_arguments::start_lib): New.(Input_arguments::end_lib): New.* options.h (General_options): Add start_lib and end_lib.(Input_argument::lib_): New.(Input_argument::lib): New.(Input_argument::is_lib): New.(Input_file_lib): New.(Input_arguments::in_lib_): New.(Input_arguments::in_lib): New.(Input_arguments::start_lib): New.(Input_arguments::end_lib_): New.* plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbolsin unused members as preempted.(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,return the blocker.(Read_symbols::do_whole_lib_group): New.(Read_symbols::do_lib_group): New.(Read_symbols::do_read_symbols): Handle lib groups.(Read_symbols::get_name): Handle lib groups.* readsyms.h (Read_symbols): Add an archive member pointer.(Read_symbols::do_whole_lib_group): New.(Read_symbols::do_lib_group): New.(Read_symbols::member_): New.* script.cc (read_input_script): Update call to queue_soon.2010-03-19 Doug Kwan <dougkwan@google.com>* arm.cc (Stub_table::Stub_table): Initialize new data membersStub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.(Stub_table::add_reloc_stub): Assign stub offset and updateStub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.(Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):New data members.(Stub_table::update_data_size_and_addralign): UseStub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_instead of going over all reloc stubs.(Stub_table::finalize_stubs): Do not assign reloc stub offsets.* stringpool.cc (Stringpool_template::Stringpool_template): InitializeStringpool_template::offset_ to size of Stringpool_char.(Stringpool_template::new_key_offset): Remove code to initializeStringpool_template::offset_.* stringpool.h (Stringpool_template::set_no_zero_null): SetStringpool_template::offset_ to zero.2010-03-15 Doug Kwan <dougkwan@google.com>* stringpool.cc (Stringpool_template::Stringpool_template): Initializeoffset_.(Stringpool_template::new_key_offset): New method.(Stringpool_template::add_string): Assign offsets when adding newstrings.(Stringpool_template::set_string_offsets): Do not set string offsetswhen not optimizing.* stringpool.h (Chunked_vector::Chunked_vector): Initialize datamember size_.(Chunked_vector::clear): Clear size_.(Chunked_vector::reserve): Call reserve method of all Element_vectors.(Chunked_vector::size): Return size_.(Chunked_vector::push_back): Use size_ to find insert position.(Chunked_vector::size_): New data member.(Stringpool_template::set_no_zero_null): Assert string set is empty.(Stringpool_template::new_key_offset): New method declaration.(Stringpool_template::offset_): New data member.2010-03-15 Rafael Espindola <espindola@google.com>* readsyms.cc (Read_symbols::do_read_symbols): Update calls toAdd_symbols' constructor.* readsyms.h (Add_symbols): Remove the input_group member.2010-03-10 Ian Lance Taylor <iant@google.com>* reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call thetarget to ask whether a reference to a symbol requires a stacksplit.* target.h (Target::is_call_to_non_split): New function.(Target::do_is_call_to_non_split): Declare virtual function.* target.cc: Include "symtab.h".(Target::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 <ccoutant@google.com>* 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[2]): Add whole_file_view_ to list of views.(File_read::make_view): Remove test of whole_file_view_.(File_read::find_or_make_view): Create whole_file_view_ ifnecessary.(File_read::clear_views): Replace bool parameter with enum;adjust all callers. Don't delete views with permanent data;do delete cached views and views from archives if--no-keep-files-mapped is set. Set whole_file_view_ to NULLif clearing the corresponding view.* fileread.h (File_read::Clear_views_mode): New enum.(File_read::View::is_permanent_view): New method.(File_read::clear_views): Replace bool parameterwith enum; adjust all callers.* options.h (General_options): Change keep_files_mapped option;add map_whole_files.* readsyms.cc (Add_symbols::run): Delete sd_ object beforereleasing the file.* reloc.cc (Scan_relocs::run): Delete rd_ object before releasingthe file.2010-03-10 David S. Miller <davem@davemloft.net>* sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.2010-03-09 Sriraman Tallam <tmsriram@google.com>* icf.cc (get_section_contents): Add '@' marker after processing themerge reloc.2010-03-08 Doug Kwan <dougkwan@google.com>* gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakagedue to a conversion warning.(Arm_relobj::update_output_local_symbol_count): Check for localsymbol with unset output index.2010-03-05 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add --spare-dynamic-tags.* output.cc (Output_data_dynamic::set_final_data_size): Implement--spare-dynamic-tags.2010-03-05 Ian Lance Taylor <iant@google.com>* incremental.cc: Include "libiberty.h".2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>* dynobj.h (Verdef::Verdef): Add is_info arg, is_info memberfunction, is_info_ member.* dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.(Versions::Versions): Update caller.(Versions::define_base_version): Likewise.(Versions::add_def): Likewise.2010-03-03 Sriraman Tallam <tmsriram@google.com>* i386.cc (Target_i386::can_check_for_function_pointers): New function.(Scan::possible_function_pointer_reloc): New function.(Scan::local_reloc_may_be_function_pointer): Change to callpossible_function_pointer_reloc.(Scan::global_reloc_may_be_function_pointer): Ditto.* icf.h (Icf::check_section_for_function_pointers): Change to rejectrelocations in ".data.rel.ro._ZTV" section.* testsuite/icf_safe_so_test.sh: Change to pass i386.* testsuite/icf_safe_so_test.cc: Ditto.* testsuite/icf_safe_test.cc: Ditto.* testsuite/icf_safe_test.sh: Ditto.2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>Ian Lance Taylor <iant@google.com>* target-reloc.h (relocate_section): Check the symbol table indexfor -1U before setting the local symbol index.(scan_relocatable_relocs): If copying the relocation, record thatthe local symbol is required.* object.h (Symbol_value::is_output_symtab_index_set): Newfunction.(Symbol_value::may_be_discarded_from_output_symtab): Newfunction.(Symbol_value::has_output_symtab_entry): New function.(Symbol_value::needs_output_symtab_entry): Remove.(Symbol_value::output_symtab_index): Make sure the symbol index isset.(Symbol_value::set_output_symtab_index): Make sure the symbolindex is not set. Make sure the new index is valid.(Symbol_value::set_must_have_output_symtab_entry): New function.(Symbol_value::has_output_dynsym_entry): New function.(Symbol_value::set_output_dynsym_index): Make sure the new indexis valid.(Sized_relobj::set_must_have_output_symtab_entry): New function.* object.cc (Sized_relobj::do_count_local_symbols): Only discard alocal symbol if permitted.(Sized_relobj::do_finalize_local_symbols): Callis_output_symtab_index_set rather than needs_output_symtab_entry.(Sized_relobj::write_local_symbols): Call has_output_symtab_entryrather than needs_output_symtab_entry. Callhas_output_dynsym_entry rather than needs_output_dynsym_entry.* arm.cc (Arm_relobj::update_output_local_symbol_count): Callis_output_symtab_index_set rather than needs_output_symtab_entry.* testsuite/discard_locals_relocatable_test.c: New file.* testsuite/discard_locals_test.sh: Test -r.* testsuite/Makefile.am (check_DATA): Adddiscard_locals_relocatable_test1.syms,discard_local_relocatable_test2.syms.(MOSTLYCLEANFILES): Likewise. Also adddiscard_locals_relocatable_test1.lout anddiscard_locals_relocatable_test2.out.(discard_locals_relocatable_test1.syms): New target.(discard_locals_relocatable_test.o): New target.(discard_locals_relocatable_test1.out): New target.(discard_locals_relocatable_test2.syms): New target.(discard_locals_relocatable_test2.out): New target.(various): Add missing ../ld-new dependencies.* testsuite/Makefile.in: Rebuild.2010-03-03 Nick Clifton <nickc@redhat.com>* po/fi.po: New Finnish translation.2010-03-01 Doug Kwan <dougkwan@google.com>* layout.cc (Layout::Layout): Force section types of .init_array*,.preinit_array* and .fini_array* sections.* output.cc (Output_section::Input_section_sort_entry::has_priority):Fix check of return value of std::string::find.().(Output_section::Input_section_sort_compare::operator()): Removecomment about .init_array.(Output_section::Input_section_sort_init_fini_compare::operator()):New method.(Output_section::sort_attached_input_sections): Handle .init_arrayand .fini_array specially.* output.h (Output_section::Inut_section_sort_compare): Updatecomment.(Output_section::Input_section_sort_init_fini_compare): New struct.2010-02-26 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Relocate::reloc_is_non_pic): TreatR_ARM_PREL31 and R_ARM_SBREL31 as position independent.* testsuite/debug_msg.sh: Avoid matching source line number foruse of global variable undef_int.2010-02-26 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::scan_reloc_for_stub): Move code handlingR_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.(Target_arm::scan_reloc_section_for_stubs): Instead of callingscan_reloc_for_stub, do all processing of R_ARM_V4BX here.* options.cc (General_options::General_options): Initialize memberfix_v4bx_.* testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh(check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdoutand rm_no_fix_v4bx.stdout(arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.(MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworkingand arm_no_fix_v4bx.* Makefile.in: Regenerate.* testsuite/arm_fix_v4bx.s: New file.* testsuite/arm_fix_v4bx.sh: Ditto.2010-02-24 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::got_section): Make the .got section the firstnon RELRO section in the data segment.* testsuite/script_test_5.sh: Fix match patterns to avoid matchingsuffixes of section names.2010-02-24 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_finalize_sections): Skip processor specificflags and attributes merging if an input file is a binary file.* fileread.cc (Input_file::open): Record format of original file.* fileread.h (Input_file::Format): New enum type.(Input_file::Input_file): Initialize data member format_.(Input_file::format): New method definition.(Input_file::format_):: New data member.2010-02-24 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_output_data_got): New class.(ARM_TCB_SIZE): New constant(Target_arm): Use Arm_output_data_got instead of Output_data_got.(Arm_output_section::fix_exidx_coverage): Add a parameter for layout.If user uses a script with a SECTIONS clause, issue only a warningfor a misplaced EXIDX input section. Otherwise, issue an error.(Arm_relobj::do_gc_process_relocs): Exit early if we are not doinggarbage collection.(Target_arm::got_mode_index_entry): Handle static linking.(Target_arm::Scan::local): Ditto.(Target_arm::Scan::global): Ditto.(Target_arm::Relocate::relocate_tls): Handle static linking. Fixall incorrectly implemented relocations.(Target_arm::fix_exidx_coverage): Pass layout toArm_output_section::fix_exidx_coverage.* layout.cc (Layout::section_name_mapping): Remove trailing dotsfrom ".ARM.exidx." and ".ARM.extab.".2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Target_arm::do_finalize_sections): Create attributesection if it does not already exist.* attributes.cc (Attributes_section_data::Attributes_section_data):Don't crash if size is zero.2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>Ian Lance Taylor <iant@google.com>* gold.cc (queue_middle_tasks): If no input files were opened,exit.* workqueue.h (Task_function::Task_function): Assert that there isa blocker.2010-02-22 Doug Kwan <dougkwan@google.com>* gold-threads.h (Once::~Once): Explicitly define virtual destructor.* icf.cc (get_section_contents): Cast snprintf arguments to long longtypes to avoid warnings due to different uint64_t implementationson different hosts.2010-02-21 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug inhandling of the maximum backward branch offset.(Arm_relocate_functions::thumb_branch_common): Ditto.* testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.(check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdoutthumb_bl_in_range.stdout, thumb_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_out_of_range.stdout, arm_bl_out_of_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_out_of_range thumb_bl_out_of_range.o,thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.othumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,thumb2_bl_out_of_range.o): New rules.(MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range andthumb2_bl_out_of_range* testsuite/Makefile.in: Regenerate.* testsuite/arm_bl_in_range.s: New file.* testsuite/arm_bl_out_of_range.s: Ditto.* testsuite/arm_branch_in_range.sh: Ditto.* testsuite/arm_branch_range.t: Ditto.* testsuite/thumb2_branch_range.t: Ditto.* testsuite/thumb_bl_in_range.s: Ditto.* testsuite/thumb_bl_out_of_range.s: Ditto.* testsuite/thumb_branch_range.t: Ditto.2010-02-20 Sriraman Tallam <tmsriram@google.com>* gc.h (gc_process_relocs): Change vectors to point to the new list.Add reloc offset information.* icf.cc (get_section_contents): Change iterators to point to the newvectors. Add reloc offset information to the contents.* icf.h (Icf::Sections_reachable_info): New typedef.(Icf::Sections_reachable_list): New typedef.(Icf::Offset_info): New typedef.(Icf::Reloc_info): New struct typedef.(Icf::Reloc_info_list): New typedef.(Icf::symbol_reloc_list): Delete method.(Icf::addend_reloc_list): Delete method.(Icf::section_reloc_list): Delete method.(Icf::reloc_info_list): New method.(Icf::reloc_info_list_): New member.2010-02-19 Doug Kwan <dougkwan@google.com>* 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.* arm.cc (Arm_relocation_functions): New forward declaration.(Target_arm::Target_arm): Initialize new data membersgot_mod_index_offset_ and tls_base_symbol_defined_.(Target_arm::Relocate::relocate_tls): New method.(Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):New methods.(Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.(Target_arm::got_mod_index_offset_,Target_arm::tls_base_symbol_defined_): New data members.(Target_arm::Scan::local, Target::Scan::global,Target_arm::Relocate::relocate): Handle 32-bit initial TLSrelocations.2010-02-18 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::find_linked_text_section): New method.(Arm_relobj::make_exidx_input_section): Pass section index of linkedtext section as a parameter becuase some broken tools may not setthe link in section header.(Target_arm::has_got_section): New method.(Target_arm::scan_section_for_cortex_a8_stubs): Treat an input sectionwithout any mapping symbol as data only. Remove warning.(Arm_relobj::do_read_synbols): If an EXIDX input section has nolink in its section header, try to discover the link by inspecting theREL31 relocation at the beginning of the section.(Target_arm::Scan::check_non_pic): Report name of offending relocationin error message.(Target_arm::Scan::global): Treat any reference to the symbol_GLOBAL_OFFSET_TABLE_ as a GOT access.2010-02-12 Sriraman Tallam <tmsriram@google.com>* arm.cc (Scan::local_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.(Scan::global_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.* i386.cc (Scan::local_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.(Scan::global_reloc_may_be_function_pointer): New function.(Scan::possible_function_pointer_reloc): New function.(Target_x86_64::can_check_for_function_pointers): New function.* gc.h (gc_process_relocs): Scan relocation types to determine iffunction pointers were taken for targets that support it.* icf.cc (Icf::find_identical_sections): Include functions forfolding in safe ICF whose pointer is not taken.* icf.h (Secn_fptr_taken_set): New typedef.(fptr_section_id_): New member.(section_has_function_pointers): New function.(set_section_has_function_pointers): New function.(check_section_for_function_pointers): New function.* options.h: Fix comment for safe ICF option.* target.h (can_check_for_function_pointers): New function.* testsuite/Makefile.am: Add icf_safe_so_test test case.Modify icf_safe_test for X86-64.* testsuite/Makefile.in: Regenerate.* testsuite/icf_safe_so_test.cc: New file.* testsuite/icf_safe_so_test.sh: New file.* testsuite/icf_safe_test.cc (kept_func_3): New function.(main): Change to take pointer to function kept_func_3.* testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safefolding is done correctly for X86-64.2010-02-12 David S. Miller <davem@davemloft.net>* output.h (Output_reloc<SHT_REL>::Output_reloc): Addis_symbolless parameter.(Output_reloc<SHT_REL>::is_symbolless): New.(Output_reloc<SHT_REL>::is_symbolless_): New.(Output_reloc<SHT_REL>::type_): Decrease to 29 bits.(Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.(Output_reloc<SHT_RELA>::is_symbolless): New.(Output_data_reloc::add_global): Handle is_symbolless.(Output_data_reloc::add_global_relative): Likewise.(Output_data_reloc::add_local): Likewise.(Output_data_reloc::add_local_relative): Likewise.(Output_data_reloc::add_symbolless_global_addend): New.(Output_data_reloc::add_symbolless_local_addend): New.* output.cc (Output_reloc<SHT_REL>::Output_reloc): Handleis_symbolless.(Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_instead of ->is_relative_(Output_reloc::write): Likewise.(Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_(Output_reloc::write_rel): Simplify.* sparc.cc (Target_sparc::Scan::local): Use->add_symbolless_local_addend as needed.(Target_sparc::Scan::global): Use ->add_symbolless_global_addend asneeded. Also, emit appropriate unaligned vs. aligned dynamic relocbased upon relocation offset.2010-02-11 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.(Target_arm::Scan::global): Ditto. Also remove a comment before thebeginning of function.(Target_arm::Relocate::relocate): Remove error messages for MOVW_ABSand MOVT_ABS relocations. Those are non issued in scanning. Fixparameter is_32bit in calls to should_apply_static_reloc.* testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.(check_DATA): Add arm_abs_global.stdout.(arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,arm_abs_global.stdout): New rules.(MOSTLLYCLEANFILES): Add arm_abs_global* Makefile.in: Regenerate.* testsuite/arm_abs_global.s: New file.* testsuite/arm_abs_global.sh: Ditto.* testsuite/arm_abs_lib.s: Ditto.2010-02-11 Ian Lance Taylor <iant@google.com>* gold.cc (queue_middle_gc_tasks): Use a separate blocker for eachRead_relocs task.(queue_middle_tasks): Likewise, and also for Scan_relocs. RunAllocate_commons_task first.* reloc.cc (Read_relocs::run): Pass next_blocker_ down to nexttask, rather than symtab_lock_.(Gc_process_relocs::~Gc_process_relocs): New function.(Gc_process_relocs::is_runnable): Check this_blocker_.(Gc_process_relocs::locks): Use next_blocker_ rather thanblocker_.(Scan_relocs::~Scan_relocs): New function.(Scan_relocs::is_runnable): Check this_blocker_ rather thansymtab_lock_.(Scan_relocs::locks): Drop symtab_lock_ and blocker_. Addnext_blocker_.* reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_fields. Add this_blocker_ and next_blocker_ fields. Adjustconstructor accordingly.(class Gc_process_relocs): Likewise.(class Scan_relocs): Likewise.* common.h (class Allocate_commons_task): Remove symtab_lock_field, and corresponding constructor parameter.* common.cc (Allocate_commons_tasK::is_runnable): Remove use ofsymtab_lock_.(Allocate_commons_task::locks): Likewise.2010-02-11 Ian Lance Taylor <iant@google.com>* gold-threads.h (class Once): Define.(class Initialize_lock): Rewrite as child of Once.* gold-threads.cc (class Once_initialize): Define.(once_pointer_control): New static variable.(once_pointer, once_arg): New static variables.(c_run_once): New static function.(Once::Once, Once::run_once, Once::internal_run): New functions.(class Initialize_lock_once): Remove.(initialize_lock_control): Remove.(initialize_lock_pointer): Remove.(initialize_lock_once): Remove.(Initialize_lock::Initialize_lock): Move to gold-threads.h.(Initialize_lock::initialize): Rewrite.(Initialize_lock::do_run_once): New function.* archive.cc (Archive::interpret_header): Only clear name if it isnot already empty.* fileread.cc: Include "gold-threads.h"(file_counts_lock): New static variable.(file_counts_initialize_lock): Likewise.(File_read::release): Only increment counts when using --stats.Use a lock around the increment.* parameters.cc (class Set_parameters_target_once): Define.(set_parameters_target_once): New static variable.(Parameters::Parameters): Move here from parameters.h.(Parameters::set_target): Rewrite.(Parameters::set_target_once): New function.(Parameters::clear_target): Move here and rewrite.* parameters.h (class Parameters): Update declarations. Addset_parameters_target_once_ field.(Parameters::Parameters): Move to parameters.cc.(Parameters::clear_target): Likewise.* readsyms.cc (Read_symbols::do_group): Create a Start_grouptask.(Start_group::~Start_group): New function.(Start_group::is_runnable): New function.(Start_group::locks, Start_group::run): New functions.(Finish_group::run): Change saw_undefined to size_t.* readsyms.h (class Start_group): Define.(class Finish_group): Change saw_undefined_ field to size_t.(Finish_group::Finish_group): Remove saw_undefined andthis_blocker parameters. Change all callers.(Finish_group::set_saw_undefined): New function.(Finish_group::set_blocker): New function.* symtab.h (class Symbol_table): Change saw_undefined to returnsize_t. Change saw_undefined_ field to size_t.* target-select.cc (Set_target_once::do_run_once): New function.(Target_selector::Target_selector): Initialize set_target_once_field. Don't initialize lock_ and initialize_lock_ fields.(Target_selector::instantiate_target): Rewrite.(Target_selector::set_target): New function.* target-select.h (class Set_target_once): Define.(class Target_selector): Update declarations. MakeSet_target_once a friend. Remove lock_ and initialize_lock_fields. Add set_target_once_ field.2010-02-10 Ian Lance Taylor <iant@google.com>* dirsearch.cc (Dirsearch::initialize): Add all blockers beforequeueing any tasks.* gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.(queue_middle_tasks): Add all blockers before queueing any tasks.(queue_final_tasks): Likewise.* token.h (Task_token::add_blockers): New function.* object.h (Input_objects::number_of_relobjs): New function.2010-02-10 Ian Lance Taylor <iant@google.com>* i386.cc (Relocate::relocate_tls): A local symbol is final if notshared, not if not position independent.* x86_64.cc (Relocate::relocate_tls): Likewise.* testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.(tls_pie_pic_test): New target.* testsuite/Makefile.in: Rebuild.* testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.(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.* testsuite/Makefile.in: Rebuild.2010-02-09 David S. Miller <davem@davemloft.net>* sparc.cc (Target_sparc::Scan::local): Do not emit relocs other thanR_SPARC_RELATIVE using ->add_local_relative().(Target_sparc::Scan::global): Likewise for ->add_global_relative().* output.h (Output_data_dynamic::add_section_size): New methodthat takes two Output_data objects.(Output_data_dynamic::Dynamic_entry): Create storage for secondaryentry param. Handle it in initializers.* output.cc (Output_data_dynamic::Dynamic_entry::write): ForDYNAMIC_SECTION_SIZE, add in second object size if non-NULL.* layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_pltarg.* 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* arm.cc (Target_arm::do_finalize_sections): Update to pass falsefor dynrel_includes_plt.* i386.cc (Target_i386::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 outputbefore .rela.plt(Target_sparc::do_finalize_sections): Update to pass true fordynrel_includes_plt.* powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to beoutput before .rela.plt(Target_powerpc::do_finalize_sections): Update to pass true fordynrel_includes_plt when 32-bit.2010-02-08 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::simple_input_section_output_address): Newmethod.(Arm_relobj::section_needs_cortex_a8_stub_scanning,Arm_relobj::scan_section_for_cortex_a8_stubs,Arm_relobj::do_relocation_section): Instead of callingOutput_section::output_address, use fasterArm_relobj::simple_input_section_output_address.2010-02-08 David S. Miller <davem@davemloft.net>* sparc.cc (Target_sparc::Relocate::relocate): If relocation offset isunaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unalignedrelocation helper function.* sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*just like R_SPARC_GOT{10,13,22}.(Target_sparc::Scan::local): Likewise.(Target_sparc::Relocate:relocate): Likewise.2010-02-06 Ian Lance Taylor <iant@google.com>* configure.ac: Rewrite targetobjs duplicate removal code to useonly shell constructs.* configure: Rebuild.2010-02-05 Doug Kwan <dougkwan@google.com>PR 11247* arm.cc (Arm_relobj::section_is_scannable): New method.(Arm_relobj::section_needs_reloc_stub_scanning): Use it.(Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.2010-02-04 Doug Kwan <dougkwan@google.com>PR 11247* arm-reloc-property.cc (cstdio): Include.* configure.ac (targetobjs): Remove duplicates.* configure: Regenerate.* resolve.cc (Symbol_table::resolve): Explicit instantiate bothbig and little endian version for a given address size.2010-02-03 Doug Kwan <dougkwan@google.com>* arm-reloc-property.cc(Arm_reloc_property_table::reloc_name_in_error_message): New methoddefinition.* arm-reloc-property.h(Arm_reloc_property_table::get_implemented_static_reloc_property):New method definition.(Arm_reloc_property_table::reloc_name_in_error_message): New methoddeclaration.* arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Changeoverflow to N.(GOT_PREL): Change implemented to Y.* arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.(Target_arm::Relocate::reloc_needs_sym_origin): Remove method.(Arm_relocate_functions::movw_abs_nc): Remove method.(Arm_relocate_functions::movt_abs): Ditto.(Arm_relocate_functions::thm_movw_abs_nc): Ditto.(Arm_relocate_functions::thm_movt_abs): Ditto.(Arm_relocate_functions::movw_rel_nc): Ditto.(Arm_relocate_functions::movw_rel): Ditto.(Arm_relocate_functions::movt_rel): Ditto.(Arm_relocate_functions:thm_movw_rel_nc): Ditto.(Arm_relocate_functions:thm_movw_rel): Ditto.(Arm_relocate_functions:thm_movt_rel): Ditto.(Arm_relocate_functions::movw, Arm_relocate_functions::movt,(Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):New method definitions.(Arm_relocation_functions::arm_grp_alu): Add assertion for group index.(Arm_relocation_functions::arm_grp_ldr): Ditto.(Arm_relocation_functions::arm_grp_ldrs): Ditto.(Arm_relocation_functions::arm_grp_ldc): Ditto.(Target_arm::Relocate::relocate): Check for non-static orunimplemented relocation code and exit early. Change calls toTarget_arm::reloc_uses_thumb_bit andTarget_arm::Reloc::reloc_needs_sym_origin to use relocation propertyinstead. Refactor code to handle similar relocations to increasecode sharing. Remove check for unsupported relocation code in switchstatement.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Userelocation property table to find out size. Change error message toprint out the name of a relocation code instead of the numeric value.(Target_arm::scan_reloc_for_stub): Use relocation property tableinstead of calling Target_arm::reloc_uses_thumb_bit().2010-02-02 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::relocate_section): Do view adjustment for alltypes of relaxed input section.2010-02-02 Doug Kwan <dougkwan@google.com>* Makefile.am (HFILES): Add arm-reloc-property.h.(DEFFILES): New.(TARGETSOURCES): Add arm-reloc-property.cc(ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)(libgold_a_SOURCES): $(DEFFILES)* Makefile.in: Regenerate.* arm-reloc-property.cc: New file.* arm-reloc-property.h: New file.* arm-reloc.def: New file.* arm.cc: Update comments.(arm-reloc-property.h): New included header.(arm_reloc_property_table): New global variable.(Target_arm::do_select_as_default_target): New method definition.* configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Addarm-reloc-property to targ_extra_obj.* parameters.cc (set_parameters_target): CallTarget::select_as_default_target().* target.h (Target::select_as_default_target): New method definition.(Target::do_select_as_default_target): Same.2010-02-01 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initializefirst_output_text_section_.(Arm_exidx_fixup::first_output_text_section): New method definition.(Arm_exidx_fixup::first_output_text_section_): New data member.(Arm_exidx_fixup::process_exidx_section): Record the first textoutput section seen.(Arm_output_section::fix_exidx_coverage): Set correct linked sectionand entsize in output section header.2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>* gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.(Arm_relocate_functions::thm_alu11): New Method.(Arm_relocate_functions::thm_pc8): New Method.(Arm_relocate_functions::thm_pc12): New Method.(Target_arm::Scan::local): Handle the relocations.(Target_arm::Scan::global): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.2010-01-29 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Scan::global): General PLTs for the same setof relocation types as ld.2010-01-29 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relocate_functions::arm_branch_common) Change visibilityto public.(Arm_relocate_functions::thumb_branch_common): Ditto.(Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,Arm_relocate_functions::xpc25, Arm_relocate_functions::call,Arm_relocate_functions::jump24): Remove.(Target_arm::Relocate::relocate): Adjust code to callArm_relocation_functions::arm_branch_common andArm_relocation_functions::thumb_branch_common instead of their removedwrappers. Merge switch-cases together to reduce source code size.2010-01-29 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::Arm_relobj): Initialize new data memberoutput_local_symbol_count_needs_update_.(Arm_relobj::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::output_local_symbol_count_needs_update_): New datamember.(Arm_exidx_cantunwind::do_fixed_endian_write): Write addressof pointed function as in a R_ARM_PREL31 relocation.(Arm_output_section<big_endian>::fix_exidx_coverage): Mark objectsfor output local symbol count updating.(Target_arm::do_relax): Update output local symbol counts in objectsif necessary.* object.h (Sized_relobj::set_output_local_symbol_count): New method.2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc: Added support for the ARM relocations: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.(Arm_relocate_functions::movw_rel_nc): Renamed (wasmovw_prel_nc).(Arm_relocate_functions::movw_rel): New method.(Arm_relocate_functions::movt_rel): Renamed (was movt_prel).(Arm_relocate_functions::thm_movw_rel_nc): Renamed (wasthm_movw_prel_nc).(Arm_relocate_functions::thm_movw_rel): New method.(Arm_relocate_functions::thm_movt_rel): Renamed (wasthm_movt_prel).(Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BRELrelocations.(Target_arm::Scan::global): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc: Added support for ARM group relocations.(Target_arm::reloc_needs_sym_origin): New method.(Arm_relocate_functions::calc_grp_kn): New method.(Arm_relocate_functions::calc_grp_residual): New method.(Arm_relocate_functions::calc_grp_gn): New method.(Arm_relocate_functions::arm_grp_alu): New Method.(Arm_relocate_functions::arm_grp_ldr): New Method.(Arm_relocate_functions::arm_grp_ldrs): New Method.(Arm_relocate_functions::arm_grp_ldc): New Method.(Target_arm::Scan::local): Handle the ARM group relocations.(Target_arm::Scan::global): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.2010-01-26 Doug Kwan <dougkwan@google.com>* arm.cc (set): Include.(class Arm_exidx_fixup): Change type of last_input_section_ to constpointer type.(Arm_output_section::Text_section_list): New type.(Arm_output_section::append_text_sections_to_list): New method.(Arm_output_section::fix_exidx_coverage): Ditto.(Arm_relobj::Arm_relobj): Initialize exidx_section_map_.(Arm_relobj::convert_input_section_to_relaxed_section): UseRelobj::set_section_offset() instead ofSized_relobj::invalidate_section_offset().(Arm_relobj::section_needs_reloc_stub_scanning): Add an extraparameter for section headers. Ignore relocation sections forunallocated sections and EXIDX sections.(Target_arm::fix_exidx_coverage): New method.(Target_arm::output_section_address_less_than): New type.(Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of thelinked text section instead of the EXIDX section.(Arm_output_section::create_stub_group): Add an assertion to checkthat this is not an EXIDX output section.(Arm_output_section::append_text_sections_to_list): New method.(Arm_output_section::fix_exidx_coverage): Ditto.(Arm_relobj::scan_sections_for_stubs): Adjust call toArm_relobj::section_needs_reloc_stub_scanning.(Target_arm::do_relax): Fix EXIDX output section coverage in thefirst pass.(Target_arm::fix_exidx_coverage): New method.* object.h (Relobj::set_output_section): New method.(Sized_relobj::invalidate_section_offset): Remove method.(Sized_relobj::do_invalidate_section_offset): Remove method.(Sized_relobj::do_set_section_offset): Handle offset value -1.2010-01-25 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_merged_section::do_output_offset):Fix warning due to signed and unsigned comparison on a 32-bit host.2010-01-22 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_relax): Record an output section for sectionoffset adjustment it contains any stub table that has changed.* layout.cc (Layout::clean_up_after_relaxation): Adjust sectionoffsets in an output section if necessary.* output.cc (Output_section::Output_section): Initializesection_offsets_need_adjustments_.(Output_section::add_input_section_for_script): Renamed toOutput_section::add_simple_input_section.(Output_section::save_states): Add a comment.(Output_section::discard_states): New method defintion.(Output_section::adjust_section_offsets): Same.* output.h (Output_section::add_input_section_for_script): Renamed toOutput_section::add_simple_input_section.(Output_section::discard_states): New method declaration.(Output_section::adjust_section_offsets): Same.(Output_section::section_offsets_need_adjustment,Output_section::set_section_offsets_need_adjustment): New methoddefinitions.(Output_section::section_offsets_need_adjustment_): New data member.* script-sections.cc(Output_section_element_input::set_section_address): Adjust code forrenaming of Output_section::add_input_section_for_script.(Orphan_output_section::set_section_address): Same.2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>* gold/arm.cc (Target_arm): Updated fix_v4bx method and usage ofFix_v4bx enum values .* gold/options.h (General_options): New option definitions.(General_options::fix_v4bx): New method.(General_options::Fix_v4bx): New enum.* gold/options.cc (General_options::parse_fix_v4bx): New method.(General_options::parse_fix_v4bx_interworking): New method.2010-01-22 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_fixup): New class.2010-01-21 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): Newclasses.(Arm_exidx_section_offset_map): New type.2010-01-21 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_exidx_input_section): New class.(Arm_relobj::exidx_input_section_by_link,Arm_relobj::exidx_input_section_by_shndx,Arm_relobj::make_exidx_input_section): New methods.(read_arm_attributes_section): Remove.(Arm_relobj::do_read_symbols): Look for ARM.exidx sections and recordinformation about them.(Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_sectionto here.2010-01-20 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Arm_input_section_map): Change key type fromInput_section_specifier to Section_id.(Target_arm::new_arm_input_section: Adjust code for change of keytype.(Target_arm::find_arm_input_section): Ditto.* gc.h (object.h): Include for Section_id nand Section_id_hash.(Section_id): Remove.(Garbage_collection::Section_id_hash): Remove.* icf.h (object.h): Include for Section_id nand Section_id_hash.(Section_id): Remove.(Icf::Section_id_hash): Remove.* object.h (Section_id, Const_section_id, Section_id_hash,Const_section_id_hash): New type definitions.* output.cc (Output_section::add_relaxed_input_section): Change touse Const_section_id instead of Input_section_specifier as key type.(Output_section::add_merge_input_section): Ditto.(Output_section::build_relaxation_map): Change to use Section_idinstead of Input_section_specifier as key type.(Output_section::convert_input_sections_in_list_to_relaxed_sections):Ditto.(Output_section::convert_input_sections_to_relaxed_sections): Changeto use Const_section_id instead of Input_section_specifier as key type.(Output_section::find_merge_section): Ditto.(Output_section::find_relaxed_input_section): Ditto.* output.h (Input_section_specifier): Remove class.(Output_section::Output_section_data_by_input_section_map): Changekey type to Const_section_id.(Output_section::Output_relaxed_input_section_by_input_section_map):Ditto.(Output_section::Relaxation_map): Change key type to Section_id.2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>* gold/arm.cc: Added support for R_ARM_V4BX relocation(class Arm_v4bx_stub): New class.(DEF_STUBS): Updated definition to support v4_veneer_bx.(Stub_factory::make_arm_v4bx_stub): New method.(Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.(Stub_table::empty): Handle v4bx stubs.(Stub_table::add_arm_v4bx_stub): New method.(Stub_table::find_arm_v4bx_stub): New method.(Arm_relocate_functions::v4bx): New method.(Target_arm::fix_v4bx): New method.(Target_arm::Target_arm): Handle R_ARM_V4BX.(Stub_table::relocate_stubs): Likewise.(Stub_table::do_write): Likewise.(Stub_table::update_data_size_and_addralign): Likewise.(Stub_table::finalize_stubs): Likewise.(Target_arm::Scan::local): Likewise.(Target_arm::Scan::global): Likewise.(Target_arm::do_finalize_sections): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.(Target_arm::scan_reloc_for_stub): Likewise.(Target_arm::scan_reloc_section_for_stubs): Likewise.2010-01-19 Ian Lance Taylor <iant@google.com>* output.cc (Output_section_headers::do_sized_write): Write largesegment count to sh_info field.(Output_file_header::do_sized_write): For large segment count,write PN_XNUM to e_phnum field.2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Arm_relocate_functions::thm_jump6): New function.(Arm_relocate_functions::thm_jump8): New function.(Arm_relocate_functions::thm_jump11): New function.(Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,R_ARM_THM_JUMP11.(Target_arm::Scan::global): Likewise.(Target_arm::Relocate::relocate): Likewise.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.2010-01-14 Doug Kwan <dougkwan@google.com>* arm.cc (map, utility): Include headers.(Target_arm::apply_cortex_a8_workaround): New method.(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::global): R_ARM_THM_JUMP19.(Target_arm::do_finalize_sections): Set fix_cortex_a8_ according tothe --[no-]fix-cortex-a8 command line options.(Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.(Target_arm::relocate_stub): Use addend in instruction template.* options.h (DEFINE_bool): Set the user-set flag.(General_options): Add --[no-]-fix-cortex options.* output.cc (Output_section::convert_input_sections_to_relaxed_sections): Update fast look-up map after conversion.2010-01-14 Sriraman Tallam <tmsriram@google.com>* object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stackin the first pass of do_layout.2010-01-13 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid anapparent compiler problem of not folding static constant integraldata members of elfcpp::Elf_sizes<32>.2010-01-13 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,Arm_relobj::section_needs_cortex_a8_stub_scanning,Arm_relobj::scan_section_for_cortex_a8_erratum,Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.(Arm_relobj::scan_sections_for_stubs): Move code deciding whatsections to scan for relocation stubs into a new methodArm_relobj::section_needs_reloc_stub_scanning. Handle bothrelocation and Cortex-A8 stub scanning.(Target_arm::do_relax): Force stubs to be after stubbed sectionsif fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs atthe beginning of a new relaxation pass. Update a comment.(Target_arm::scan_span_for_cortex_a8_erratum): New method definition.2010-01-12 Ian Lance Taylor <iant@google.com>* target-reloc.h (visibility_error): New inline function.(relocate_section): Call visibility_error.* testsuite/Makefile.am (check_DATA): Add protected_3.err.(MOSTLYCLEANFILES): Likewise.(protected_4_pic.o, protected_3.err): New targets.* testsuite/protected_4.cc: New file.2010-01-12 Doug Kwan <dougkwan@google.com>* arm.cc (Cortex_a8_reloc): New class.(Target_arm::Target_arm): Initialize new data members fix_cortex_a8_and cortex_a8_relocs_info_.(Target_arm::fix_cortex_a8): New method definition.(Target_arm::Cortex_a8_relocs_info): New type.(Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):New data member declarations.(Target_arm::scan_reloc_for_stub): Record information aboutrelocations for THUMB branches that might be exempted from theCortex-A8 workaround.(Target_arm::do_relax): Clear all Cortex-A8 relocation informationat the beginning of a relaxation pass.2010-01-12 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::mapping_symbols_info_): New data member.(Arm_relobj::Mapping_symbol_position,Arm_reloj::Mapping_symbol_position_less,Arm_relobj::Mapping_symbols_info): New types.(Target_arm::is_mapping_symbol_name): New method definition.(Arm_relobj::do_count_local_symbols): Save information about mappingsymbols.2010-01-11 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relocate_functions::thumb32_branch_offset,Arm_relocate_functions::thumb32_branch_upper,Arm_relocate_functions::thumb32_branch_lower,Arm_relocate_functions::thumb32_cond_branch_offset,Arm_relocate_functions::thumb32_cond_branch_upper,Arm_relocate_functions::thumb32_cond_branch_lower,Arm_relocate_functions::thm_jump19): New methods to handle THUMBbranch offset encoding.(Arm_relocate_functions::thumb_branch_common): Use new branchoffset encoding methods to avoid code duplication.(Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.(Stub_addend_reader::operator()): Use new branch encoding methodto avoid code duplication.2010-01-11 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::do_gc_process_relocs): New method.(Target_arm::do_finalize_sections): Define special EXIDX sectionsymbols only if referenced.* gc.h (Garbage_collection::add_reference): New method.(gc_process_relocs): Use Garbage_collection::add_reference to avoidcode duplication.2010-01-11 Ian Lance Taylor <iant@google.com>* script.cc (Version_script_info::build_expression_list_lookup):Change complaing about duplicate wildcard match from error towarning.* script.cc (class Lazy_demangler): Recreate--revert part of patchof 2009-12-30.(Version_script_info::Version_script_info): Initialize globs_,default_version_, default_is_global_, and exact_. Don'tinitialize globals_ or locals_.(Version_script_info::build_lookup_tables): Build local symbolsfirst.(Version_script_info::unquote): New function.(Version_script_info::add_exact_match): New function.(Version_script_info::build_expression_list_lookup): Remove lookupparameter. Add is_global parameter. Change all callers. Handlewildcard pattern specially. Unquote pattern. Calladd_exact_match.(Version_script_info::get_name_to_match): New function.(Version_script_info::get_symbol_version): New function.(Version_script_info::get_symbol_version_helper): Remove.(Version_script_info::check_unmatched_names): Call unquote.* script.h (class Version_script_info): Change get_symbol_versionto be non-inline and add is_global parameter; change all callers.Rewrite symbol_is_local. Update declarations. Define structVersion_tree_match, Exact, Globs. Don't define struct Lookup.Remove globals_ and locals_ members. Add exact_, globs_,default_version_, is_global_.(Version_script_info::Glob): Remove pattern, add expression andis_global. Update constructor. Change all callers.* dynobj.cc (Versions::finalize): Mark the version symbol as thedefault version.(Versions::symbol_section_contents): If a symbol is undefined, ordefined in a dynamic object, set the version index toVER_NDX_LOCAL.* symtab.cc (Symbol_table::add_from_relobj): Don't callsymbol_is_local.(Symbol_table::add_from_pluginobj): Likewise.* testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.2010-01-11 Doug Kwan <dougkwan@google.com>* Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.(incremental_dump_LDADD): Add linking option for libintl.* Makefile.in: Regenerate.2010-01-11 H.J. Lu <hongjiu.lu@intel.com>PR gold/11144* testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-symsinstead of -Ds.* testsuite/Makefile.in: Regenerated.2010-01-10 Doug Kwan <dougkwan@google.com>* options.h (DEFINE_var): Use parentheses around argument varname__in macro body to avoid any unintended subsequent substitutions.2010-01-10 Ian Lance Taylor <iant@google.com>* resolve.cc (Symbol_table::resolve): Add symbols to list of ODRcandidates before doing symbol resolution.* resolve.cc (Symbol_table::resolve): Add symbols to the list ofODR candidates if only one is weak.2010-01-08 Ian Lance Taylor <iant@google.com>* script.cc (Version_script_info::build_expression_list_lookup):Don't warn about ambiguous version, just record the ambiguity.(Version_script_info::get_symbol_version_helper): Give error ifversion is ambiguous.2010-01-08 Doug Kwan <dougkwan@google.com>* arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,prev_data_size_ and prev_addralign_. Remove initializer fordeleted data member has_been_changed_.(Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_to determine if the table is empty.(Stub_table::has_been_changed, Stub_table_set_has_been_changed):Remove.(Stub_table::add_reloc_stub): Define method in class definitioninstead of just declaring it there.(Stub_table::add_cortex_a8_stub): New method definition.(Stub_table::update_data_size_and_addralign): Ditto.(Stub_table::finalize_stubs): Ditto.(Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.(Stub_table::do_addralign_): Return address alignment in the(Stub_table::do_reset_address_and_file_offset): Define method inclass definition instead of declaring it there. Set current datasize to be the data size of the previous pass.(Stub_table::set_final_data_size): Use current data size as thefinal data size.(Stub_table::relocate_stub): Change parameter type of stub fromReloc_stub pointer to Stub pointer.(Stub_table::addralign_, Stub_table::has_been_changed_): Remove.(Stub_table::Cortex_a8_stub_list): New typedef.(Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,Stub_table::prev_addralign_): New data member.(Arm_relobj::Arm_relobj): Initialize data membersection_has_cortex_a8_workaround_.(Arm_relobj::section_has_cortex_a8_workaround,Arm_relobj::mark_section_for_cortex_a8_workaround): New methoddefinitions.(Arm_relobj::section_has_cortex_a8_workaround_): New data memberdeclarations.(Target_arm::relocate_stub): Change parameter type of stub fromReloc_stub pointer to Stub pointer.(Insn_template::size, Insn_template::alignment): HandleTHUMB16_SPECIAL_TYPE.(Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,Stub_table::update_data_size_and_addralign,Stub_table::apply_cortex_a8_workaround_to_address_range): New methoddefinitions.(Stub_table::relocate_stubs): Handle Cortex-A8 stubs.(Stub_table::do_write): Ditto.(Target_arm::do_relax): Adjust code for changes in Stub_table.2010-01-08 Ian Lance Taylor <iant@google.com>PR 11108* symtab.h (class Symbol): Remove fields is_target_special_ andhas_plt_offset_. Add field is_defined_in_discarded_section_.(Symbol::is_defined_in_discarded_section): New function.(Symbol::set_is_defined_in_discarded_section): New function.(Symbol::has_plt_offset): Rewrite.(Symbol::set_plt_offset): Verify that new offset is not -1U.* symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.Don't initialize is_target_special_ or has_plt_offset_.Initialize is_defined_in_discarded_section_.(Symbol_table::add_from_relobj): If appropriate, setis_defined_in_discarded_section.* resolve.cc (Symbol::override_base_with_special): Don't testis_target_special_. Change has_plt_offset_ to has_plt_offset().* target-reloc.h (relocate_section): Do special handling forsymbols defined in discarded sections for global symbols as wellas local symbols.2010-01-08 Ian Lance Taylor <iant@google.com>* dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL inthe SHT_SYMTAB case.2010-01-08 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj::do_layout): Don't get confused iflayout_eh_frame returns NULL.2010-01-08 Ian Lance Taylor <iant@google.com>PR 11084* dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is nodynamic symbol table, use the normal symbol table.(Sized_dynobj::do_read_symbols): Remove assertion about type ofsymbol table.2010-01-08 Ian Lance Taylor <iant@google.com>PR 11072* layout.cc (Layout::include_section): Remove .gnu_debuglinksections.2010-01-08 H.J. Lu <hongjiu.lu@intel.com>* version.cc (print_version): Change to "Copyright 2010".2010-01-08 Ian Lance Taylor <iant@google.com>PR 10287PR 11063* i386.cc (class Target_i386): Change return type of plt_sectionto be non-const.(class Output_data_plt_i386): Add tls_desc_rel_ field.(Output_data_plt_i386::Output_data_plt_i386): Initializetls_desc_rel_ field.(Output_data_plt_i386::rel_tls_desc): New function.(Target_i386::rel_tls_desc_section): New function.(Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.(Target_i386::Scan::global): For R_386_TLS_GOTDESC putR_386_TLS_DESC reloc in rel_tls_desc_section.* x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.Define struct Tlsdesc_info.(Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.(Target_x86_64::do_reloc_symbol_index): New function.(Target_x86_64::add_tlsdesc_info): New function.(class Output_data_plt_x86_64): Add tlsdesc_rel_ field.(Output_data_plt_x86_64::Output_data_plt_x86_64): Initializetlsdesc_rel_ field.(Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Changeall callers.(Output_data_plt_x86_64::rela_tlsdesc): New function.(Target_x86_64::rela_tlsdesc_section): New function.(Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESChandling.(Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put(Target_x86_64::do_reloc_addend): New function.R_X86_64_TLSDESC reloc in rela_tlsdesc_section.* output.h (class Output_reloc) [SHT_REL]: Add new constructordeclarations. Define TARGET_CODE. Add arg field to u1_ union.(Output_reloc::type): New function.(Output_reloc::is_local_section_symbol): Check for TARGET_CODE.(Output_reloc::is_target_specific): New function.(Output_reloc::target_arg): New function.(class Output_reloc) [SHT_RELA]: Add four new constructors forabsolute relocs and target specific relocs.(class Output_data_reloc) [SHT_REL]: Add add_absolute andadd_target_specific.(class Output_data_reloc) [SHT_RELA]: Likewise.* output.cc (Output_reloc::Output_reloc): Add four new versionsfor absolute relocs and target specific relocs.(Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.(Output_reloc::get_symbol_index): Likewise.(Output_reloc::local_section_offset): Check that local_sym_index_is not TARGET_CODE or 0.(Output_reloc::symbol_value): Likewise.(Output_reloc::write) [SHT_RELA]: Call target for target specificreloc.* target.h (class Target): Add reloc_symbol_index and reloc_addendfunctions. Add do_reloc_symbol_index and do_reloc_addend virtualfunctions.* layout.cc (add_target_dynamic_tags): Use output section forDT_PLTRELSZ and DT_JMPREL.2010-01-07 Ian Lance Taylor <iant@google.com>PR 11061* output.h (class Output_reloc) [SHT_RELA]: Add is_relativefunction.(class Output_data_reloc_generic): Define.(class Output_data_reloc_base): Change base class toOutput_data_reloc_generic. Change add() method to callbump_relative_reloc_count for a relative reloc. Removesort_relocs_ field.* output.cc (Output_data_reloc_base::do_write): Change sort_reloc_to sort_relocs().* layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel toOutput_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag ifappropriate.* layout.h (class Layout): Update declaration.2010-01-07 Ian Lance Taylor <iant@google.com>* output.h (class Output_data): Add const version ofoutput_section and do_output_section.(class Output_section_data): Add const version ofdo_output_section.(class Output_section): Likewise.* layout.cc (Layout::add_target_dynamic_tags): New function.* layout.h (class Layout): Update declarations.* arm.cc (Target_arm::do_finalize_sections): Useadd_target_dynamic_tags.* i386.cc (Target_i386::do_finalize_sections): Likewise.* powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.* sparc.cc (Target_sparc::do_finalize_sections): Likewise.* x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.2010-01-07 Ian Lance Taylor <iant@google.com>PR 11042* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamicobject as needed.2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>Ian Lance Taylor <iant@google.com>PR 11019* object.cc: Instantiate Xindex::initialize_symtab_xindex andXindex::read_symtab_xindex.2010-01-07 Doug Kwan <dougkwan@google.com>* arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.(Insn_template::thumb16_bcond_insn): New method declaration.(Insn_template): Fix spelling.(Stub::thumb16_special): New method declaration.(Stub::do_write): Define virtual method which was previously purevirtual.(Stub::do_thumb16_special): New method declaration.(Stub::do_fixed_endian_write): New template member.(Reloc_stub::do_write): Remove.(Reloc_stub::do_fixed_endian_write): Remove.(Cortex_a8_stub): New class definition.(Stub_factory::make_cortex_a8_stub): New method definition.(Stub_factory::Stub_factory): Add missing static storage classqualifier for elf32_arm_stub_a8_veneer_blx.2010-01-07 Ian Lance Taylor <iant@google.com>PR 10980* options.h (class General_options): Add --warn-unresolved-symbolsand --error-unresolved-symbols.* errors.cc (Errors::undefined_symbol): Implement--warn-unresolved-symbols.* options.h (class General_options): Add -z text and -z textoff.* layout.cc (Layout::finish_dynamic_section): Implement -z text.2010-01-06 Sriraman Tallam <tmsriram@google.com>* gc.h (Garbage_collection::Cident_section_map): New typedef.(Garbage_collection::cident_sections): New function.(Garbage_collection::add_cident_section): New function.(Garbage_collection::cident_sections_): New member.(gc_process_relocs): Add references to sections whose names are Cidentifiers.* gold.h (cident_section_start_prefix): New constant.(cident_section_stop_prefix): New constant.(is_cident): New function.* layout.cc (Layout::define_section_symbols): Replace string constantswith the newly defined constants.* object.cc (Sized_relobj::do_layout): Track sections whose names areC identifiers.* testsuite/Makefile.am: Add gc_orphan_section_test.* testsuite/Makefile.in: Regenerate.* testsuite/gc_orphan_section_test.cc: New file.* testsuite/gc_orphan_section_test.sh: New file.2010-01-06 Ian Lance Taylor <iant@google.com>PR 10980* options.h (class General_options): Add --warn-shared-textrel.* layout.cc (Layout::finish_dynamic_section): Implement--warn-shared-textrel.PR 10980* options.h (class General_options): Add --warn-multiple-gp.2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>* Makefile.am (incremental_dump_DEPENDENCIES): Remove$(THREADSLIB) and $(LIBDL).* Makefile.in: Rebuild.2010-01-06 Ian Lance Taylor <iant@google.com>PR 10980* options.cc (General_options::parse_section_start): New function.(General_options::section_start): New function.(General_options::General_options): Initialize all members.* options.h: Include <map>(class General_options): Add --section-start. Add section_starts_member.* layout.cc (Layout::attach_allocated_section_to_segment): If--section-start was used, set the address of the segment. Removelocal sort_sections.(Layout::relaxation_loop_body): If the address of the load segmenthas been set by --section-start, don't use it.* output.h (Output_segment::update_flags_for_output_section): Newfunction.* output.cc (Output_segment::add_output_section): Callupdate_flags_for_output_section.2010-01-05 Ian Lance Taylor <iant@google.com>PR 10980* options.h (class General_options): Add --undefined-version.* script.cc (struct Version_expression): Add was_matched_by_symbolfield.(Version_script_info::matched_symbol): New function.(Version_script_info::get_symbol_version_helper): Callmatched_symbol.(Version_script_info::check_unmatched_names): New function.* script.h (class Version_script_info): Update declarations.* gold.cc (queue_middle_tasks): Handle --no-undefined-version.* options.h (class General_options): Use DEFINE_bool_alias forallow_multiple_definition.* resolve.cc (Symbol_table::should_override): Don't testallow_multiple_definition.PR 10980* options.h (class General_options): Add --cref.* main.cc (main): Print cref table if --cref. Don't close mapfileuntil after printing cref table.* cref.cc: Include "symtab.h".(class Cref_inputs): Define Cref_table_compare and Cref_table.(Cref_table_compare::operator()): New function.(Cref_inputs::gather_cref): New function.(filecol): New static const.(Cref_inputs::print_cref): New function.(Cref::print_cref): New function.* cref.h: Include <cstdio>.(class Cref): Update declarations.* mapfile.h (Mapfile::file): New function.* object.h (class Object): Define Symbols. Declare virtualdo_get_global_symbols.(Object::get_global_symbols): New function.* object.cc (Input_objects::add_object): Pass object to cref_ if--cref.(Input_objects::archive_start): Likewise.(Input_objects::archive_stop): Likewise.(Input_objects::print_cref): New function.* dynobj.h (Sized_dynobj::do_get_global_symbols): New function.* dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if--cref.* plugin.cc (Sized_pluginobj::do_get_global_symbols): Newfunction.* plugin.h (class Sized_pluginobj): Update declarations.2010-01-05 Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::add_from_object): Rename def parameterto is_default_version. Rename insdef to insdefault.(Symbol_table::add_from_relobj): Rename def to is_default_versionand local to is_forced_local.(Symbol_table::add_from_pluginobj): Likewise.(Symbol_table::add_from_dynobj): Likewise.(Symbol_table::define_special_symbol): Rename insdef toinsdefault.2010-01-04 Ian Lance Taylor <iant@google.com>PR 10980* options.h (class General_options): Add--allow-multiple-definition and -z muldefs.* resolve.cc (Symbol_table::should_override): Don't warn about amultiple symbol definition if --allow-multiple-definition or -zmuldefs.PR 10980* options.h (class General_options): Add --add-needed and--copy-dt-needed-entries. Tweak --as-needed help entry.* object.cc (Input_objects::check_dynamic_dependencies): Give anerror if --copy-dt-needed-entries aka --add-needed is used andwould cause a change in behaviour.PR 10980* options.h (class General_options): Add -G as a short version of--shared. Add no-op options -assert, -g, and -i.2010-01-04 Sriraman Tallam <tmsriram@google.com>* gc.h (gc_process_relocs): Call is_section_foldable_candidate tocheck for .text or .gnu.linkonce.t sections.* icf.cc (Icf::find_identical_sections): Ditto.Change the detection for mangled function name within the sectionname.* icf.h (is_section_foldable_candidate): New function.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10980* options.h (class General_options): Permit two dashes with--retain-symbols-file.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10979* layout.cc (Layout::relaxation_loop_body): If -Ttext was used,don't put the file header and segment headers in the textsegment.PR 10979* common.cc (Sort_commons::operator()): Stabilize sort when bothentries are NULL.(Symbol_table::do_allocate_commons_list): When allocating commonsymbols, skip a symbol which is no longer common.* symtab.h (Symbol::is_common): Test whether the symbol comes froman object before checking its type.* testsuite/common_test_2.c: New file.* testsuite/common_test_3.c: New file.* testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.(common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.(common_test_2_LDFLAGS, common_test_2_LDADD): Define.(common_test_2_pic.o, common_test_2.so): New targets.(common_test_3_pic.o, common_test_3.so): New targets.* testsuite/Makefile.in: Rebuild.PR 10979* script.cc (read_input_script): If we see a new SECTIONS clause,and we have added an input section, give an error.* layout.h (class Layout): Add have_added_input_section function.Add have_added_input_section_ field.* layout.cc (Layout::Layout): Initializehave_added_input_section_.(Layout::layout): Set have_added_input_section_.(Layout::layout_eh_frame): Likewise.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10931* options.h (class General_options): Add --sort-common option.* symtab.h (class Symbol_table): Define Sort_commons_order enum.* common.cc (Sort_common): Add sort_order parameter toconstructor. Add sort_order_ field.(Sort_commons::operator): Check sort_order_.(Symbol_table::allocate_commons): Determine the sort order.(Symbol_table::do_allocate_commons): Add sort_order parameter.Change all callers.(Symbol_table::do_allocate_commons_list): Likewise.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10916* symtab.cc (Symbol_table::add_from_relobj): When not exportingsymbols from this object, don't change the visibility of anundefined symbol.* testsuite/exclude_libs_test_1.c (lib1_ref): New function.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10861* script.h (class Version_script_info): Define Language enum.Update declarations. Define Glob, Exact, and Lookup types. Addnew fields globals_, locals_, and is_finalized_.* script.cc: Various formatting fixes.(class Parser_closure): Change language_stack_ from a vector ofstd::string to one of Version_script_info::Language. Adjust alluses accordingly.(class Lazy_demangler): Remove.(struct Version_expression): Change language from std::string toVersion_script_info::Language.(Version_script_info::Version_script_info): New function.(Version_script_info::~Version_script_info): Don't call clear.(Version_script_info::finalize): New function.(Version_script_info::build_lookup_tables): New function.(Version_script_info::build_expression_list_lookup): Newfunction.(Version_script_info::get_symbol_version_helper): Rewrite to uselookup tables.(Version_script_info::print_expression_list): Adjust to useVersion_script_info::Language.(script_push_lex_into_version_mode): Check that the version scripthas not been finalized.(version_script_push_lang): Change language string toVersion_script_info::Language.* options.cc (Command_line::version_script): New function.* options.h (class General_options): Add finalize_dynamic_listfunction. Change version_script from declaration to definition.* testsuite/ver_test_4.script: Remove duplicate def of t2_2.* testsuite/version_script.map: Remove duplicate def of foo.* testsuite/Makefile.am (ver_matching_def.so): Depend uponversion_script.map.* testsuite/Makefile.in: Rebuild.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10843* target-reloc.h (relocate_for_relocatable): When copying a reloc,if the input symbol index is 0, make the output symbol index 0.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10670* options.h (class General_options): Add -x/--discard-all.* object.cc (Sized_relobj::do_count_local_symbols): Handle--discard-all. If the local symbol needs a dynamic entry, checkthat before handling --discard-locals.2009-12-30 Ian Lance Taylor <iant@google.com>PR 10450* output.cc (Output_segment::Output_segment): If PT_TLS, set theflags to PF_R.(Output_segment::add_output_section): Don't change the flags ifthe type is PT_TLS.PR 10450* dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to theGNU hash table if they need a dynamic value. Otherwise, don't addthem if they are defined in a dynamic object or are forced local.2009-12-29 Ian Lance Taylor <iant@google.com>PR 10450* layout.cc (Layout::create_dynamic_symtab): Only set entsize of.gnu.hash table for a 32-bit target.PR 10450* symtab.h (Symbol::needs_dynsym_entry): A symbol in both aregular and a dynamic object only needs a dynamic symbol tableentry if it is externally visible.PR 10450* i386.cc (class Target_i386): Initialize global_offset_table_ inconstructor. Add global_offset_table_ field.(Target_i386::got_section): Set global_offset_table_.(Target_i386::do_finalize_sections): Set global_offset_table_size.* x86_64.cc (class Target_x86_64): Initialize global_offset_table_in constructor. Add global_offset_table_ field.(Target_x86_64::got_section): Set global_offset_table_.(Target_x86_64::do_finalize_sections): Set global_offset_table_size.* layout.cc (Layout::Layout): Initialize increase_relro_.(Layout::get_output_section): Add is_relro, is_last_relro, andis_first_non_relro parameters. Change all callers.(Layout::choose_output_section): Likewise.(Layout::add_output_section_data): Likewise.(Layout::make_output_section): Likewise.(Layout::set_segment_offsets): Clear increase_relro when using alinker script.* layout.h (class Layout): Add increase_relro method. Addincrease_relro_ field. Update declarations.* output.cc (Output_section::Output_section): Initializeis_last_relro_ and is_first_non_relro_.(Output_segment::add_output_section): Group relro sections isdo_sort is true. Handle is_last_relro and is_first_non_relro.(Output_segment::maximum_alignment): Remove relro handling.(Output_segment::set_section_addresses): Add increase_relroparameter. Change all callers. Add initial alignment to alignrelro sections on separate page. Remove old relro handling.(Output_segment::set_section_list_addresses): Remove in_relroparameter. Change all callers.(Output_segment::set_offset): Add increase parameter. Change allcallers. Remove old relro handling.* output.h (class Output_section): Add new methods: is_last_relro,set_is_last_relro, is_first_non_relro, set_is_first_non_relro.Add is_last_relro_ and is_first_non_relro_ fields.* i386.cc (Target_i386::got_section): Don't call set_is_relro.Create separate .got.plt section. Call increase_relro.* x86_64.cc (Target_x86_64::got_section): Likewise.* testsuite/relro_script_test.t: Add .got.plt.PR 10450* layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.(Layout::create_initial_dynamic_sections): Set dynamic_symbol_.(Layout::finalize): Call set_dynamic_symbol_size.(Layout::set_dynamic_symbol_size): New function.* layout.h (class Layout): Add dynamic_symbol_ field. Declareset_dynamic_symbol_size.PR 10450* output.h (class Output_section): Add is_entsize_zero_ field.* output.cc (Output_section::Output_section): Initializeis_entsize_zero_.(Output_section::set_entsize): If two different entsizes arerequested, force it to zero.(Output_section::add_input_section): Set flags for .debug_strbefore updating section flags. Set entsize.(Output_section::update_flags_for_input_section): Set SHF_MERGEand SHF_STRING if all input sections have those flags.2009-12-29 Rafael Espindola <espindola@google.com>* main.cc (main): Fix the sys time reporting.* workqueue.cc (Workqueue::find_and_run_task): Fix the sys timereporting.2009-12-29 Sriraman Tallam <tmsriram@google.com>* options.cc (General_options::parse_version): Allow -v to exitwithout an error if there is nothing to link.2009-12-29 Ian Lance Taylor <iant@google.com>* configure.ac: Set the MCMODEL_MEDIUM conditional to false ifusing a version of gcc before 4.1.* configure: Rebuild.2009-12-28 Chris Demetriou <cgd@google.com>* attributes.cc (Output_attributes_section_data::do_write): Usestd::vector::front rather than std::vector::data.2009-12-28 Ian Lance Taylor <iant@google.com>* symtab.h (class Symbol_table): Add enum Defined.* resolve.cc (Symbol_table::should_override): Add definedparameter. Change all callers. Test whether object is NULLbefore calling a method on it.(Symbol_table::report_resolve_problem): Add defined parameter.Change all callers.(Symbol_table::should_override_with_special): Likewise.* symtab.cc (Symbol_table::define_in_output_data): Add definedparameter. Change all callers.(Symbol_table::do_define_in_output_data): Likewise.(Symbol_table::define_in_output_segment): Likewise.(Symbol_table::do_define_in_output_segment): Likewise.(Symbol_table::define_as_constant): Likewise.(Symbol_table::do_define_as_constant): Likewise.* script.h (class Symbol_assignment): Add is_defsym parameter toconstructor; change all callers.* script.cc (Script_options::add_symbol_assignment): Add is_defsymparameter. Change all callers. Add is_defsym_ field.(class Parser_closure): Add parsing_defsym parameter toconstructor; change all callers. Add parsing_defsym accessorfunction. Add parsing_defsym_ field.2009-12-28 Ian Lance Taylor <iant@google.com>* gold.cc (queue_middle_tasks): Fix formatting.* object.cc (Relobj::is_section_name_included): Likewise.2009-12-23 Ian Lance Taylor <iant@google.com>* i386.cc (Target_i386::do_calls_non_split): Recognize-fsplit-stack prologue for a function with a static chain.* x86_64.cc (Target_x86_64::do_calls_non_split): Recognize-fsplit-stack prologue when using %r11.2009-12-21 Sriraman Tallam <tmsriram@google.com>* options.cc (General_options::parse_version): Make -v continue and dothe link like GNU ld does.2009-12-17 Rafael Avila de Espindola <espindola@google.com>* Makefile.am (CCFILES): Add timer.cc.(HFILES): Add timer.h.* configure.ac: Check for sysconf and times.* main.cc: include timer.h.(main): Use Timer instead of get_run_time.* timer.cc: New.* timer.h: New.* workqueue.cc: include timer.h.(Workqueue::find_and_run_task):Report user, sys and wall time.* Makefile.in: Regenerate.* config.in: Regenerate.* configure: Regenerate.2009-12-16 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminatedsections.* object.cc (Sized_relobj::do_finalize_local_symbols): Handlerelaxed input sections.* output.cc (Output_section::find_relaxed_input_section): Changereturn type to Output_relaxed_input_section pointer. Adjust codefor new type of relaxed_input_section_map_.* output.h (Output_section::find_relaxed_input_section): Changereturn type to Output_relaxed_input_section pointer.(Output_section::Output_relaxed_input_section_by_input_section_map):New type.(Output_section::relaxed_input_section_map_): Change type toOutput_section::Output_relaxed_input_section_by_input_section_map.* symtab.cc (Symbol_table::compute_final_value): Handle relaxedinput section.2009-12-15 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::create_shstrtab): Only write out after inputsections if we are compressing debug sections.2009-12-15 Ian Lance Taylor <iant@google.com>* archive.cc (Archive::add_symbols): Only look up a symbol withouta version if there is, in fact, a version.2009-12-14 Ian Lance Taylor <iant@google.com>Revert -Wshadow changes, all changes from:2009-12-11 Doug Kwan <dougkwan@google.com>2009-12-11 Nick Clifton <nickc@redhat.com>* configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.2009-12-11 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::do_finalize_sections): Fix build breakagedue to -Wshadow.* attributes.cc (Object_attribute::size): Ditto.(Attributes_section_data::size): Ditto.(Attributes_section_data::Attributes_section_data): Ditto.(Output_attributes_section_data::do_write): Ditto.* attributes.h (Object_attribute::set_type): Ditto.* testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.2009-12-11 Nick Clifton <nickc@redhat.com>* archive.cc: Fix shadowed variable warnings.* arm.cc: Likewise.* compressed_output.cc: Likewise.* compressed_output.h: Likewise.* configure: Likewise.* dwarf_reader.cc: Likewise.* dynobj.cc: Likewise.* dynobj.h: Likewise.* ehframe.cc: Likewise.* ehframe.h: Likewise.* errors.cc: Likewise.* expression.cc: Likewise.* fileread.cc: Likewise.* fileread.h: Likewise.* freebsd.h: Likewise.* i386.cc: Likewise.* icf.cc: Likewise.* incremental.h: Likewise.* layout.cc: Likewise.* layout.h: Likewise.* mapfile.cc: Likewise.* merge.cc: Likewise.* merge.h: Likewise.* object.cc: Likewise.* object.h: Likewise.* options.h: Likewise.* output.cc: Likewise.* output.h: Likewise.* parameters.cc: Likewise.* plugin.cc: Likewise.* powerpc.cc: Likewise.* reduced_debug_output.cc: Likewise.* reduced_debug_output.h: Likewise.* reloc.cc: Likewise.* reloc.h: Likewise.* resolve.cc: Likewise.* script-sections.cc: Likewise.* script.cc: Likewise.* script.h: Likewise.* sparc.cc: Likewise.* symtab.cc: Likewise.* symtab.h: Likewise.* target-select.cc: Likewise.* target-select.h: Likewise.* token.h: Likewise.* workqueue.cc: Likewise.* workqueue.h: Likewise.* x86_64.cc: Likewise.2009-12-10 Doug Kwan <dougkwan@google.com>* arm.cc (attributes.h): New include.(Arm_relobj::Arm_relobj): Initialize attributes_section_data_.(Arm_relobj::~Arm_relobj): Delete object pointed byattributes_section_data_.(Arm_relobj::attributes_section_data): New method definition.(Arm_relobj::attributes_section_data_): New data member declaration.(Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.(Arm_dynobj::~Arm_dynobj): Delete object pointed byattributes_section_data_.(Arm_dynobj::attributes_section_data): New method definition.(Arm_dynobj::attributes_section_data_): New data member declaration.(Target_arm::Target_arm): Initialize attributes_section_data_. Changeinitialization value of may_use_blx_ to false.(Target_arm::using_thumb2, Target_arm::using_thumb_only,Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Useobject attributes to compute results instead of hard-coding.(Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,Target_arm::get_secondary_compatible_arch,Target_arm::set_secondary_compatible_archTarget_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):New method declarations.(Target_arm::get_aeabi_object_attribute): New method definition.(Target_arm::attributes_section_data_): New data member declaration.(read_arm_attributes_section): New template definition.(Arm_relobj::do_read_symbols): Read attributes section if it exists.(Arm_dynobj::do_read_symbols): Ditto.(Target_arm::do_finalize_sections): Merge attributes sections frominput. Check for BLX use after attributes section merging.Fix __exidx_start and __exidx_end visibility. Create an.ARM.attributes section if necessary.(Target_arm::get_secondary_compatible_arch,Target_arm::set_secondary_compatible_arch,Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):New method definitions.2009-12-09 Ian Lance Taylor <iant@google.com>* plugin.cc (Plugin::load): Don't cast from void* to a functionpointer.2009-12-09 Ian Lance Taylor <iant@google.com>* dynobj.cc (Sized_dynobj::do_read_symbols): Clear versioninformation fields.2009-12-09 H.J. Lu <hongjiu.lu@intel.com>* testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):Replace two_file_shared_1.so with two_file_shared_2.so.* testsuite/Makefile.in: Regenerated.2009-12-08 Doug Kwan <dougkwan@google.com>* Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.(HFILES): Add attributes.h and int_encoding.h.* Makefile.in: Regenerate.* dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Movefunction definitions to int_encoding.cc* dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Moveprototypes to int_encoding.h* reduced_debug_output.cc (int_encoding.h): New include.(write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Movefunction definitions to int_encoding.cc(insert_into_vector, read_from_pointer): Move template definitions toint_encoding.h* attributes.cc: New file.* attributes.h: New file.* int_encoding.cc: New file.* int_encoding.h: New file.2009-12-07 Rafael Avila de Espindola <espindola@google.com>PR gold/11055* incremental-dump.cc (dump_incremental_inputs): New.(main): Use dump_incremental_inputs.2009-12-07 H.J. Lu <hongjiu.lu@intel.com>PR gold/10893* i386.cc (Target_i386::Scan::globa): Use is_func instead ofchecking elfcpp::STT_FUNC.(Target_i386::Relocate::relocate): Likewise.* x86_64.cc (Target_x86_64::Scan::global): Likewise.* symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNCsymbols from shared libraries into normal FUNC symbols.* symtab.h (Symbol): Add is_func and use it.2009-12-05 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::arm_info): Initialize new fieldsattributes_section and attributes_vendor.* i386.cc (Target_i386::i386_info): Same.* object.cc (Sized_relobj::do_layout): Skip attribute section.* gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize newfields attributes_section and attributes_vendor.* sparc.cc (Target_sparc::sparc_info): Same.* target.h (Target::attributes_section, Target::attributes_vendor,Target::is_attributes_section, Target::attribute_arg_type,Target::attributes_order): New method definitions.(Target::Target_info::attributes_section,Target::Target_info::attributes_vendor): New fields.(Target::do_attribute_arg_type, Target::do_attributes_order): Newvirtual method definitions.* x86_64.cc (Target_x86_64::x86_64_info): Initialize new fieldsattributes_section and attributes_vendor.* testsuite/testfile.cc (Target_test::test_target_info): Same.2009-12-05 Doug Kwan <dougkwan@google.com>* arm.cc: Update comments about interworking and stub generation.(Target_arm::Relocate::reloc_is_non_pic): Update list of relocationsconsidered as non-PIC.(Arm_relocate_functions::base_abs): Fix formatting.(Arm_relocate_functions::got_prel): Fix comment. Change interfaceof function to use GOT entry address instead of offset.(Target_arm::Scan::global): Issue an error if a symbol would need aPLT does not get one because it is untyped. Remove code to createdynamic symbols for relative branches.(Target_arm::Relocate::relocate: Use 0 instead of false since functiontakes unsigned integer instead of boolean.2009-12-05 H.J. Lu <hongjiu.lu@intel.com>* testsuite/Makefile.am (constructor_test_LDADD): New. Empty.(two_file_test_LDADD): Likewise.(common_test_1_LDADD): Likewise.(exception_test_LDADD) Likewise.(weak_test_LDADD): Likewise.(many_sections_test_LDADD): Likewise.(initpri1_LDADD): Likewise.(script_test_1_LDADD): Likewise.(script_test_2_LDADD): Likewise.(justsyms_LDADD): Likewise.(binary_test_LDADD): Likewise.(large_LDADD): Likewise.* testsuite/Makefile.in: Regenerated.2009-12-04 H.J. Lu <hongjiu.lu@intel.com>* resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.(Symbol_table::override_with_special): Likewise.(Symbol_table::add_from_object): Likewise.2009-12-04 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (Incremental_inputs::sized_create_inputs_section_data):Don't set the data_offset twice.2009-12-04 Rafael Avila de Espindola <espindola@google.com>* testsuite/Makefile.in: Regenerate.2009-12-03 Doug Kwan <dougkwan@google.com>* arm.cc: Remove comment about missing .ARM.exidx section symbols.(Target_arm::do_finalize_sections): Add parameter for symbol tablepointer. Add __exidx_start and __exidx_end symbols as appropriate.* i386.cc (Target_i386::do_finalize_sections): Add an additionalparameter for symbol table pointer.* layout.cc (Layout::finalize): Call Target::finalize_sections withan additional parameter for a pointer to symbol table.* powerpc.cc (Target_powerpc::do_finalize_sections): Add an additionalparameter for a symbol table pointer.* sparc.cc (Target_sparc::do_finalize_sections): Ditto.* target.h (Target::finalize_sections, Target::do_finalize_sections):Ditto.* x86_64.cc (Target_x86_64::do_finalize_sections): Add an additionalparameter for a symbol table pointer.2009-12-03 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (Incremental_inputs_header)(Incremental_inputs_header_write, Incremental_inputs_entry)(Incremental_inputs_entry_write): Move ...* incremental.h (Incremental_inputs_header)(Incremental_inputs_header_write, Incremental_inputs_entry)(Incremental_inputs_entry_write): here.2009-12-02 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (make_sized_incremental_binary): Set the target.Error if it is incompatible.* output.h (Output_file): Add filename method.2009-12-02 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (Incremental_inputs_entry): Remove unused argumentfrom the get_* methods.2009-12-02 Rafael Avila de Espindola <espindola@google.com>* incremental-dump.cc (main): Check that the offeset of a script is 0.* incremental.cc (Incremental_inputs::sized_create_inputs_section_data):Write 0 for the data_offset of scripts.2009-12-02 Rafael Avila de Espindola <espindola@google.com>* testsuite/Makefile.am: Add the incremental_test.sh test.* testsuite/incremental_test.sh: New.* testsuite/incremental_test_1.c: New.* testsuite/incremental_test_2.c: New.2009-12-01 Rafael Avila de Espindola <espindola@google.com>* incremental-dump.cc (main): Fix typos.2009-11-27 Rafael Avila de Espindola <espindola@google.com>PR gold/11025* incremental-dump.cc (main): Use llu to print 64 bit values.2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>H.J. Lu <hongjiu.lu@intel.com>* Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)$(LIBDL).(incremental_dump_LDADD): Likewise.* Makefile.in: Regenerated.2009-11-25 Doug Kwan <dougkwan@google.com>Revert:2009-11-25 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Target_arm): Move method definitionoutside of class definition. Add code to handle--target1-rel, --target1-abs and --target2= options.(Target_arm::get_reloc_reloc_type): Change method to benon-static and const.(Target_arm::target1_is_rel_, Target_arm::target2_reloc_):New data member declaration.(Target_arm::Scan::local, Target_arm::Scan::global,Target_arm::Relocate::relocate,Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Adjust call to Target_arm::get_real_reloc_type.(Target_arm::get_real_reloc_type): Use command line optionsto determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.* options.h (--target1-rel, --target1-abs, --target2): NewARM-only options.2009-11-25 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Target_arm): Move method definition outside ofclass definition. Add code to handle --target1-rel, --target1-absand --target2= options.(Target_arm::get_reloc_reloc_type): Change method to be non-staticand const.(Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New datamember declaration.(Target_arm::Scan::local, Target_arm::Scan::global,Target_arm::Relocate::relocate,Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjustcall to Target_arm::get_real_reloc_type.(Target_arm::get_real_reloc_type): Use command line options todetermine real types of R_ARM_TARGET1 and R_ARM_TARGET2.* options.h (--target1-rel, --target1-abs, --target2): New ARM-onlyoptions.2009-11-25 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::may_use_thumb2_nop): New method definition.(Arm_relocate_functions::thumb_branch_common): New metod declaration.(Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fixformatting.(Arm_relocate_functions::thm_call): Replace body with a call toArm_relocate_functions::thumb_branch_common.(Arm_relocate_functions::thm_jump24,Arm_relocate_functions::thm_xpc22): New method definitions.(Arm_relocate_functions::thumb_branch_common): New method definition.(Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-oroperator.(Target_arm::Relocate::relocate): Adjust call to thm_call.Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.2009-11-24 Rafael Avila de Espindola <espindola@google.com>* Makefile.am: Build incremental-dump* Makefile.in: Regenerate.* incremental-dump.cc: New.* incremental.cc (Incremental_inputs_header_data,Incremental_inputs_entry_data): Move to incremental.h* incremental.h: (Incremental_inputs_header_data,Incremental_inputs_entry_data): Move from incremental.cc2009-11-24 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (Incremental_inputs_header,Incremental_inputs_header_write, Incremental_inputs_entry,Incremental_inputs_entry_write): Add a typedef with the data type.2009-11-24 Rafael Avila de Espindola <espindola@google.com>* incremental.cc (Incremental_inputs_header,Incremental_inputs_header_write, Incremental_inputs_entry,Incremental_inputs_entry_write): Update comment about whichtype has the filed descriptions.2009-11-15 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::may_use_arm_nop): New method definition.(Arm_relocate_functions::arm_branch_common): Change method defintionin class definition to a method declaration and update list of formalparameters.(Arm_relocate_functions::plt32, Arm_relocate_functions::call,Arm_relocation_functions::jump24): Adjust call toArm_relocate_functions::arm_branch_common. Update list of formalparameters.(Arm_relocate_functions::xpc25): New method definition.(Arm_relocate_functions::arm_branch_common): Move method defintionout from class definition. Use stubs for mode-switching and extendingbranch ranges.(Target_arm::Relocate::relocate): Handle weakly-undefined symbolsspecially. Change code to enable use of stubs in ARM branches.2009-11-10 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::do_relocate_sections): Remove options parameterin method declaration.(Target_arm::relocate_stub): New method declaration.(Target_arm::default_target): Change to return a pointer instead ofa const reference.(Reloc_stub::stub_type_for_reloc): Adjust for the change inTarget_arm::default_target.(Arm_Relobj::do_relocate_sections): Remove options paramater inmethod definition.(Target_arm::relocate_section): Adjust view.(Target_arm::relocate_stub): New method definition.2009-11-10 Doug Kwan <dougkwan@google.com>* i386.cc (Target_i386::do_calls_non_split): Add a cast to avoida format warning.* incremental.cc (open_incremental_binary): Initialized localvariables to avoid warnings.* object.cc (make_elf_object): Ditto.* x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoida format warning.009-11-09 H.J. Lu <hongjiu.lu@intel.com>PR gold/10930* testsuite/plugin_test.c: Include "config.h".2009-11-09 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::fake_relnum_for_stubs): New constant.(arm_symbol_value): Remove.(Arm_relocate_functions::arm_branch_common,Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,Arm_relocate_functions::call, Arm_relocate_functions::jump24,Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,Arm_relocate_functions::thm_mobw_abs_nc,Arm_relocate_functions::thm_mov_abs,Arm_relocate_functions::movw_prel_nc,Arm_relocate_functions::thm_movt_abs,Arm_relocate_functions::movt_prel,Arm_relocate_functions::thm_movw_prel_nc,Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.(Target_arm::Relocate::relocate): Only decompose address into twoparts if relocation type uses the thumb-bit and pass the actualbit instead of a flag indicating that the thumb-bit is used. Adjustcalls to methods in Arm_relocate_functions for this change.2009-11-08 Ian Lance Taylor <iant@google.com>PR 10925* reloc.cc: InstantiateSized_relobj::initialize_input_to_output_maps andSized_relobj:free_input_to_output_maps.2009-11-06 Ian Lance Taylor <iant@google.com>PR 10876* defstd.cc (in_segment): Set only_if_ref true for "end".2009-11-06 Doug Kwan <dougkwan@google.com>* arm.cc (class Reloc_stub): Correct a comment.(Target_arm::Target_arm): Initialize arm_input_section_map_.(Target_arm::scan_section_for_stubs): New method declaration.(Target_arm::do_make_elf_object, Target_arm::do_make_output_section):Change methods from private to protected.(Target_arm::do_may_relax): New method definition.(Target_arm::do_relax, Target_arm::group_sections,Target_arm::scan_reloc_for_stub,Target_arm::scan_reloc_section_for_stubs): New method declarations.(Target_arm::arm_input_section_map_): New data member declaration.(Target_arm::scan_reloc_for_stub,Target_arm::scan_reloc_section_for_stubs,Target_arm::scan_section_for_stubs, Target_arm::group_sections,Target_arm::do_relax): New method definitions.2009-11-06 Mikolaj Zalewski <mikolaj@google.com>* configure.ac: Check for (struct stat)::st_mtim* fileread.cc (File_read::get_mtime): Use st_mtim if available.* config.in: Regenerate.* configure: Regenerate.2009-11-05 Ian Lance Taylor <iant@google.com>PR 10910* output.cc (Output_segment::add_output_section): Add missingreturn statement.2009-11-04 Ian Lance Taylor <iant@google.com>PR 10880* object.h (class Object): Add is_needed and set_is_neededmethods. Add is_needed_ field. Make bool fields into bitfields.* symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol isdefined in a dynamic object and referenced by a regular object,set is_needed for the dynamic object.* layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDEDif the file is marked with as_needed and it is not needed.2009-11-04 Ian Lance Taylor <iant@google.com>PR 10887* arm.cc (Target_arm::do_finalize_sections): Don't add dynamictags if data is discarded by linker script.* i386.cc (Target_i386::do_finalize_sections): Likewise.* powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.* sparc.cc (Target_sparc::do_finalize_sections): Likewise.* x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.2009-11-04 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::get_output_section): Add is_interp andis_dynamic_linker_section parameters. Change all callers.(Layout::choose_output_section): Likewise.(Layout::make_output_section): Likewise.(Layout::add_output_section_data): Add is_dynamic_linker_sectionparameter. Change all callers.* layout.h (class Layout): Update declarations.* output.h (class Output_section): Add is_interp, set_is_interp,is_dynamic_linker_section, set_is_dynamic_linker_section methods.Add is_interp_, is_dynamic_linker_section_ fields. Changegenerate_code_fills_at_write_ to a bitfield.* output.cc (Output_section::Output_sections): Initialize newfields.(Output_segment::add_output_section): Add do_sort parameter.Change all callers.2009-11-03 Ian Lance Taylor <iant@google.com>PR 10860* options.h (class General_options): Add --warn-common.* resolve.cc (Symbol_table::resolve): Handle --warn-common whenmerging two common symbols.(Symbol_table::should_override): Handle --warn-common when merginga common symbol with a defined symbol. Use report_resolve_problemfor multiple definitions.(Symbol_table::report_resolve_problem): New function.* symtab.h (class Symbol_table): Declare report_resolve_problem.2009-11-03 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::Target_arm): Initialize stub_tables_ andstub_factory_.(Target_arm::stub_factory): New method definition.(Target_arm::new_arm_input_section,Target_arm::find_arm_input_section, Target_arm::new_stub_table,Target_arm::reloc_uses_thumb_bit): New method declarations.(Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):New type definitions.(Target_arm::stub_tables_, Target_arm::stub_factory_): New datamember declarations.(Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,Target_arm::find_arm_input_section, Target_arm::new_stub_table):New method definitions.2009-11-03 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add --warn_constructors.2009-11-03 Ian Lance Taylor <iant@google.com>PR 10893* defstd.cc (in_section): Add entries for __rel_iplt_start,__rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.2009-11-03 Ian Lance Taylor <iant@google.com>PR 10895* po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and--msgid-bugs-address.(install-pdf): New target.(install-data_yes): Look up one directory to find mkinstalldirs.2009-11-03 H.J. Lu <hongjiu.lu@intel.com>* po/Make-in (.po.gmo): Don't generate .gmo files in sourcetree.2009-10-30 Doug Kwan <dougkwan@google.com>* arm.cc (Stub_addend_reader): Fix bug in previouls check-in.2009-10-30 Doug Kwan <dougkwan@google.com>* arm.cc (Stub_addend_reader): New struct template definitionand partial specializations.(Stub_addend_reader::operator()): New method definition for apartially specialized template.2009-10-30 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj::processor_specific_flags): New methoddefinition.(Arm_relobj::do_read_symbols): New method declaration.(Arm_relobj::processor_specific_flags_): New data member declaration.(Arm_dynobj): New class definition.(Target_arm::do_finalize_sections): Add input_objects parameter.(Target_arm::do_adjust_elf_header): New method declaration.(Target_arm::are_eabi_versions_compatible,(Target_arm::merge_processor_specific_flags): New method declaration.(Target_arm::do_make_elf_object): New overloaded method definitionsand declaration.(Arm_relobj::do_read_symbols): New method definition.(Arm_dynobj::do_read_symbols): Ditto.(Target_arm::do_finalize_sections): Add input_objects parameters.Merge processor-specific flags from all input objects.(Target_arm::are_eabi_versions_compatible,Target_arm::merge_processor_specific_flags,Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):New method definitions.* i386.cc (Target_i386::do_finalize_sections): Add unnamedInput_objects pointer type parameter.* layout.cc (Layout::finalize): Pass input objects to target's.finalize_sections function.* output.cc (Output_file_header::do_sized_write): Set ELF fileheader's processor-specific flags.* powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamedInput_objects pointer type parameter.* sparc.cc (Target_sparc::do_finalize_sections): Same.* target.h (Input_objects): New forward class declaration.(Target::processor_specific_flags,Target::are_processor_specific_flags_sect): New method definitions.(Target::finalize_sections): Add input_objects parameter.(Target::Target): Initialize processor_specific_flags_ andare_processor_specific_flags_set_.(Target::do_finalize_sections): Add unnamed Input_objects pointer typeparameter.(Target::set_processor_specific_flags): New method definition.(Target::processor_specific_flags_,Target::are_processor_specific_flags_set_): New data memberdeclarations.* x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamedInput_objects pointer type parameter.2009-10-30 Doug Kwan <dougkwan@google.com>* arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.2009-10-28 Ian Lance Taylor <iant@google.com>* object.h (class Relobj): Drop options parameter fromgc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,do_scan_relocs, do_relocate. Change all callers.(class Sized_relobj): Drop options parameters fromdo_gc_process_relocs, do_scan_relocs, do_relocate,do_relocate_sections, relocate_sections, emit_relocs_scan,emit_relocs_scan_reltype. Change all callers.(struct Relocate_info): Remove options field and all references toit.* reloc.h (class Read_relocs): Remove options constructorparameter and options_ field. Change all callers.(class Gc_process_relocs, class Scan_relocs): Likewise.(class Relocate_task): Likewise.* target-reloc.h (scan_relocs): Remove options parameter. Changeall callers.(scan_relocatable_relocs): Likewise.* target.h (class Sized_target): Remove options parameter fromgc_process_relocs, scan_relocs, scan_relocatable_relocs. Changeall callers.* gc.h (gc_process_relocs): Remove options parameter. Change allcallers.* arm.cc: Update functions to remove options parameters.* i386.cc: Likewise.* powerpc.cc: Likewise.* sparc.cc: Likewise.* x86_64.cc: Likewise.* testsuite/testfile.cc: Likewise.2009-10-28 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_relobj): New class definition.(Arm_relobj::scan_sections_for_stubs,Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):New method definitions.2009-10-28 Cary Coutant <ccoutant@google.com>* plugin.h (Plugin::Plugin): Initialize cleanup_done_.(Plugin::cleanup_done_): New member.(Plugin_manager::Plugin_manager): Remove cleanup_done_.(Plugin_manager::cleanup_done_): Remove.(Plugin_manager::add_input_file): Edit error message.* plugin.cc (Plugin::cleanup): Test and set cleanup_done_.(Plugin_manager::cleanup): Remove use of cleanup_done_.2009-10-27 Mikolaj Zalewski <mikolajz@google.com>* fileread.cc: (File_read::View::~View): Use the newdata_ownership_ filed.(File_read::~File_read): Dispose the new whole_file_view_.(File_read::open): Mmap the whole file if needed.(File_read::open): Use whole_file_view_ instead of contents_.(File_read::find_view): Use whole_file_view_ if applicable.(File_read::do_read): Use whole_file_view_ instead of contents_.(File_read::make_view): Use whole_file_view_ instead of contents_,update File_read::View::View call.(File_read::find_or_make_view): Update File_read::View::Viewcall.* fileread.h: (File_read::File_read): Initialize whole_file_view_,remove contents_(File_read::View::Data_ownership): New enum.(File_read::View::View): Replace bool mapped_ with Data_ownershipargument.(File_read::View::mapped_): Remove (replaced by data_ownership_).(File_read::View::data_ownership_): New field.(File_read::contents_): Remove (replaced by whole_file_view_).(File_read::whole_file_view_): New field.* options.h (class General_options): Add --keep-files-mapped.2009-10-27 Cary Coutant <ccoutant@google.com>* symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.* testsuite/Makefile.am (plugin_test_5): New test case.* testsuite/Makefile.in: Regenerate.2009-10-25 Doug Kwan <dougkwan@google.com>* object.h (Sized_relobj::View_size, Sized_relobj::Views): Changefrom private to protected to allow access by child class.(Sized_relobj::do_relocate_sections): New method declaration.(Sized_relobj::relocate_sections): Virtualize.* reloc.cc (Sized_relobj::do_relocate_sections): Rename fromSized_relobj::relocate_sections. Instantiate template explicitlyfor different target sizes and endianity.2009-10-24 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.(Arm_input_section::as_arm_input_section): New method.(Arm_output_section): New class definition.(Arm_output_section::create_stub_group,Arm_output_section::group_sections): New method definitions.2009-10-22 Doug Kwan <dougkwan@google.com>* arm.cc (Arm_input_section): New class definition.(Arm_input_section::init, Arm_input_section:do_write,Arm_input_section::set_final_data_size,Arm_input_section::do_reset_address_and_file_offset): New methoddefinitions.2009-10-21 Doug Kwan <dougkwan@google.com>* arm.cc (Stub_table, Arm_input_section): New forward classdeclarations.(Stub_table): New class defintion.(Stub_table::add_reloc_stub, Stub_table::relocate_stubsStub_table::do_reset_address_and_file_offset, Stub_table::do_write):New method definition.2009-10-21 Doug Kwan <dougkwan@google.com>* arm.cc: Update copyright comments.(Target_arm): New forward class template declaration.(Arm_address): New type.(ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): Newconstants.(Insn_template): Same.(DEF_STUBS): New macro.(Stub_type): New enum type.(Stub_template): New class definition.(Stub): Same.(Reloc_stub): Same.(Stub_factory): Same.(Target_arm::Target_arm): Initialize may_use_blx_ andshould_force_pic_veneer_.(Target_arm::may_use_blx, Target_arm::set_may_use_blx,Target_arm::should_force_pic_veneer,Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,Target_arm::using_thumb_only, Target_arm:;default_target): Newmethod defintions.(Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):New data member declarations.(Insn_template::size, Insn_template::alignment): New method defintions.(Stub_template::Stub_template): New method definition.(Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.(Stub_factory::Stub_factory): New method definition.* gold.h (string_hash): New template.* output.h (Input_section_specifier::hash_value): Usegold::string_hash.(Input_section_specifier::string_hash): Remove.* stringpool.cc (Stringpool_template::string_hash): Usegold::string_hash.2009-10-20 Doug Kwan <dougkwan@google.com>* object.cc (Sized_relobj::do_finalize_local_symbols): Handle sectionsymbols of relaxed input sections.* output.h (Output_section::find_relaxed_input_section): Makemethod public.2009-10-16 Doug Kwan <dougkwan@google.com>* dynobj.cc (Versions::Versions): Initialize version_script_.Only insert base version symbol definition for a shared objectif version script defines any version versions.(Versions::define_base_version): New method definition.(Versions::add_def): Check that base version is not needed.(Versions::add_need): Define base version lazily.* dynobj.h (Versions::define_base_version): New method declaration.(Versions::needs_base_version_): New data member declaration.* testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh(check_DATA): Add no_version_test.stdout.(libno_version_test.so, no_version_test.o no_version_test.stdout):New make rules.* testsuite/Makefile.in: Regenerate.* testsuite/no_version_test.c: New file.* testsuite/no_version_test.sh: Ditto.2009-10-16 Doug Kwan <dougkwan@google.com>* expression.cc (class Segment_start_expression): New class definition.(Segment_start_expression::value): New method definition.(script_exp_function_segment_start): Return a newSegment_start_expression.* gold/script-c.h (script_saw_segment_start_expression): New functionprototype.* script-sections.cc (Script_sections::Script_sections): InitializeSAW_SEGMENT_START_EXPRESSION_ to false.(Script_sections::set_section_addresses): Use -Ttext, -Tdataand -Tbbs options to specify section addresses if given incommand line and no SEGMENT_START expression is seen in a script.* script-sections.h (Script_sections::saw_segment_start_expression,Script_sections::set_saw_segment_start_expression): New methoddefinition.(Script_sections::saw_segment_start_expression_): New data memberdeclaration.* script.cc (script_saw_segment_start_expression): New function.* yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.* testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,script_test_7.sh and script_test_8.sh.(check_DATA): Add script_test_6.stdout, script_test_7.stdout andscript_test_8.stdout.(MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.(script_test_6, script_test_6.stdout, script_test_7,script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.* Makefile.in: Regenerate.* testsuite/script_test_6.sh: New file.* testsuite/script_test_6.t: Same.* testsuite/script_test_7.sh: Same.* testsuite/script_test_7.t: Same.* testsuite/script_test_8.sh: Same.2009-10-16 Doug Kwan <dougkwan@google.com>* output.cc (Output_segment::set_section_list_address): Castexpressions to unsigned long long type to avoid format warnings.2009-10-15 Ian Lance Taylor <iant@google.com>* script.cc (Script_options::add_symbol_assignment): Always add adot assignment to script_sections_.* script-sections.cc (Script_sections::add_dot_assignment):Initialize if necessary.* layout.cc (Layout::relaxation_loop_body): Don't crash if we seeprogram headers with no load segment if there is a linker script.* layout.cc (Layout::set_segment_offsets): Align the file offsetto the segment aligment for -N or -n with no load segment.* output.cc (Output_segment::add_output_section): Don't crash ifthe first section is a TLS section.(Output_segment::set_section_list_addresses): Print an errormessage if the address moves backward in a linker script.* script-sections.cc(Output_section_element_input::set_section_addresses): Don'tincrease *dot_value for a SHF_TLS/SHT_NOBITS section.(Orphan_output_section::set_section_addresses): Likewise.2009-10-15 Doug Kwan <dougkwan@google.com>* layout.cc (Layout::finish_dynamic_section): Generate tagsDT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic isused, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.2009-10-14 Ian Lance Taylor <iant@google.com>* object.h (class Relocate_info): Add reloc_shdr and data_shdrfields.* object.cc (Sized_relobj::relocate_sections): Set reloc_shdr anddata_shdr fields of relinfo.* i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.(Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. ForR_386_TLS_LDO_32, adjust based on section flags.(Target_i386::Relocate::fix_up_ldo): Remove.2009-10-13 Ian Lance Taylor <iant@google.com>Add support for -pie.* options.h (class General_options): Add -pie and--pic-executable.(General_options::output_is_position_independent): Test -pie.(General_options::output_is_executable): Return true if not sharedand not relocatable.(General_options::output_is_pie): Remove.* options.cc (General_options::finalize): Reject incompatible usesof -pie.* gold.cc (queue_middle_tasks): A -pie link is not static.* symtab.h (Symbol::needs_plt_entry): Return false if -pie.* symtab.cc (Symbol::final_value_is_known): Return false ifoutput_is_position_independent.* layout.cc (Layout::set_segment_offsets): Start at address 0 ifoutput_is_position_independent.* output.cc (Output_file_header::do_sized_write): Use ET_DYN ifoutput_is_position_independent.* i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT ifoutput_is_position_independent.* testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test andtwo_file_pie_test.(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_2_pie.o, two_file_test_main_pie.o): New targets.(two_file_pie_test): New target.* testsuite/Makefile.in: Rebuild.* README: Remove note saying that -pie is not supported.2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>* options.h (class General_options): Add -init and -fini.* layout.cc (Layout::finish_dynamic_section): Emitgiven init and fini functions.2009-10-13 Sriraman Tallam <tmsriram@google.com>* gc.h (gc_process_relocs): Check if icf is enabled using newfunction.* gold.cc (queue_initial_tasks): Likewise.(queue_middle_tasks): Likewise.* object.cc (do_layout): Likewise.* symtab.cc (is_section_folded): Likewise.* main.cc (main): Likewise.* reloc.cc (Read_relocs::run): Likewise.(Sized_relobj::do_scan_relocs): Likewise.* icf.cc (is_function_ctor_or_dtor): New function.(Icf::find_identical_sections): Check if function is ctor or dtor whensafe icf is chosen.* options.h (General_options::icf): Change option to be an enum.(Icf_status): New enum.(icf_enabled): New method.(icf_safe_folding): New method.(set_icf_status): New method.(icf_status_): New variable.* (options.cc) (General_options::finalize): Set icf_status_.* testsuite/Makefile.am: Add commands to build icf_safe_test. Modifyicf_test and icf_keep_unique_test to use the --icf enum flag.* testsuite/icf_safe_test.sh: New file.* testsuite/icf_safe_test.cc: New file.2009-10-12 Sriraman Tallam <tmsriram@google.com>* symtab.h: Check for GOLD_SYMTAB_H before header includes. Removeincludes to gc.h and icf.h.* arm.cc: Include gc.h.* gold.cc: Likewise.* i386.cc: Likewise.* powerpc.cc: Likewise.* sparc.cc: Likewise.* x86_64.cc: Likewise.* gc.h: Include icf.h.2009-10-11 Ian Lance Taylor <iant@google.com>* plugin.cc: Include "gold.h" before other header files.2009-10-10 Chris Demetriou <cgd@google.com>* options.h (Input_file_argument::Input_file_type): New enum.(Input_file_argument::is_lib_): Replace with...(Input_file_argument::type_): New member.(Input_file_argument::Input_file_argument): Take Input_file_type'type' rather than boolean 'is_lib' as second argument.(Input_file_argument::is_lib): Use type_.(Input_file_argument::is_searched_file): New function.(Input_file_argument::may_need_search): Handle is_searched_file.* options.cc (General_options::parse_library): Support -l:filename.(General_options::parse_just_symbols): Update for Input_file_argumentchanges.(Command_line::process): Likewise.* archive.cc (Archive::get_file_and_offset): Likewise.* plugin.cc (Plugin_manager::release_input_file): Likewise.* script.cc (read_script_file, script_add_file): Likewise.* fileread.cc (Input_file::Input_file): Likewise.(Input_file::will_search_for): Handle is_searched_file.(Input_file::open): Likewise.* readsyms.cc (Read_symbols::get_name): Likewise.* testsuite/Makefile.am (searched_file_test): New test.* testsuite/Makefile.in: Regenerate.* testsuite/searched_file_test.cc: New file.* testsuite/searched_file_test_lib.cc: New file.2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>Ian Lance Taylor <iant@google.com>* descriptor.cc: Include <cstdio> and "binary-io.h".(Descriptors::open): Open the files in binary mode always.* script.cc (Lex::get_token): Treat \r as whitespace.2009-10-09 Ian Lance Taylor <iant@google.com>* testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>Ian Lance Taylor <iant@google.com>* configure.ac: Check for readv function also.* fileread.cc (readv): Define if not HAVE_READV.* fileread.h (File_read:: max_readv_entries): Set to 1 if readvdoes not exist.* config.in: Regenerate.* configure: Regenerate.2009-10-09 Doug Kwan <dougkwan@google.com>* layout.cc (Layout::make_output_section): Call target hook to makeordinary output section.(Layout::finalize): Adjust parameter list of call theTarget::may_relax().* layout.h (class Layout::section_list): New method.* merge.h (Output_merge_base::entsize): Change visibility to public.(Output_merge_base::is_string, Output_merge_base::do_is_string):New methods.(Output_merge_string::do_is_string): New method.* object.cc (Sized_relobj::do_setup): renamed fromSized_relobj::set_up.* object.h (Sized_relobj::adjust_shndx,Sized_relobj::initializ_input_to_output_maps,Sized_relobj::free_input_to_output_maps): Change visibilities toprotected.(Sized_relobj::setup): Virtualize.(Sized_relobj::do_setup): New method declaration.(Sized_relobj::invalidate_section_offset,Sized_relobj::do_invalidate_section_offset): New method decfinitions.(Sized_relobj::elf_file, Sized_relobj::local_values): New methods.* options.cc (parse_int): New function.* options.h (parse_int): New declaration.(DEFINE_int): New macro.(stub_group_size): New option.* output.cc (Output_section::Output_section): Initialize memebersmerge_section_map_, merge_section_by_properties_map_,relaxed_input_section_map_, is_relaxed_input_section_map_valid_.(Output_section::add_input_section): Handled deferred code-fillgeneration and remove an old comment.(Output_section::add_relaxed_input_section): New method definition.(Output_section::add_merge_input_section): Use merge section byproperties map to speed to search. Update merge section mapsas appropriate.(Output_section::build_relaxation_map): New method definition.(Output_section::convert_input_sections_in_list_to_relaxed_sections):Same.(Output_section::relax_input_section): Renamed toOutput_section::convert_input_sections_to_relaxed_sections and changeinterface to take a vector of pointers to relaxed sections.(Output_section::find_merge_section,Output_section::find_relaxed_input_section): New method definitions.(Output_section::is_input_address_mapped,Output_section::output_offset, Output_section::output_address):Use output section data maps to speed up searching.(Output_section::find_starting_output_address): Add comments.(Output_section::do_write,Output_section::write_to_postprocessing_buffer): Do code-fillgeneration as appropriate.(Output_section::get_input_sections): Invalidate relaxed input sectionmap.(Output_section::restore_states): Adjust type of checkpoint .Invalidate relaxed input section map.* output.h (Output_merge_base): New class declaration.(Input_section_specifier): New class defintion.(class Output_relaxed_input_section) Change base class toOutput_section_data_build.(Output_relaxed_input_section::Output_relaxed_input_section): Adjustbase class initializer.(Output_section::add_relaxed_input_section): New method declaration.(Output_section::Input_section): Change visibility to protected.(Output_section::Input_section::relobj,Output_section::Input_section::shndx): Handle relaxed input sections.Output_section::input_sections) Change visibility to protected. Alsodefine overload to return a non-const pointer.(Output_section::Merge_section_properties): New class defintion.(Output_section::Merge_section_by_properties_map,Output_section::Output_section_data_by_input_section_map,Output_section::Relaxation_map): New types.(Output_section::relax_input_section): Rename method toOutput_section::convert_input_sections_to_relaxed_sections and changeinterface to take a vector of relaxed section pointers.(Output_section::find_merge_section,Output_section::find_relaxed_input_section,Output_section::build_relaxation_map,Output_section::convert_input_sections_in_list_to_relaxed_sections):New method declarations.(Output_section::merge_section_map_Output_section::merge_section_by_properties_map_,Output_section::relaxed_input_section_map_,Output_section::is_relaxed_input_section_map_valid_,Output_section::generate_code_fills_at_write_): New data members.* script-sections.cc(Output_section_element_input::set_section_addresses): Callcurrent_data_size and addralign methods of relaxed input sections.(Orphan_output_section::set_section_addresses): Call current_data_sizeand addralign methods of relaxed input sections.* symtab.cc (Symbol_table::compute_final_value): Extract templatefrom the body of Symbol_table::sized_finalize_symbol.(Symbol_table::sized_finalized_symbol): CallSymbol_table::compute_final_value.* symtab.h (Symbol_table::Compute_final_value_status): New enum type.(Symbol_table::compute_final_value): New templated method declaration.* target.cc (Target::do_make_output_section): New method defintion.* target.h (Target::make_output_section): New method declaration.(Target::relax): Add more parameters for input objects, symbol tableand layout. Adjust call to do_relax.(Target::do_make_output_section): New method declaration.(Target::do_relax): Add parameters for input objects, symbol tableand layout.2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>* pread.c: Include stdio.h.2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>* plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is notdefined.2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Change read_shndx type to unsigned int.(Sized_dwarf_line_info::read_lines): Change shndx type to unsignedint.(Sized_dwarf_line_info::read_line_mappings): Likewise.* dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):Change read_shndx type to unsigned int.(Sized_dwarf_line_info::read_lines): Change shndx type to unsignedint.(Sized_dwarf_line_info::read_line_mappings): Likewise.* layout.cc (Layout::create_symtab_sections): Cast the result oflocal_symcount * symsize to off_t in the gold_assert.2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true forR_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,R_ARM_BASE_ABS.(Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.(Arm_relocate_functions::thm_abs5): New function.(Arm_relocate_functions::abs12): New function.(Arm_relocate_functions::abs16): New function.(Arm_relocate_functions::base_abs): New function.(Scan::check_non_pic): Handle R_ARM_ABS32_NOI.(Scan::local): Remove special handling of R_ARM_ABS8. HandleR_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, andR_ARM_BASE_ABS.(Scan::global): Likewise.(Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.(Relocatable_size_for_reloc::get_size_for_reloc): HandleR_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, andR_ARM_BASE_ABS.2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Arm_relocate_functions::movw_prel_nc): New function.(Arm_relocate_functions::movt_prel): New function.(Arm_relocate_functions::thm_movw_prel_nc): New function.(Arm_relocate_functions::thm_movt_prel): New function.(Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.(Scan::global, Relocate::relocate): Likewise.(Relocatable_size_for_reloc::get_size_for_reloc): Likewise.2009-10-09 Mikolaj Zalewski <mikolajz@google.com>* gold.cc: (queue_initial_tasks): Pass incremental_inputs toIncremental_checker.* incremental.cc: (INCREMENTAL_LINK_VERSION): Change type tounsigned int.(class Incremental_inputs_header): New class.(Incremental_inputs_header_writer): Edit comment.(Incremental_inputs_entry): New class.(Incremental_inputs_entry_writer): Edit comment.(Sized_incremental_binary::do_find_incremental_inputs_section):Add *strtab_shndx parameter, fill it.(Sized_incremental_binary::do_check_inputs): New method.(Incremental_checker::can_incrementally_link_output_file): UseSized_incremental_binary::check_inputs.(Incremental_inputs::report_command_line): Save command line incommand_line_.* incremental.h:(Incremental_binary::find_incremental_inputs_section): Newmethod.(Incremental_binary::do_find_incremental_inputs_section): Addstrtab_shndx parameter.(Incremental_binary::do_check_inputs): New pure virtual method.(Sized_incremental_binary::do_check_inputs): Declare.(Incremental_checker::Incremental_checker): Add incremental_inputsparameter, use it to initialize incremental_inputs_.(Incremental_checker::incremental_inputs_): New field.(Incremental_checker::command_line): New method.(Incremental_checker::inputs): New method.(Incremental_checker::command_line_): New field.2009-10-09 Mikolaj Zalewski <mikolajz@google.com>* incremental.cc: Include <cstdarg> and "target-select.h".(vexplain_no_incremental): New function.(explain_no_incremental): New function.(Incremental_binary::error): New method.(Sized_incremental_binary::do_find_incremental_inputs_section): Newmethod.(make_sized_incremental_binary): New function.(open_incremental_binary): New function.(can_incrementally_link_file): Add checks if output is ELF and hasinputs section.* incremental.h: Include "elfcpp_file.h" and "output.h".(Incremental_binary): New class.(Sized_incremental_binary): New class.(open_incremental_binary): Declare.* object.cc (is_elf_object): Useelfcpp::Elf_recognizer::is_elf_file.(make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.* output.h (Output_file::filesize): New method.2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):New function.(Arm_relocate_functions::insert_val_arm_movw_movt): New function.(Arm_relocate_functions::extract_thumb_movw_movt_addend): Newfunction.(Arm_relocate_functions::insert_val_thumb_movw_movt): Newfunction.(Arm_relocate_functions::movw_abs_nc): New function.(Arm_relocate_functions::movt_abs): New function.(Arm_relocate_functions::thm_movw_abs_nc): New function.(Arm_relocate_functions::thm_movt_abs): New function.(Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.(Scan::global): Likewise.(Relocate::relocate): Likewise.(Relocatable_size_for_reloc::get_size_for_reloc): Likewise.2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (Arm_relocate_functions::got_prel) New function.(Scan::local, Scan::global): Handle R_ARM_GOT_PREL.(Relocate::relocate): Likewise.(Relocatable_size_for_reloc::get_size_for_reloc): Likewise.2009-10-06 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Definesplit_stack_adjust_size parameter.* object.h (class Object): Add uses_split_stack_ andhas_no_split_stack_ fields. Add uses_split_stack andhas_no_split_stack accessor functions. Declarehandle_split_stack_section.(class Reloc_symbol_changes): Define.(class Sized_relobj): Define Function_offsets. Declaresplit_stack_adjust, split_stack_adjust_reltype, andfind_functions.* object.cc (Object::handle_split_stack_section): New function.(Sized_relobj::do_layout): Call handle_split_stack_section.* dynobj.cc (Sized_dynobj::do_layout): Callhandle_split_stack_section.* reloc.cc (Sized_relobj::relocate_sections): Callsplit_stack_adjust for executable sections in split_stackobjects. Pass reloc_map to relocate_section.(Sized_relobj::split_stack_adjust): New function.(Sized_relobj::split_stack_adjust_reltype): New function.(Sized_relobj::find_functions): New function.* target-reloc.h: Include "object.h".(relocate_section): Add reloc_symbol_changes parameter. Changeall callers.* target.h (class Target): Add calls_non_split method. Declaredo_calls_non_split virtual method. Declare match_view andset_view_to_nop.* target.cc: Include "elfcpp.h".(Target::do_calls_non_split): New function.(Target::match_view): New function.(Target::set_view_to_nop): New function.* gold.cc (queue_middle_tasks): Give an error if mixingsplit-stack and non-split-stack objects with -r.* i386.cc (Target_i386::relocate_section): Addreloc_symbol_changes parameter.(Target_i386::do_calls_non_split): New function.* x86_64.cc (Target_x86_64::relocate_section): Addreloc_symbol_changes parameter.(Target_x86_64::do_calls_non_split): New function.* arm.cc (Target_arm::relocate_section): Add reloc_symbol_changesparameter.* powerpc.cc (Target_powerpc::relocate_section): Addreloc_symbol_changes parameter.* sparc.cc (Target_sparc::relocate_section): Addreloc_symbol_changes parameter.* configure.ac: Call AM_CONDITIONAL for the default target.* configure: Rebuild.* testsuite/Makefile.am (TEST_AS): New variable.(check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.(check_DATA): Add split_i386 and split_x86_64 files.(SPLIT_DEFSYMS): Define.(split_i386_[1234n].o): New targets.(split_i386_[124]): New targets.(split_i386_[1234r].stdout): New targets.(split_x86_64_[1234n].o): New targets.(split_x86_64_[124]): New targets.(split_x86_64_[1234r].stdout): New targets.(MOSTLYCLEANFILES): Add new executables.* testsuite/split_i386.sh: New file.* testsuite/split_x86_64.sh: New file.* testsuite/split_i386_1.s: New file.* testsuite/split_i386_2.s: New file.* testsuite/split_i386_3.s: New file.* testsuite/split_i386_4.s: New file.* testsuite/split_i386_n.s: New file.* testsuite/split_x86_64_1.s: New file.* testsuite/split_x86_64_2.s: New file.* testsuite/split_x86_64_3.s: New file.* testsuite/split_x86_64_4.s: New file.* testsuite/split_x86_64_n.s: New file.* testsuite/testfile.cc (Target_test): Update relocation_sectionfunction.* testsuite/Makefile.in: Rebuild.2009-10-06 Ian Lance Taylor <iant@google.com>* i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.(Target_i386::Relocate::relocate_tls): Call fix_up_ldo beforechanging local_dynamic_type_ from LOCAL_DYNAMIC_NONE. Whenhandling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, pushthe address on ldo_addrs_.(Target_i386::Relocate::fix_up_ldo): New function.2009-10-06 Rafael Espindola <espindola@google.com>* plugin.cc (add_input_library): New.(Plugin::load): Add add_input_library to tv.(Plugin_manager::add_input_file): Add the is_lib argument.(add_input_file): Update call to Plugin_manager::add_input_file.(add_input_library): New.* plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.2009-09-30 Doug Kwan <dougkwan@google.com>* arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB functionsymbol and call Symbol::may_need_copy_reloc to determine ifa copy reloc is needed.* copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -znocopyreloc is given in command line.(Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is notgiven in command line.* i386.cc (Target_i386::may_need_copy_reloc): Remove.(Target_i386::Scan::global): Use Symbol::may_need_copy_reloc insteadof the removed Target_i386::may_need_copy_reloc.* options.h (copyreloc): New option with default value false.* powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.(Target_powerpc::Scan::global): Use Symbol::may_need_copy_relocinstead of the removed Target_powerpc::may_need_copy_reloc.* sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.(Target_sparc::Scan::global): Use Symbol::may_need_copy_relocinstead of the removed Target_sparc::may_need_copy_reloc.* symtab.h (Symbol::may_need_copy_reloc): New method definition.* x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.(Target_x86_64::Scan::global): Use Symbol::may_need_copy_relocinstead of the removed Target_x86_64::may_need_copy_reloc.2009-09-30 Ian Lance Taylor <iant@google.com>* object.h (class Object): Remove target_ field, and target,sized_target, and set_target methods.(Object::sized_target): Remove.(class Sized_relobj): Update declarations. Remove sized_target.* object.cc (Sized_relobj::setup): Remove target parameter.Change all callers.(Input_objects::add_object): Don't do anything with the target.(make_elf_sized_object): Add punconfigured parameter. Change allcallers. Set or test parameter target.* dynobj.cc (Sized_dynobj::target): Remove target parameter.Change all callers.* parameters.cc (Parameters::set_target): Change parameter type tobe non-const.(Parameters::default_target): Remove.(set_parameters_target): Change parameter type to be non-const.(parameters_force_valid_target): New function.(parameters_clear_target): New function.* parameters.h (class Parameters): Update declarations. Removedefault_target method. Add sized_target and clear_targetmethods. Change target_ to be non-const.(set_parameters_target): Update declaration.(parameters_force_valid_target): Declare.(parameters_clear_target): Declare.* readsyms.cc (Read_symbols::do_read_symbols): Pass punconfiguredas NULL if we aren't searching.(Add_symbols::run): Don't check for compatible target.* fileread.cc (Input_file::open_binary): Callparameters_force_valid_target.* gold.cc (queue_middle_tasks): Likewise.* plugin.cc (make_sized_plugin_object): Likewise. Don't callset_target on object.* dynobj.h (class Sized_dynobj): Update declarations.* archive.cc (Archive::get_elf_object_for_member): Return NULL ifmake_elf_object returns NULL.(Archive::include_member): Don't check whether object target iscompatible.* output.cc (Output_section::add_input_section): Get target fromparameters.(Output_section::relax_input_section): Likewise.* reloc.cc (Sized_relobj::do_gc_process_relocs): Get target fromparameters.(Sized_relobj::do_scan_relocs): Likewise.(Sized_relobj::relocate_sections): Likewise.* resolve.cc (Symbol_table::resolve): Likewise.* symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove objectparameter. Change all callers.(Symbol_table::add_from_object): Get target from parameters.(Symbol_table::add_from_relobj): Don't check object target.(Symbol_table::add_from_dynobj): Likewise.(Symbol_table::define_special_symbol): Get target fromparameters.* symtab.h (class Symbol_table): Update declaration.* testsuite/binary_unittest.cc (gold_testsuite): Remove targetparameter. Change all callers. Clear parameter target.(Binary_test): Test target here.* testsuite/object_unittest.cc (gold_testsuite): Removetarget_test_pointer parameter. Change all callers.(Object_test): Test target here.2009-09-26 Ian Lance Taylor <iant@google.com>* testsuite/initpri1.c: Don't try to use constructor priorities ifcompiling with gcc before 4.3.2009-09-22 Mikolaj Zalewski <mikolajz@google.com>* testsuite/retain_symbols_file_test.sh (check_present): Changeoutput file name to retain_symbols_file_test.stdout.(check_absent): Likewise.2009-09-18 Craig Silverstein <csilvers@google.com>* object.cc (Sized_relobj::do_count): Test should_retain_symbol map.* options.cc: Include <cerrno> and <fstream>.(General_options::finalize): Parse -retain-symbols-file tag.* options.h: New flag.(General_options): New method should_retain_symbol, newvariable symbols_to_retain.* symtab.cc (Symbol_table::sized_finalize_symbol): Testshould_retain_symbol map.* testsuite/Makefile.am (retain_symbols_file_test): New test.* testsuite/Makefile.in: Regenerate.* testsuite/retain_symbols_file_test.sh: New file.2009-09-18 Nick Clifton <nickc@redhat.com>* po/es.po: Updated Spanish translation.2009-09-17 Doug Kwan <dougkwan@google.com>* debug.h (DEBUG_RELAXATION): New constant.(DEBUG_ALL): Add DEBUG_RELAXATION.(debug_string_to_enum): Add relaxation debug option.* layout.cc(Layout::Relaxation_debug_check::check_output_data_for_reset_values,Layout::Relaxation_debug_check::read_sections,Layout::Relaxation_debug_check::read_sections): New method definitions.(Layout::Layout): Initialize data membersrecord_output_section_data_from_scrips_,script_output_section_data_list_ and relaxation_debug_check_.(Layout::save_segments, Layout::restore_segments,Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,Layout::relaxation_loop_body): New method definitions.(Layout::finalize): Support relaxation. Move section layout code toLayout::relaxation_loop_body.(Layout::set_asection_address_from_script): Move code for orphansection placement out.(Layout::place_orphan_sections_in_script): New method definition.* layout.h (Output_segment_headers, Output_file_header):New forward class declarations.(Layout::~Layout): Define.(Layout::new_output_section_data_from_script): New method definition.(Layout::place_orphan_sections_in_script): New method declaration.(Layout::Segment_states): New type declaration.(Layout::save_segments, Layout::restore_segments,Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,Layout::relaxation_loop_body): New method declarations.(Layout::Output_section_data_list): New type declaration.(Layout::Relaxation_debug_check): New class definition.(Layout::record_output_section_data_from_script_,Layout::script_output_section_data_list_, Layout::segment_states_,Layout::relaxation_debug_check_): New data members.* output.cc: (Output_section_headers::do_size): New method definition.(Output_section_headers::Output_section_headers): Move sizecomputation to Output_section_headers::do_size.(Output_segment_headers::do_size): New method definition.(Output_file_header::Output_file_header): Move size computation toOutput_file_header::do_size and call it.(Output_file_header::do_size): New method definition.(Output_data_group::Output_data_group): Adjust call toOutput_section_data.(Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.(Output_symtab_xindex::do_write): Add array bound check.(Output_section::Input_section::print_to_mapfile): HandleRELAXED_INPUT_SECTION_CODE.(Output_section::Output_section): Initialize data member checkpoint_.(Output_section::~Output_section): Delete checkpoint object pointedby checkpoint_.(Output_section::add_input_section): Always add an Input_section ifrelaxing.(Output_section::add_merge_input_section): Add assert.(Output_section::relax_input_section): New method definition.(Output_section::set_final_data_size): Set load address to zero foran unallocated section.(Output_section::do_address_and_file_offset_have_reset_values):New method definition.(Output_section::Input_section_sort_enty::Input_section_sort_enty):Handle relaxed input section.(Output_section::sort_attached_input_sections): Checkpoint inputsection list lazily.(Output_section::get_input_sections): Change type of input_sections tolist of Simple_input_section pointers. Checkpoint input section listlazily. Also handle relaxed input sections.(Output_section::add_input_section_for_script): Take a reference toa Simple_input_section object instead of Relobj pointer and sectionindex as parameter. Handle relaxed input sections.(Output_section::save_states, Output_section::restore_states): Newmethod definitions.* output.h (Output_data::Output_data): Initialize is_data_size_fixed_.(Output_data::is_data_size_fixed): New method definition.(Output_data::reset_addresss_and_file_offset): Do not reset data sizeif it is fixed.(Output_data::address_and_file_offset_have_reset_values): New methoddefinition.(Output_data::do_address_and_file_offset_have_reset_values): New methoddefinition.(Output_data::set_data_size): Check that data size is not fixed.(Output_data::fix_data_size): New method definition.(Output_data::is_data_size_fixed_): New data member.(Output_section_headers::set_final_data_size): New method definition.(Output_section_headers::do_size): New method declaration.(Output_segment_headers::set_final_data_size): New method definition.(Output_segment_headers::do_size): New method declaration.(Output_file_header::set_final_data_size)::New method definition.(Output_file_header::do_size)::New method declaration.(Output_section_data::Output_section_data): Add new parameteris_data_size_fixed and use it to fix data size.(Output_data_const::Output_data_const): Adjust call to base classconstructor and fix data size.(Output_data_const_buffer::Output_data_const_buffer): Adjust call tobase class constructor and fix data size.(Output_data_fixed_space::Output_data_fixed_space): Adjust call tobase class constructor and fix data size.(Output_data_zero_fill::Output_data_zero_fill): Adjust call to baseclass constructor and fix data size.(Output_data_group::set_final_data_size): New method definition.(Output_data_dynamic::Dynamic_entry::tag): New method definition.(Output_symtab_xindex::Output_symtab_xindex): Adjust call to baseclass constructor and fix data size.(Output_relaxed_input_section): New class definition.(Output_section::Simple_input_section): New class definition.(Output_section::get_input_sections): Adjust parameter list.(Output_section::add_input_section_for_script): Same.(Output_section::save_states, Output_section::restore_states,Output_section::do_address_and_file_offset_have_reset_values,(Output_section::Input_section::Input_section): HandleRELAXED_INPUT_SECTION_CODE. Add new overload forOutput_relaxed_input_section.(Output_section::Input_section::is_input_section,Output_section::Input_section::set_output_section): Handle relaxedinput section.(Output_section::Input_section::is_relaxed_input_section,Output_section::Input_section::output_section_data,Output_section::Input_section::relaxed_input_section): New methoddefinitions.(Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enumvalue.(Output_section::Input_section::u1_): Update comments.(Output_section::Input_section::u2_): Add new union member poris.(Output_section::Checkpoint_output_section): New classs definition.(Output_section::relax_input_section): New method declaration.(Output_section::checkpoint_): New data member.(Output_segment): Update comments.(Output_segment::Output_segment): Un-privatize copy constructor.(Output_segment::operator=): Un-privatize.* script-sections.cc (Output_section_element::Input_section_list):Change element type to Output_section::Simple_input_section.(Output_section_element_dot_assignment::set_section_addresses):Register output section data for relaxation clean up.(Output_data_exression::Output_data_expression): Adjust call to baseconstructor to fix data size.(Output_section_element_data::set_section_addresses): RegisterOutput_data_expression object for relaxation clean up.(struct Input_section_info): Replace Relobj pointer and section indexpair with Output_section::Simple_input_section and Convert struct to aclass.(Input_section_sorter::operator()): Adjust access toInput_section_info data member to use accessors.(Output_section_element_input::set_section_addresses): Use layoutparameter. Adjust code to use Output_section::Simple_input_sectionand Input_secction_info classes. Register filler for relaxationclean up.(Orphan_output_section::set_section_addresses): Replace Relobj pointerand section index pair with Output_section::Simple_input_sectionclass. Adjust code accordingly.(Phdrs_element::release_segment): New method definition.(Script_sections::attach_sections_using_phdrs_clause): Do not modifysegment list.(Script_sections::release_segments): New method definition.* gold/script-sections.h (Script_sections::release_segments): Newmethod declaration.* gold/target.h (Target::may_relax, Target::relax,Target::do_may_relax, Target::do_relax): New method definitions.2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>* arm.cc (has_signed_unsigned_overflow): New function.(Arm_relocate_functions::abs8): New function.(Target_arm::Scan::local): Handle R_ARM_ABS8.(Target_arm::Scan::global): Likewise.(Target_arm::relocate::relocate): Likewise.(Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):Likewise.2009-09-16 Cary Coutant <ccoutant@google.com>* testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.* testsuite/Makefile.in: Regenerate.2009-09-11 Nick Clifton <nickc@redhat.com>* po/gold.pot: Updated by the Translation project.2009-09-08 Cary Coutant <ccoutant@google.com>* output.cc (Output_file::open): Add execute permission to empty file.* testsuite/Makefile.am (permission_test): New test.* testsuite/Makefile.in: Regenerate.2009-09-02 Ian Lance Taylor <iant@google.com>* output.cc (Output_file::resize): Call map_no_anonymous ratherthan map.2009-09-01 Mikolaj Zalewski <mikolajz@google.com>* gold.cc: Include "incremental.h".(queue_initial_tasks): Call Incremental_checker methods.* incremental.cc: Include "output.h".(Incremental_checker::can_incrementally_link_output_file): Newmethod.* incremental.h (Incremental_checker): New class.* output.cc (Output_file::open_for_modification): New method.(Output_file::map_anonymous): Changed return type to bool. Recordmap in base_ field.(Output_file::map_no_anonymous): New method, broken out of map.(Output_file::map): Use map_no_anonymous and map_anonymous.* output.h (class Output_file): Update declarations.2009-08-24 Cary Coutant <ccoutant@google.com>* options.h (Command_line::Pre_options): New class.(Command_line::pre_options): New member.* options.cc (gold::options::ready_to_register): New variable.(One_option::register_option): Do nothing if not registering options.Assert if same short option registered twice.(General_options::General_options): Turn off option registration whendone constructing.(Command_line::Pre_options::Pre_options): New constructor.2009-08-24 Cary Coutant <ccoutant@google.com>* options.h (General_options::no_keep_memory): Remove incorrectshort option.2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* Makefile.am (am__skiplex, am__skipyacc): New.* Makefile.in: Regenerate.2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>* Makefile.am (AM_CPPFLAGS): Renamed from ...(INCLUDES): ... this.* testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.(AM_CPPFLAGS): Renamed from ...(INCLUDE): ... this.* Makefile.in, testsuite/Makefile.in: Regenerate.* Makefile.in: Regenerate.* aclocal.m4: Likewise.* config.in: Likewise.* configure: Likewise.* testsuite/Makefile.in: Likewise.* Makefile.am (AUTOMAKE_OPTIONS): Add foreign.* testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.* Makefile.in: Regenerate.* testsuite/Makefile.in: Regenerate.2009-08-19 Cary Coutant <ccoutant@google.com>* resolve.cc (Symbol_table::resolve): Don't complain about definedsymbols in shared libraries overridden by hidden or internal symbolsin the main program.2009-08-19 Chris Demetriou <cgd@google.com>* testsuite/debug_msg.sh: Match .* rather than ${srcdir} whenchecking source file names in error messages.2009-08-18 Doug Kwan <dougkwan@google.com>* dynobj.cc (Sized_dynobj::setup): Take a Target object instead ofan elcpp::Ehdr as parameter. Adjust call to set_target.* dynobj.h (Sized_dynobj::setup): Take a Target object instead ofan elfcpp::Ehdr as parameter.* object.cc (Object::set_target): Remove the version that looks upa target and sets it.(Sized_relobj::setup): Take a Target object instead ofan elfcpp::Ehdr as parameter. Adjust call to set_target.(make_elf_sized_object): Find target and ask target tomake an ELF object.* object.h: (Object::set_target): Remove the version that looks upa target and sets it.(Sized_relobj::setup): Take a Target object instead ofan elfcpp:Ehdr as parameter.* target.cc: Include dynobj.h.(Target::do_make_elf_object_implementation): New.(Target::do_make_elf_object): New.* target.h (Target::make_elf_object): New template declaration.(Target::do_make_elf_object): New method declarations.(Target::do_make_elf_object_implementation): New template declaration.2009-08-14 Ian Lance Taylor <iant@google.com>* gold.h (FUNCTION_NAME): Define.(gold_unreachable): Use FUNCTION_NAME.2009-08-12 Sriraman Tallam <tmsriram@google.com>* icf.cc (Icf::find_identical_sections): Issue a warning when asymbol in the --keep-unique list is not found.2009-08-12 Sriraman Tallam <tmsriram@google.com>* icf.cc (Icf::find_identical_sections): Unfold symbols that havebeen maked as --keep-unique.(Icf::unfold_section): New function.* icf.h (Icf::unfold_section): New function.* options.h (General_options::keep_unique): New option.* testsuite/Makefile.am: Add commands to build icf_keep_unique_test.* testsuite/Makefile.in: Regenerate.* testsuite/icf_keep_unique_test.sh: New file.* testsuite/icf_keep_unique_test.cc: New file.2009-08-12 Cary Coutant <ccoutant@google.com>PR 10471* resolve.cc (Symbol_table::resolve): Check for references fromdynamic objects to hidden and internal symbols.* testsuite/Makefile.am (hidden_test.sh): New test.* testsuite/Makefile.in: Regenerate.* testsuite/hidden_test.sh: New script.* testsuite/hidden_test_1.c: New test source.* testsuite/hidden_test_main.c: New test source.2009-08-11 Doug Kwan <dougkwan@google.com>* arm.cc: Update comments.(Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDXsegment to locate the .ARM.exidx section if present.2009-08-09 Doug Kwan <dougkwan@google.com>* dynobj.h (Sized_dynobj::do_section_entsize): Revert the previouspatch.2009-08-07 Sriraman Tallam <tmsriram@google.com>* dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoidcompiler warnings.2009-08-06 Sriraman Tallam <tmsriram@google.com>* x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for avalid tls_segment only for non-debug-section relocations.* testsuite/Makefile.am: Add gc_tls_test.* testsuite/Makefile.in: Regenerate.* testsuite/gc_tls_test.cc: New file.* testsuite/gc_tls_test.sh: New file.2009-08-05 Sriraman Tallam <tmsriram@google.com>* icf.cc: New file.* icf.h: New file.* Makefile.am (CCFILES): Add icf.cc.(HFILES): Add icf.h* Makefile.in: Regenerate.* dynobj.h (Sized_dynobj::do_section_entsize): New function.* gc.h (gc_process_relocs): Populate lists used by icf to containsection, symbol and addend information for the relocs.* gold.cc (queue_middle_tasks): Call identical code folding.* gold.h: Add defines for multimap.* layout.cc (Layout::create_symtab_sections): Add symtab as parameterto the call of finalize_local_symbols.* main.cc (main): Create object of class Icf.* object.cc (Sized_relobj::do_layout): Allow this function to becalled twice during icf.(Sized_relobj::do_finalize_local_symbols): Fold symbols correspondingto sections marked as identical by icf.(Sized_relobj::do_section_flags): Get section_flags from Symbols_datawhen available.(Sized_relobj::do_section_entsize): New function.* object.h (Object::section_entsize): New function.(Object::do_section_entsize): New pure virtual function.(Relobj::finalize_local_symbols): Add new parameter.(Relobj::do_section_entsize): New function.* options.h (General_options::icf): New option.(General_options::icf_iterations): New option.(General_options::print_icf_sections): New option.* plugin.cc (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 doingicf.* symtab.cc (Symbol_table::is_section_folded): New function.(Symbol_table::sized_finalize_symbol): Fold symbols correspondingto sections marked as identical by icf.* symtab.h (Symbol_table::set_icf): New function.(Symbol_table::icf): New function.(Symbol_table::is_section_folded): New function.(Symbol_table::icf_): New data member.* target-reloc.h (relocate_section): Ignore sections folded by icf.* testsuite/Makefile.am: Add commands to build icf_test.* testsuite/Makefile.in: Regenerate.* testsuite/icf_test.sh: New file.* testsuite/icf_test.cc: New file.2009-07-24 Chris Demetriou <cgd@google.com>* layout.cc (is_compressible_debug_section): Fix incorrectcomment about compressed section names.2009-07-20 Ian Lance Taylor <ian@airs.com>PR 10419* x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.2009-07-16 Ian Lance Taylor <iant@google.com>PR 10400* layout.h: #include <map>.(class Kept_section): Change from struct to class. Add accessorsand setters. Add section size to Comdat_group mapping. ChangeComdat_group to std::map. Add is_comdat_ field. Addlinkonce_size field in union.(class Layout): Update declaration of find_or_add_kept_section.Don't declare find_kept_object.* layout.cc (Layout::find_or_add_kept_section): Remove candidateparameter. Add object, shndx, is_comdat, and is_group_nameparameters. Change all callers. Adjust for new Kept_section.(Layout::find_kept_object): Remove.* object.cc (Sized_relobj::include_section_group): Update use ofKept_section. Rename secnum to shndx. Only recordKept_comdat_section if sections are the same size.(Sized_relobj::include_linkonce_section): Update use ofKept_section. Only record Kept_comdat_section if sections are thesame size. Set size of linkonce section.(Sized_relobj::map_to_kept_section): Update call toget_kept_comdat_section.* object.h (class Sized_relobj): Rename fields inKept_comdat_section to drop trailing underscores; change objectfield to Relobj*. Change Kept_comdat_section_table to storestruct rather than pointer.(Sized_relobj::set_kept_comdat_section): Remove kept parameter.Add kept_object and kept_shndx parameters. Change all callers.(Sized_relobj::get_kept_comdat_section): Change return type tobool. Add kept_object and kept_shndx parameters. Change allcallers.* plugin.cc (Pluginobj::include_comdat_group): Update call toLayout::find_or_add_kept_section.2009-07-09 Ian Lance Taylor <iant@google.com>* merge.cc (Object_merge_map::initialize_input_to_output_map):Reserve space in the hash table.2009-07-06 Mikolaj Zalewski <mikolajz@google.com>* fileread.cc (File_read::get_mtime): New method.* fileread.h (Timespec): New structure.(File_read::get_mtime): New method.* incremental.cc (Incremental_inputs_entry_data::timestamp_usec):Renamed from timestamp_nsec.(Incremental_inputs_entry_write::timestamp_sec): Fix argument toElf_Xword.(Incremental_inputs_entry_write::timestamp_usec): Renamed fromtimestamp_nsec.(Incremental_inputs::report_archive): Save mtime; style fix.(Incremental_inputs::report_obejct): Save mtime; style fix.(Incremental_inputs::report_script): Save mtime; style fix.(Incremental_inputs::finalize_inputs): Style fix.(Incremental_inputs::finalize): Style fix.(Incremental_inputs::create_input_section_data): Store inputsmtime.* incremental.h (Incremental_inputs::report_script): Add mtimeargument.(Incremental_inputs::Input_info::Input_info): Intialize only oneunion member.(Incremental_inputs::Input_info::archive): Move to namelessunion.(Incremental_inputs::Input_info::obejct): Move to nameless union.(Incremental_inputs::Input_info::script): Move to nameless union.(Incremental_inputs::mtime): New field.* script.cc (read_input_script): Pass file mtime toIncremental_input.* script.h (Script_info::inputs): Style fix.2009-07-01 Ian Lance Taylor <ian@airs.com>* freebsd.h (Target_freebsd::do_adjust_elf_header): Use sizeinstead of 32.2009-06-24 Ian Lance Taylor <iant@google.com>PR 10156* layout.cc (Layout::choose_output_section): If we find anexisting section, update the flags.(Layout::create_notes): New function, broken out ofLayout::finalize.(Layout::finalize): Don't create note sections.(Layout::create_note): Don't crash if linker script discardssection.(Layout::create_gold_note): Likewise.(Layout::create_build_id): Likewise. Don't setafter_input_sections on the section.(Layout::create_executable_stack_info): Remove target parameter.Change caller.* layout.h (class Layout): Declare create_notes. Updatedeclaration of create_executable_stack_info.* gold.cc (queue_middle_tasks): Call create_notes.* output.cc (Output_section::update_flags_for_input_section): Movehere from output.h. If SHF_ALLOC flag is newly set, mark addressinvalid.* output.h (Output_data::mark_address_invalid): New function.(class Output_section): Only declare, not define,update_flags_for_input_section. Remove set_flags.2009-06-24 Ian Lance Taylor <iant@google.com>* script-sections.cc (Output_section_definition::set_section_addresses): Rename shadowing local load_address toladdr.2009-06-24 Ian Lance Taylor <iant@google.com>PR 10244* reloc.cc (relocate_sections): Skip empty relocation sections.2009-06-23 Ian Lance Taylor <iant@google.com>PR 10156* layout.cc (Layout::create_note): Use choose_output_sectionrather than make_output_section.2009-06-23 Ian Lance Taylor <iant@google.com>PR 10237* options.cc (General_options::parse_V): Set printed_version_.(General_options::General_options): Initialize printed_version_.* options.h (class General_options): Add printed_version_ field.* gold.cc (queue_initial_tasks): If there are no input files,don't give a fatal error if we printed the version information.(queue_middle_tasks): If using -r with a shared object, give afatal error rather than an ordinary error.2009-06-23 Ian Lance Taylor <iant@google.com>PR 10219* layout.cc (Layout::Layout): Initialize have_stabstr_section_.(Layout::make_output_section): Set have_stabstr_section_ if we seea .stab*str section.(Layout::finalize): Call link_stabs_sections.(Layout::link_stabs_sections): New file.* layout.h (class Layout): Add have_stabstr_section_ field.Declare link_stabs_sections.2009-06-23 Doug Kwan <dougkwan@google.com>* Makefile.am (libgold_a_LIBADD): New.(ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS* Makefile.in: Regenerate.* config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.* configure: Regenerate.* configure.ac (AC_CHECK_DECLS): Add strndup and memmem.* fileread.cc: Include sys/state.h* gold.h: Declare memmem and strndup if found missing.* gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.2009-06-23 Ian Lance Taylor <iant@google.com>* configure.ac: Call AC_CHECK_DECLS using C, not C++.* configure: Rebuild.2009-06-23 Ian Lance Taylor <iant@google.com>PR 10147* object.cc (Object::section_contents): Don't try to get a view ifthe section has length zero.(Object::handle_gnu_warning_section): If the section is empty, usethe name of the section as the warning.2009-06-23 Ian Lance Taylor <iant@google.com>PR 10133* stringpool.h (class Stringpool_template): Add optimize_ field.(Stringpool_template::set_optimize): New function.* stringpool.cc (Stringpool_template::Stringpool_template):Initialize optimize_ field.(Stringpool_template::set_string_offsets): Test local optimizefild rather than parameter.* layout.cc (Layout::Layout): Call set_optimize on the sectionname stringpool.2009-06-22 Ian Lance Taylor <iant@google.com>PR 10030* yyscript.y: Parse TARGET.* script.cc (script_set_target): New function.* script-c.h (script_set_target): Declare.* options.cc (General_options::string_to_object_format): Renamefrom string_to_object_format in anonymous namespace. Changecallers.* options.h (class General_options): Declarestring_to_object_format.2009-06-22 Ian Lance Taylor <iant@google.com>* script-sections.cc (Script_sections::create_segments): Don't putprogram headers in a PT_LOAD segment if -n or -N.2009-06-22 Ian Lance Taylor <iant@google.com>PR 10141* options.h (class General_options): Add -z lazy and -z now. Sort-z options into alphabetical order.* layout.cc (Layout::finish_dynamic_section): Handle -z now.2009-06-21 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::make_output_section): CallTarget::new_output_section.(Layout::attach_allocated_section_to_segment): Put large sectionsections in a separate load segment with the large segment flagset.(Layout::segment_precedes): Sort large data segments after otherload segments.(align_file_offset): New static function.(Layout::set_segment_offsets): Use align_file_offset.* output.h (class Output_section): Add is_small_section_ andis_large_section_ fields.(Output_section::is_small_section): New function.(Output_section::set_is_small_section): New function.(Output_section::is_large_section): New function.(Output_section::set_is_large_section): New function.(Output_section::is_large_data_section): New function.(class Output_segment): Add is_large_data_segment_ field.(Output_segment::is_large_data_segment): New function.(Output_segment::set_is_large_data_segment): New function.* output.cc (Output_section::Output_section): Initialize newfields.(Output_segment::Output_segment): Likewise.(Output_segment::add_output_section): Add assertion that largedata sections always go in large data segments. Force small datasections to the end of the list of data sections. Force small BSSsections to the start of the list of BSS sections. For large BSSsections to the end of the list of BSS sections.* symtab.h (class Symbol): Declare is_common_shndx.(Symbol::is_defined): Check Symbol::is_common_shndx.(Symbol::is_common): Likewise.(class Symbol_table): Define enum Commons_section_type. Updatedeclarations. Add small_commons_ and large_commons_ fields.* symtab.cc (Symbol::is_common_shndx): New function.(Symbol_table::Symbol_table): Initialize new fields.(Symbol_table::add_from_object): Put small and large commonsymbols in the right list.(Symbol_table::sized_finalized_symbol): CheckSymbol::is_common_shndx.(Symbol_table::sized_write_globals): Likewise.* common.cc (Symbol_table::do_allocate_commons): Allocate newcommon symbol lists. Don't call do_allocate_commons_list if thelist is empty.(Symbol_table::do_allocate_commons_list): Remove is_tlsparameter. Add comons_section_type parameter. Change allcallers. Handle small and large common symbols.* object.cc (Sized_relobj::do_finalize_local_symbols): CheckSymbol::is_common_shndx.* resolve.cc (symbol_to_bits): Likewise.* target.h (Target::small_common_shndx): New function.(Target::small_common_section_flags): New function.(Target::large_common_shndx): New function.(Target::large_common_section_flags): New function.(Target::new_output_section): New function.(Target::Target_info): Add small_common_shndx, large_common_shndx,small_common_section_flags, and large_common_section_flagsfields.(Target::do_new_output_section): New virtual function.* arm.cc (Target_arm::arm_info): Initialize new fields.* i386.cc (Target_i386::i386_info): Likewise.* powerpc.cc (Target_powerpc::powerpc_info) [all versions]:Likewise.* sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.* x86_64.cc (Target_x86_64::x86_64_info): Likewise.(Target_x86_64::do_new_output_section): New function.* configure.ac: Define conditional MCMODEL_MEDIUM.* testsuite/Makefile.am (check_PROGRAMS): Add large.(large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.(large_LDFLAGS): Define.* testsuite/large.c: New file.* testsuite/testfile.cc (Target_test::test_target_info):Initialize new fields.* configure, testsuite/Makefile.in: Rebuild.2009-06-05 Doug Kwan <dougkwan@google.com>* Makefile.am (CCFILES): Add target.cc.* Makefile.in: Regenerate.* i386.cc (class Target_i386): Define new virtual method tooverride do_is_local_label_name in parent.* object.cc (Sized_relobj::do_count_local_symbols): Discardlocal symbols if --discard-locals or -X is given.* options.h (class General_options): Declare new options'--discard-locals' and '-X' for discarding locals.* target.h (class Target): Define new methods is_local_label_name.Declare new virtual method do_is_local_label_name.* target.cc: New file.* testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.(check_SCRIPTS): Add discard_locals_test.sh.(check_DATA): Add discard_local_tests.syms.(discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.(discard_local_tests.syms, discard_locals_test.o): New make rules.* testsuite/Makefile.in: Regenerate.* testsuite/discard_locals_test.c: New file.* testsuite/discard_locals_test.sh: Same.2009-06-05 Doug Kwan <dougkwan@google.com>* object.cc (Sized_relobj::Sized_relobj): Initializediscarded_eh_frame_shndx_ to -1U.(Sized_relobj::do_layout): Record index of a discard .eh_framesection.(Sized_relobj::do_count_local_symbols): Skip local symbols ina discarded .eh_frame section.(Sized_relobj::do_finalize_local_symbols): Ditto.* object.h (class Sized_relobj): Declare new memberdiscarded_eh_frame_shndx_.* testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.(local_labels_test.o, local_labels_test): New rules.* testsuite/Makefile.in: Regenerate.2009-06-04 Doug Kwan <dougkwan@google.com>* layout.cc (Layout::section_name_mapping): Add mapping forspecial ARM sections.2009-06-03 Doug Kwan <dougkwan@google.com>* arm.cc (utils::sign_extend): Reverse test in gold_assert.(utils::has_overflow): Same.2009-06-03 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::section_name_mapping): New array, replacingLayout::linkonce_mapping.(Layout::section_name_mapping_count): New variable, replacingLayout::linkonce_mapping_count.(Layout::linkonce_output_name): Remove.(Layout::output_section_name): Rewrite.* layout.h (class Layout): Rename Linkonce_mapping toSection_name_mapping, linkonce_mapping to section_name_mapping,linkonce_mapping_count to section_name_mapping_count. Don'tdeclare linkonce_output_name.2009-06-03 Doug Kwan <dougkwan@google.com>* gold/arm.cc (namespace utils): New.(Target_arm::reloc_is_non_pic): Define new method.(class Arm_relocate_functions): New.(Target_arm::Relocate::relocate): Handle relocation types used byAndroid.2009-06-03 Ian Lance Taylor <iant@google.com>* arm.cc (Target_arm::scan::global): Use || instead of |.2009-06-02 Doug Kwan <dougkwan@google.com>* gold/arm.cc (Target_arm::Scan::Scan): Initializeissued_non_pic_error_.(class Target_arm::Scan): Declare new method check_non_pic.Define new method symbol_needs_plt_entry.Declare new data member issued_non_pic_error_.(class Target_arm::Relocate): Declare new methodshould_apply_static_reloc.(Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.(Target_arm::Scan::check_non_pic): Define new method.(Target_arm::Scan::local): Handle a small subset of reloc types usedby Android.(Target_arm::Scan::local): Same.(Target_arm::Relocate::should_apply_statci_reloc): Define new method.2009-05-31 Mikolaj Zalewski <mikolajz@google.com>* incremental.cc (Incremental_inputs::report_command_line): Filterout --incremental-* options.2009-05-29 Doug Kwan <dougkwan@google.com>* gold/arm.cc (Output_data_plt_arm): Forward declaration for newtemplate class.(class Target_arm): Update comment.(Target_arm::Target_arm): Initialize new data members GOT_,PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.Declare new methods Target_arm::got_section, Target_arm::make_plt_entryand Target_arm::rel_dyn_section.Declare new_enum Target_arm::Got_type.Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_and DYNBSS_.Update commments for member do_dynsym_value.(Target_arm::got_size, Target_arm::plt_section,Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Definenew methods inside class defintion.(Target_arm::got_section): Define new method.(Target_arm::rel_dyn_section): Same.(Output_data_plt_arm): New template class.(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::add_entry): Same.(Output_data_plt_arm::first_plt_entry): Define newstatic data member for PLT instruction template.(Output_data_plt_arm::plt_entry): Same.(Output_data_plt_arm::do_write): Define new method.(Target_arm::make_plt_entry): Same.(Target_arm::do_finalize_sections): Same.(Target_arm::do_dynsym_value): Same.2009-05-28 Doug Kwan <dougkwan@google.com>* Makefile.am (TARGETSOURCES): Add arm.cc.(ALL_TARGETOBJECTS): Add arm.$(OBJEXT)* Makefile.in: Regenerate.* arm.cc: New file.* configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.2009-05-26 Doug Kwan <dougkwan@google.com>* options.cc (General_options::parse_exclude_libs). Fix a comment.(General_options::check_excluded_libs): Strip off directories inarchive name before matching like GNU ld does.* testsuite/Makefile.am (MOSTLYCLEANFILES,exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a(exclude_libs_test_LDFLAGS): Add linker option-Wl,--exclude-libs,libexclude_libs_test_3(exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a asan explicit archive without using -l.(alt/libexclude_libs_test_3.a): New make rule.* testsuite/Makefile.in: Regenerate.* testsuite/exclude_libs_test.c : Declare lib3_default().(main): Call it.* exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.* exclude_libs_test_3.c: New file.2009-05-26 Nick Clifton <nickc@redhat.com>* po/id.po: New Indonesian translation.* po/gold.pot: Updated template file.2009-05-22 Sriraman Tallam <tmsriram@google.com>* testsuite/Makefile.am: Add -ffunction-sections to compilegc_comdat_test files. Add -Wl,--gc-sections to buildgc_comdat_test.* testsuite/Makefile.in: Regenerate.* testsuite/gc_comdat_test.sh: Fix the condition around grep.2009-05-21 Sriraman Tallam <tmsriram@google.com>* object.cc (Sized_relobj::map_to_kept_section): Return NULL if thekept comdat section was garbage collected.* testsuite/Makefile.am: Add test gc_comdat_test.sh.* testsuite/Makefile.in: Regenerate.* testsuite/gc_comdat_test.sh: New file.* testsuite/gc_comdat_test_1.cc: New file.* testsuite/gc_comdat_test_2.cc: New file.2009-05-19 Doug Kwan <dougkwan@google.com>* archive.cc (Archive::Archive): Move constructor from archive.hto here. Initialize no_export_.(Archive::get_elf_object_for_member): Set no_export flag of object.* archive.h (Archive::Archive): Move constructor body toarchive.cc.(Archive::no_export): New method.(Archive::no_export_): New field.* object.h (Object::Object): Initialize no_export_ to false.(Object::no_export, Object::set_no_export): New methods.(Object::no_export_): New field.* options.cc (General_options::parse_exclude_libs): New method.(General_options::check_excluded_libs) Same.* options.h (exclude_libs): New option.(General_options::check_excluded_libs): New method declaration.(General_options::excluded_libs_): New field.* symtab.cc (Symbol_table::add_from_relobj): Hide symbols withdefault or protected visibility if an object has no-export flag set.testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.(check_SCRIPTS): Add exclude_libs_test.sh.(check_DATA): Add exclude_libs_test.syms.(MOSTLYCLEANFILES): Add exclude_libs_test.syms,libexclude_libs_test_1.a and libexclude_libs_test_2.a.(exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.(exclude_libs_test.syms, libexclude_libs_test_1.a,libexclude_libs_test_2.a): New rules.* testsuite/Makefile.in: Regenerate.* testsuite/exclude_libs_test.c: New file.* testsuite/exclude_libs_test.sh: Ditto.* testsuite/exclude_libs_test_1.c: Ditto.* testsuite/exclude_libs_test_2.c: Ditto.2009-05-15 Ian Lance Taylor <iant@google.com>* configure.ac: Check for declarations for cases where libiberty.hchecks HAVE_DECL_xxx.* configure, config.in: Rebuild.2009-05-15 Mikolaj Zalewski <mikolajz@google.com>* gold.h (Incremental_argument_list): Remove (invalid) forwarddeclaration.* incremental.cc (Incremental_inputs::report_achive): New method.(Incremental_inputs::report_object): New method.(Incremental_inputs::report_script): New method.(Incremental_inputs::finalize_inputs): New method.(Incremental_inputs::finalize): Call finalize_inputs().(Incremental_inputs::sized_create_incremental_inputs_section_data):Create inputs entries.* incremental.h (Incremental_input_type): New enum.(Incremental_inputs::Incremental_input): Initialize new fields.(Incremental_inputs::report_inputs): New method.(Incremental_inputs::report_achive): New method.(Incremental_inputs::report_object): New method.(Incremental_inputs::report_script): New method.(Incremental_inputs::finalize_inputs): New method.(Incremental_inputs::Input_info): New struct.(Incremental_inputs::Input_info_map): New typedef.(Incremental_inputs::lock_): New field.(Incremental_inputs::Inputs_): New field.(Incremental_inputs::Inputs_map): New field.* main.cc (main): Call Incremental_input::report_inputs.* options.h (Input_argument_list): Typedef moved fromInput_arguments.(Input_file_group::Files): Remove, use ::Input_argument_list.(Input_file_group::Input_argument_list): Remove, use::Input_argument_list.* plugin.cc (Plugin_manager::add_input_file): Add error inincremental build.* read_syms.cc (do_read_syms): Call Incremental_input::report_*functions.* script.cc (read_input_script): CallIncremental_input::report_script.* script.h (Script_info): New class.2009-04-27 Ian Lance Taylor <iant@google.com>* x86_64.cc (do_adjust_output_section): Set entsize toplt_entry_size.2009-04-23 Elliott Hughes <enh@google.com>* output.cc (Output_file::close): After short writes, continuewriting from the correct offset in the buffer being written.2009-04-23 Chris Demetriou <cgd@google.com>* configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.* configure: Regenerate.* config.in: Regenerate.* gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_setif HAVE_TR1_UNORDERED_MAP_REHASH is not defined.2009-04-21 Mikolaj Zalewski <mikolajz@google.com>* incremental.cc (Incremental_inputs_header_data): Renamed fromIncremental_input_header_data.(Incremental_inputs_header_data::data_size): New field.(Incremental_inputs_header_data::put_input_file_count): Renamedfrom input_file_count.(Incremental_inputs_header_data::put_command_line_offset): Renamedfrom command_line_offset.(Incremental_inputs_header_data::put_reserved): Renamed fromput_reserved.(Incremental_inputs_entry_data): Renamed fromIncremental_input_entry_data.(Incremental_inputs_entry_data::data_size): New field.(Incremental_inputs::report_command_line): New method.(Incremental_inputs::finalize): New method.(Incremental_inputs::create_incremental_inputs_data): New method.(Incremental_inputs::sized_create_incremental_inputs_data): New method.* incremental.h: New file.* layout.cc (Layout::Layout): Handle new incremental_inputs_.(Layout::finalize): Create incremental inputs section inincremental builds.(Layout::create_incremental_info_sections): New method.* layout.h (Layout::incremental_inputs): New method.(Layout::create_incremental_info_sections): New method.(Layout::incremental_inputs_): New field.* main.cc (main): Notify Incremental_input of the command line.2009-04-01 Ian Lance Taylor <iant@google.com>Mikolaj Zalewski <mikolajz@google.com>* gold.h (reserve_unordered_map): Define, three versions, one foreach version of Unordered_map.* layout.cc (Layout::Layout): Remove options parameter. Addnumber_of_input_files parameter. Don't initialize options_.Initialize number_of_input_files_ and resized_signatures_. Movesections_are_attached_.(Layout::layout_group): Reserve space for group_signatures_.(Layout::find_or_add_kept_section): Change name parameter to be areference. Resize signatures_ map when it gets large enough.(Layout::layout_eh_frame): Use parameters->options() instead ofthis->options_.(Layout::make_output_section): Likewise.(Layout::attach_allocated_section_to_segment): Likewise.(Layout::finalize, Layout::create_executable_stack): Likewise.(Layout::set_segment_offsets, Layout::create_interp): Likewise.(Layout::finish_dynamic_section, Layout::write_binary): Likewise.* layout.h (class Layout): Update declarations. Remove options_field. Add number_of_input_files_ and resized_signatures_fields. Move sections_are_attached_ field.* main.cc (main): Pass number of input files to Layoutconstructor. Don't pass options.2009-03-30 Ian Lance Taylor <iant@google.com>* ffsll.c (ffsll): Correct implementation.2009-03-27 Ian Lance Taylor <iant@google.com>* ffsll.c: New file.* configure.ac: Call AC_REPLACE_FUNCS on ffsll.* gold.h (ffsll): Declare if HAVE_FFSLL is not defined.* ftruncate.c (ftruncate): Declare before definition.* mremap.c (mremap): Likewise.* pread.c (pread): Likewise.* configure, Makefile.in, config.in: Rebuild.* mremap.c: New file.* configure.ac: Call AC_REPLACE_FUNCS on mremap.* gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.(mremap): Declare if HAVE_MREMAP is not defined.* configure, Makefile.in, config.in: Rebuild.2009-03-27 Cary Coutant <ccoutant@google.com>* powerpc.cc (Target_powerpc::check_non_pic): Assert that output isposition independent.* sparc.cc (Target_sparc::check_non_pic): Likewise.* x86_64.cc (Target_x86_64::check_non_pic): Likewise.2009-03-24 Cary Coutant <ccoutant@google.com>* symtab.h (needs_plt_entry): Check for unsatisfied reference froman executable.(needs_dynamic_reloc): Likewise.2009-03-24 Ian Lance Taylor <iant@google.com>* yyscript.y (file_cmd): Recognize EXTERN.(extern_name_list, extern_name_list_body): New nonterminals.* script.cc (script_add_extern): Define.* script-c.h (script_add_extern): Declare.2009-03-24 Rafael Avila de Espindola <espindola@google.com>* object.cc (is_elf_object): Define.* object.h (is_elf_object): Declare.* archive.cc (Archive::get_elf_object_for_member): Callis_elf_object.* readsyms.cc (Read_symbols::do_read_symbols): Likewise.2009-03-24 Elliott Hughes <enh@google.com>* output.cc (Output_file::map_anonymous): Define.(Output_file::map): Use map_anonymous. If the regular mmap fails,try an anonymous one. Report the size if the mmap fails.* output.h (class Output_file): Declare map_anonymous.2009-03-24 Ian Lance Taylor <iant@google.com>* target-select.cc (instantiate_target): Don't acquire the lock ifthe instantiated_target_ field has already been set.2009-03-23 Ian Lance Taylor <iant@google.com>* gold-threads.h (class Initialize_lock): Define.* gold-threads.cc (class Initialize_lock_once): Define.(initialize_lock_control): New static variable.(initialize_lock_pointer): New static variable.(initialize_lock_once): New static function.(Initialize_lock::Initialize_lock): Define.(Initialize_lock::initialize): Define.* target-select.h: Include "gold-threads.h".(class Target_selector): Add lock_ and initialize_lock_ fields.Don't define instantiate_target, just declare it.* target-select.cc (Target_selector::Target_selector): Initializenew fields.(Target_selector::instantiate_target): Define.* descriptors.h: Include "gold-threads.h".(class Descriptors): Add initialize_lock_ field.* descriptors.cc (Descriptors::Descriptors): Initialize newfield.(Descriptors::open): Use initialize_lock_ field* errors.h (class Errors): Add initialize_lock_ field.* errors.cc (Errors::Errors): Initialize new field.(Errors::initialize_lock): Use initialize_lock_ field.* powerpc.cc (class Target_selector_powerpc): Removeinstantiated_target_ field. In do_recognize callinstantiate_target rather than do_instantiate_target. Indo_instantiate_target just allocate a new target.* sparc.cc (class Target_selector_sparc): Likewise.* freebsd.h: New file.* i386.cc: Include "freebsd.h".(Target_i386): Derive from Target_freebsd rather thanSized_target.(Target_selector_i386): Derive from Target_selector_freebsd ratherthan Target_selector.* x86_64.cc: Include "freebsd.h".(Target_x86_64): Derive from Target_freebsd rather thanSized_target.(Target_selector_x86_64): Derive from Target_selector_freebsdrather than Target_selector.* target.h (class Target): Add adjust_elf_header anddo_adjust_elf_header.* output.cc (Output_file_header:: do_sized_write): Call targetadjust_elf_header routine.* configure.tgt: Set targ_osabi.* configure.ac: Define GOLD_DEFAULT_OSABI.* parameters.cc (Parameters::default_target): PassGOLD_DEFAULT_OSABI to select_target.* target-select.h (class Target_selector): Make instantiate_targetprotected rather than private.* Makefile.am (HFILES): Add freebsd.h.* configure, Makefile.in, config.in: Rebuild.* merge.cc (do_add_input_section): Correct pend value. Changemessage about last entry not being null terminated from error towarning.2009-03-20 Mikolaj Zalewski <mikolajz@google.com>* incremental.cc: New file.* Makefile.am (CCFILES): Add incremental.cc.* Makefile.in: Rebuild.2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>* layout.cc (Layout::output_section_name): Preserve namesof '.note.' sections.2009-03-19 Ian Lance Taylor <iant@google.com>* descriptors.cc (Descriptors::open): Check that the options arevalid before using them.2009-03-18 Ian Lance Taylor <iant@google.com>* script-sections.h: Include <list>.(class Script_sections): Change Sections_elements from std::vectorto std::list. Typedef public Elements_iterator. Addorphan_section_placement_, data_segment_align_start_, andsaw_data_segment_align_ fields. Remove data_segment_align_index_field.* script-sections.cc (class Orphan_section_placement): New class.(class Sections_element): Add virtual functions is_relro andorphan_section_init. Remove virtual function place_orphan_here.(class Output_section_definition): Add is_relro andorphan_section_init. Remove place_orphan_here.(class Orphan_output_section): Likewise.(Script_sections::Script_sections): Update for field changes.(Script_sections::data_segment_align): Set saw_data_segment_align_and data_segment_align_start_, not data_segment_align_index.(Script_sections::data_segment_relro_end): Checksaw_data_segment_align_. Use data_segment_align_start_ ratherthan data_segment_align_index_.(Script_sections::place_orphan): Rewrite to useOrphan_section_placement.2009-03-17 Ian Lance Taylor <iant@google.com>* archive.cc (Archive::add_symbols): Check for a version attachedto the symbol name in the archive map.* testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.(ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.(ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.(ver_test_11.a): New target.* testsuite/Makefile.in: Rebuild.* configure.ac: Check for chsize and posix_fallocate. Replaceftruncate.* ftruncate.c: New file, from gnulib.* output.cc (posix_fallocate): Define dummy version if notHAVE_POSIX_FALLOCATE.(Output_file::map): Call posix_fallocate rather than lseek andwrite.* gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.* configure, Makefile.in, config.in: Rebuild.2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>* layout.h (Layout::create_note): Add section_name parameter.* layout.cc (Layout::create_note): Likewise.(Layout::create_build_id, Layout::create_gold_note): Fix callers.2009-03-17 Ian Lance Taylor <iant@google.com>* descriptors.cc: Include "options.h".(FD_CLOEXEC, O_CLOEXEC): Define if not defined.(Descriptors::open): Always use O_CLOEXEC when opening a newdescriptor. If we have a plugin, and O_CLOEXEC was not defined,then set FD_CLOEXEC.* sparc.cc (class Target_sparc): Add has_got_section.(Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,make sure we have a GOT section.* sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.(Target_sparc::Scan::local): Likewise.(Target_sparc::Scan::global): Likewise.(Target_sparc::Relocate::relocate): Likewise.(Target_sparc::Relocate::relocate_tls): Likewise.* symtab.cc (Symbol_table::define_default_version): New function,broken out of add_from_object.(Symbol_table::add_from_object): Call define_default_version.(Symbol_table::define_special_symbol): Add resolve_oldsymparameter. Change all callers. If the version for a symbol comesfrom a version script, resolve it with the symbol with the samename with no version. Also add the symbol without a version ifappropriate.(do_define_in_output_data): If resolving with oldsym, don't deletesym.(do_define_in_output_segment): Likewise.(do_define_as_constant): Likewise.* symtab.h (class Symbol_table): Update declarations.2009-03-13 Ian Lance Taylor <iant@google.com>* readsyms.cc (Read_symbols::incompatible_warning): New function.(Read_symbols::requeue): New function.(Read_symbols::do_read_symbols): If make_elf_object fails becausethe target type is not configured, and the file was searched for,issue a warning and retry with the next directory.(Add_symbols::run): If the file has an incompatible format, andit was searched for, requeue the Read_symbols task. On error,release the object.* readsyms.h (class Read_symbols): Add dirindex_ field. Adddirindex parameter to constructor. Change all callers. Declareincompatible_warning and requeue.(class Add_symbols): Add dirpath_, dirindex_, mapfile_,input_argument_ and input_group_ fields. Add them toconstructor. Change all callers.(class Read_script): Add dirindex_ field. Add it to constructor.Change all callers.* archive.cc (Archive::setup): Remove input_objects parameter.Change all callers.(Archive::get_file_and_offset): Likewise.(Archive::read_all_symbols): Likewise.(Archive::read_symbols): Likewise.(Archive::get_elf_object_for_member): Remove input_objectsparameter. Add punconfigured parameter. Change all callers.(Archive::add_symbols): Change return type to bool. Check returnvalue of include_member.(Archive::include_all_members): Likewise.(Archive::include_member): Change return type to bool. Returnfalse if first included object has incompatible target. Setincluded_member_ field.(Add_archive_symbols::run): If add_symbols returns false, requeueRead_symbols task.* archive.h (class Archive): Add included_member_ field.Initialize it in constructor. Add input_file and searched_formethods. Update declarations.(class Add_archive_symbols): Add dirpath_, dirindex_, andinput_argument_ fields. Add them to constructor. Change allcallers.* script.cc: Include "target-select.h".(class Parser_closure): Add skip_on_incompatible_target_ andfound_incompatible_target_ fields. Addskip_on_incompatible_target parameter to constructor. Change allcallers. Add methods skip_on_incompatible_target,clear_skip_on_incompatible_target, found_incompatible_target, andset_found_incompatible_target.(read_input_script): Add dirindex parameter. Change all callers.If parser finds an incompatible target, requeue Read_symbolstask.(script_set_symbol): Clear skip_on_incompatible_target inclosure.(script_add_assertion, script_parse_option): Likewise.(script_start_sections, script_add_phdr): Likewise.(script_check_output_format): New function.* script.h (read_input_script): Update declaration.* script-c.h (script_check_output_format): Declare.* yyscript.y (file_cmd): Handle OUTPUT_FORMAT.(ignore_cmd): Remove OUTPUT_FORMAT.* fileread.cc (Input_file::Input_file): Add explicit this.(Input_file::will_search_for): New function.(Input_file::open): Add pindex parameter. Change all callers.* fileread.h (class Input_file): Add input_file_argument method.Declare will_search_for. Update declarations.* object.cc (make_elf_object): Add punconfigured parameter.Change all callers.* object.h (class Object): Make input_file public. Addsearched_for method.(make_elf_object): Update declaration.* dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it torestart search.* dirsearch.h (class Dirsearch): Update declaration.* options.h (class General_options): Add --warn-search-mismatch.* parameters.cc (Parameters::is_compatible_target): New function.* parameters.h (class Parameters): Declare is_compatible_target.* workqueue.cc (Workqueue::add_blocker): New function.* workqueue.h (class Workqueue): Declare add_blocker.* fileread.cc (Input_file::open): Remove options parameter.Change all callers.(Input_file::open_binary): Likewise.* script.cc (read_input_script): Likewise.* readsyms.h (class Read_symbols): Remove options_ field. Removeoptions parameter from constructor. Change all callers.(class Read_script): Likewise.* fileread.h (class Input_file): Update declarations.* script.h (read_input_script): Update declaration.2009-03-10 Nick Clifton <nickc@redhat.com>* po/es.po: New Spanish translation.2009-03-06 Cary Coutant <ccoutant@google.com>* options.cc (parse_short_option): Keep dash_z from registering itself.2009-03-03 Ian Lance Taylor <iant@google.com>PR 9918* target-reloc.h (relocate_section): Pass output_section torelocate.* i386.cc (Target_i386::should_apply_static_reloc): Addoutput_section parameter. Change all callers.(Target_i386::Relocate::relocate): Add output_section parameter.* x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.* sparc.cc (Target_sparc::Relocate::relocate): Likewise.* powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.* testsuite/two_file_shared.sh: New script.* testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.(check_DATA): Add two_file_shared.dbg.(two_file_shared.dbg): New target.* testsuite/Makefile.in: Rebuild.2009-03-01 Ian Lance Taylor <iant@google.com>* configure.ac: Check for byteswap.h.* configure: Rebuild.* config.in: Rebuild.2009-03-01 Mikolaj Zalewski <mikolajz@google.com>* layout.cc (Layout::find_or_add_kept_section): New function.(Layout::add_comdat): Removed.* layout.h (struct Kept_section): Move out of class Layout.Remove trailing underscores from field names. Add group_sectionsfield. Rename group_ field to is_group. Change all uses.(class Layout): Declare find_or_add_kept_section, not add_comdat.* object.cc (Sized_relobj::Sized_relobj): Don't initializecomdat_groups_ field.(Sized_relobj::include_section_group): Usefind_or_add_kept_section and Kept_section::group_sections.(Sized_relobj::include_linkonce_section): Likewise.* object.cc (class Sized_relobj): Don't define Comdat_group orComdat_group_table. Remove find_comdat_group andadd_comdat_group. Remove comdat_groups_ field.* plugin.cc (include_comdat_group): UseLayout::find_or_add_kept_section.2009-02-28 Ian Lance Taylor <iant@google.com>* README: --gc-sections and map files are now supported. Documentsome build requirements.PR 6992* symtab.cc (Symbol_table::sized_write_section_symbol): In arelocatable link set the value of the section symbol to zero.* object.cc (Sized_relobj::do_finalize_local_symbols): In arelocatable link don't include the section address in the localsymbol value.2009-02-27 Ian Lance Taylor <iant@google.com>PR 6811* options.h (class Search_directory): Add is_system_directory.(class General_options): Declare is_in_system_directory.* options.cc (get_relative_sysroot): Make static.(get_default_sysroot): Make static.(General_optoins::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.* object.h (class Object): Add is_in_system_directory.(class Input_objects): Remove system_library_directory_ field.* object.cc (Input_objects::add_object): Don't setsystem_library_directory_.(input_objects::found_in_system_library_directory): Remove.* symtab.cc (Symbol_table::write_globals): Remove input_objectsparameter. Change all callers.(Symbol_table::sized_write_globals): Likewise.(Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.Call Object::is_in_system_directory.* symtab.h (class Symbol_table): Update declarations.PR 5990* descriptors.h (Open_descriptor): Add is_on_stack field.* descriptors.cc (Descriptors::open): If the descriptor is on thetop of the stack, remove it. Initialize is_on_stack field.(Descriptors::release): Only add pod to stack if it is not on thestack already.(Descriptors::close_some_descriptor): Clear stack_next andis_on_stack fields.PR 7091* output.cc (Output_section::find_starting_output_address): Renamefrom starting_output_address; add PADDR parameter; change returntype.* output.h (class Output_section): Declarefind_starting_output_address instead of starting_output_address.* object.cc (Sized_relobj::do_finalize_local_symbols): Handle asection symbol for which we can't find a merge section.PR 9836* symtab.cc (Symbol_table::add_from_object): If the visibility ishidden or internal, force the symbol to be local.* resolve.cc (Symbol::override_visibility): Define.(Symbol::override_base): Use override_visibility.(Symbol_table::resolve): Likewise.(Symbol::override_base_with_special): Likewise.(Symbol_table::override_with_special): If the visibility is hiddenor internal, force the symbol to be local.* symtab.h (class Symbol): Add set_visibility andoverride_visibility.* testsuite/ver_test_1.sh: New file.* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.(check_DATA): Add ver_test_1.syms.(ver_test_1.syms): New target.* testsuite/Makefile.in: Rebuild.2009-02-25 Cary Coutant <ccoutant@google.com>* layout.cc (Layout::choose_output_section): Don't rename sectionswhen using a linker script that has a SECTIONS clause.* Makefile.in: Regenerate.* testsuite/Makefile.am (script_test_5.sh): New test case.* testsuite/Makefile.in: Regenerate.* testsuite/script_test_5.cc: New file.* testsuite/script_test_5.sh: New file.* testsuite/script_test_5.t: New file.2009-02-13 Rafael Avila de Espindola <espindola@google.com>* archive.cc (Archive::include_member): Update calls to add_symbols.* dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Addthe Layout argument.* dynobj.h (do_add_symbols): Add the Layout argument.* object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add theLayout argument.* object.h (Object::add_symbols): Add the Layout argument.(Object::do_add_symbols): Add the Layout argument.(Sized_relobj::do_add_symbols): Add the Layout argument.* plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):Unify the two versions.(Add_plugin_symbols): Remove.* plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.(Sized_pluginobj::do_add_symbols): Unify the two versions.(Add_plugin_symbols): Remove.* readsyms.cc (Read_symbols::do_read_symbols): Update call toAdd_symbols. Use Add_symbols instead of Add_plugin_symbols.(Add_symbols::run): Make it work with Pulginobj.2009-02-06 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj::do_layout): Make info message startwith lower case letter.2009-02-06 Mikolaj Zalewski <mikolajz@google.com>* binary.cc: Fix file comment.* options.h (enum Incremental_disposition): Define.(class General_options): Add new options: --incremental,--incremental_changed, --incremental_unchanged,--incremental_unknown. Add incremental_disposition_ andimplicit_incremental_ fields.(General_options::incremental_disposition): New function.(class Position_dependent_options): Add incremental_dispositionoption.(Position_dependent_options::copy_from_options): Set incrementaldispositions.* options.cc (General_options::parse_incremental_changed): Newfunction.(General_options::parse_incremental_unchanged): New function.(General_options::parse_incremental_unknown): New function.(General_options::General_options): Initialize new fieldsincremental_disposition_ and implicit_incremental_.(General_options::finalize): Check for uasge of --incremental-*without --incremental.2009-02-06 Chris Demetriou <cgd@google.com>* gold.h (gold_undefined_symbol): Change to take only a Symbolpointer and to report location as the file name associated withthe symbol.(gold_undefined_symbol_at_location): New function to replace theold gold_undefined_symbol functionality.* target-reloc.h (relocate_section): Update to usegold_undefined_symbol_at_location.* symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):Call gold_undefined_symbol function rather than gold_error.* errors.h (Errors::undefined_symbol): Take location as astring, rather than calculating it from a relocation.* errors.cc (Errors::fatal): Print "fatal error:" before theformatted message.(Errors::error, Errors::error_at_location): Print "error: "before the formatted message.(Errors::undefined_symbol): Take location as a string, ratherthan calculating it from a relocation.(gold_undefined_symbol_at_location): New function akin toold gold_undefined_symbol, calculates location from relocation.(gold_undefined_symbol): Change to take only a Symbol pointerand to report location as the file name associated with the symbol.* testsuite/debug_msg.sh: Update for changed error messages.* testsuite/undef_symbol.sh: Likewise.2009-02-04 Duncan Sands <baldrick@free.fr>PR 9812* reduced_debug_output.h(Output_reduced_debug_abbrev_section::failed): Use format forgold_warning.(Output_reduced_debug_info_section::faild): Likewise.2009-01-31 Mikolaj Zalewski <mikolajz@google.com>* script.cc (Lazy_demangler): New class.(Version_script_info::get_symbol_version_helper): Demangle asymbol only once.2009-01-29 Cary Coutant <ccoutant@google.com>* i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC callsto __tls_get_addr.* x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.2009-01-28 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Bump to 1.9.* gold.h: Include <cstring> and <stdint.h>.* version.cc: Include <cstdio>.* object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid awarning.* reduced_debug_output.cc (insert_into_vector): Rename fromInsert_into_vector; change all callers. Use Swap_unaligned toavoid aliasing issue; remove union since it is unnecessary.2009-01-27 Sriraman Tallam <tmsriram@google.com>* Makefile.am (CCFILES): Add gc.cc.(HFILES): Add gc.h.* Makefile.in: Regenerate.* gold.cc (Gc_runner): New class.(queue_initial_tasks): Call garbage collection related taskswhen corresponding options are invoked.(queue_middle_gc_tasks): New function.(queue_middle_tasks): Reorder tasks to allow relocs to be read andprocessed early before laying out sections during garbage collection.* gold.h (queue_middle_gc_tasks): New function.(is_prefix_of): Move from "layout.cc".* i386.cc (Target_i386::gc_process_relocs): New function.* layout.cc (is_prefix_of): Remove. Move to "gold.h"* main.cc (main): Create object of class "Garbage_collection".* object.cc (Relobj::copy_symbols_data): New function.(Relobj::is_section_name_included): New function.(Sized_relobj::do_layout): Allow this function to be called twiceduring garbage collection and defer layout of section during thefirst call.* object.h (Relobj::get_symbols_data): New function.(Relobj::is_section_name_included): New function.(Relobj::copy_symbols_data): New function.(Relobj::set_symbols_data): New function.(Relobj::get_relocs_data): New function.(Relobj::set_relocs_data): New function.(Relobj::is_output_section_offset_invalid): New pure virtual function.(Relobj::gc_process_relocs): New function.(Relobj::do_gc_process_relocs): New pure virtual function.(Relobj::sd_): New data member.(Sized_relobj::is_output_section_offset_invalid): New function.(Sized_relobj::do_gc_process_relocs): New function.* options.h (General_options::gc_sections): Modify to not be a no-op.(General_options::print_gc_sections): New option.* plugin.cc (Plugin_finish::run): Remove function call toPlugin_manager::layout_deferred_objects. Move it to "gold.cc".* powerpc.cc (Target_powerpc::gc_process_relocs): New function.* reloc.cc (Read_relocs::run): Add task to process relocs anddetermine unreferenced sections when doing garbage collection.(Gc_process_relocs): New class.(Sized_relobj::do_gc_process_relocs): New function.(Sized_relobj::do_scan_relocs): Don't try to scan the relocs forsections that are garbage collected.* reloc.h (Gc_process_relocs): New class.* sparc.cc (Target_sparc::gc_process_relocs): New function.* symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries forsymbols whose corresponding sections are garbage collected.(Symbol_table::Symbol_table): Add new parameter for the garbagecollection object.(Symbol_table::gc_mark_undef_symbols): New function.(Symbol_table::gc_mark_symbol_for_shlib): New function.(Symbol_table::gc_mark_dyn_syms): New function.(Symbol_table::resolve): Do not treat symbols seen in dynamic objectsas garbage.(Symbol_table::add_from_object): Likewise.(Symbol_table::add_from_relobj): When building shared objects, do nottreat externally visible symbols as garbage.(Symbol_table::sized_finalize_symbol): Do not check dynamic symboltable information for static and relocatable links.* symtab.h (Symbol_table::set_gc): New function.(Symbol_table::gc): New function.(Symbol_table::gc_mark_undef_symbols): New function.(Symbol_table::gc_mark_symbol_for_shlib): New function.(Symbol_table::gc_mark_dyn_syms): New function.(Symbol_table::gc_): New data member.* target.h (Sized_target::gc_process_relocs): New pure virtualfunction.* x86_64.cc (Target_x86_64::gc_process_relocs): New function.* testsuite/testfile.cc (Target_test::gc_process_relocs): New function.2009-01-20 Chris Faylor <me.sourceware@sourceware.org>* options.h (General_options::gc_sections): Define as a no-op for now.(General_options::no_keep_memory): Ditto.(General_options::Bshareable): Define.* options.cc (General_options::finalize): Honor -Bshareable.2009-01-20 Andreas Schwab <schwab@suse.de>* powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try toread the value in the contents, since we don't use it. Use thetemplate endianness when writing.(Relocate::relocate): Use it for R_PPC_REL16_HA.2009-01-19 Andreas Schwab <schwab@suse.de>* configure.tgt (powerpc64-*): Fix targ_obj.2009-01-15 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj::write_local_symbols): Don't write outlocal symbols when stripping all symbols.2009-01-14 Cary Coutant <ccoutant@google.com>* output.cc (Output_reloc): Add explicit instantiations.2009-01-14 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::get_elf_object_for_member): Remove callto File_read::claim_for_plugin.* descriptors.cc (Descriptors::open): Remove reference tois_claimed.(Descriptors::claim_for_plugin): Remove.* descriptors.h (Descriptors::claim_for_plugin): Remove.(Descriptors::is_claimed): Remove.(claim_descriptor_for_plugin): Remove.* fileread.cc (File_read::claim_for_plugin): Remove.* fileread.h (File_read::claim_for_plugin): Remove.(File_read::descriptor): Reopen descriptor if necessary.* plugin.cc (Plugin::load): Add two new APIs to transfer vector.(Plugin_manager::all_symbols_read): Add task parameter. Changeall callers.(Plugin_manager::get_input_file): New function.(Plugin_manager::release_input_file): New function.(Pluginobj::Pluginobj): Add filesize parameter and initializecorresponding data member.(Sized_pluginobj::Sized_pluginobj): Add filesize parameterand pass to base constructor. Change all callers.(get_input_file, release_input_file): New functions.(make_sized_plugin_object): Add filesize parameter. Change all callers.* plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.(Plugin_manager::all_symbols_read): Add task parameter.(Plugin_manager::get_input_file): New function.(Plugin_manager::release_input_file): New function.(Plugin_manager::task_): New data member.(Pluginobj::Pluginobj): Add filesize parameter.(Pluginobj::filename): New function.(Pluginobj::descriptor): New function.(Pluginobj::filesize): New function.(Pluginobj::filesize_): New data member.(Sized_pluginobj::Sized_pluginobj): Add filesize parameter.* readsyms.cc (Read_symbols::do_read_symbols): Remove call toFile_read::claim_for_plugin; use Object::unlock to unlock the file.* testsuite/Makefile.am (plugin_test_4): New test case for pluginswith archive libraries.* testsuite/Makefile.in: Regenerate.* testsuite/plugin_test.c (struct sym_info): New type.(get_input_file, release_input_file): New static variables.(onload): Capture new transfer vector entries.(claim_file_hook): Stop reading at end of file according to filesize.Factor out parsing of readelf output into separate function.(all_symbols_read_hook): Exercise get_input_file and release_input_fileAPIs and get the source file name from the symbol table. Convertsource file name to corresponding object file name. Print infomessage when adding new input files.(parse_readelf_line): New function.* testsuite/plugin_test_1.sh: Add checks for new info messages.* testsuite/plugin_test_2.sh: Likewise.* testsuite/plugin_test_3.sh: Likewise.* testsuite/plugin_test_4.sh: New test case.2009-01-07 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Bump to 1.8.2008-12-23 Cary Coutant <ccoutant@google.com>* gold.cc (gold_exit): Call plugin cleanup handlers on exit.* plugin.cc (Plugin_manager::finish): Rename aslayout_deferred_objects. Move cleanup to separate function.(Plugin_manager::cleanup): New function.(Plugin_finish::run): Call layout_deferred_objects and cleanupseparately.* plugin.h (Plugin_manager::finish): Rename aslayout_deferred_objects.(Plugin_manager::cleanup): New function.(Plugin_manager::cleanup_done): New field.2008-12-23 Cary Coutant <ccoutant@google.com>* plugin.cc (is_visible_from_outside): New function.(Pluginobj::get_symbol_resolution_info): Call is_visible_from_outsideso we don't return "IR only" status for exported symbols or -r links.* testsuite/Makefile.am (plugin_test_3): New test case.* testsuite/Makefile.in: Regenerate.* testsuite/plugin_test_3.sh: New file.2008-12-22 Cary Coutant <ccoutant@google.com>* object.cc (Sized_relobj::layout_section): New function.(Sized_relobj::do_layout): Defer layout of input sections until afterplugin has provided replacement files.(Sized_relobj::do_layout_deferred_sections): New function.* object.h (Relobj::set_section_offset): Remove virtual keyword.(Relobj::layout_deferred_sections): New function.(Relobj::do_layout_deferred_sections): New function.(Sized_relobj::do_layout_deferred_sections): New function.(Sized_relobj::layout_section): New function.(Sized_relobj::Deferred_layout): New structure.(Sized_relobj::deferred_layout_): New field.* plugin.cc (Plugin_manager::finish): Renamed, was cleanup.Change all callers. Layout deferred sections.(class Plugin_finish): Renamed, was Plugin_cleanup. Change allreferences.(Plugin_hook::run): Move code from do_plugin_hook inline.(Plugin_hook::do_plugin_hook): Remove.* plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.(Plugin_manager::finish): Renamed, was cleanup.(Plugin_manager::should_defer_layout): New function.(Plugin_manager::add_deferred_layout_object): New function.(Plugin_manager::Deferred_layout_list): New type.(Plugin_manager::deferred_layout_objects_): New field.(Plugin_hook::do_plugin_hook): Remove.2008-12-17 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add --no case for--export-dynamic.2008-12-16 Cary Coutant <ccoutant@google.com>* plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfervector.(Plugin_manager::claim_file): Create plugin object even ifplugin did not call the add_symbols callback.(Plugin_obj::get_symbol_resolution_info): Guard against pluginasking for more symbols than were added.* testsuite/Makefile.am (plugin_test_1): Add test case withno global symbols.(empty.syms): New target.* testsuite/Makefile.in: Regenerate.* testsuite/plugin_test.c (claim_file_hook): Add new debugmessage. Don't call add_symbols if no globals.(all_symbols_read_hook): Don't provide replacement for emptyclaimed file.2008-12-12 Ian Lance Taylor <iant@google.com>* target-reloc.h (Default_scan_relocatable_relocs): Only discardr_type == 0 for a local symbol with r_sym == 0.(scan_relocatable_relocs): Pass r_sym tolocal_non_section_strategy.* reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Addr_sym parameter.* configure.ac: Update test for TLS descriptors: they aresupported as of glibc 2.9.* configure: Rebuild.2008-12-11 Ian Lance Taylor <iant@google.com>PR 7091* target-reloc.h (Default_scan_relocatable_relocs): For eachfunction, map r_type == 0 to RELOC_DISCARD.2008-12-10 Cary Coutant <ccoutant@google.com>* layout.cc (Layout::add_comdat): Allow COMDAT group from a replacementobject to override a kept COMDAT group from a plugin object.2008-12-09 Ian Lance Taylor <iant@google.com>PR 7088* yyscript.y (file_cmd): Handle INPUT.* testsuite/initpri1.c: Change all declarations to be fullprototypes by adding void, to avoid compiler warnings.2008-12-05 Rafael Avila de Espindola <espindola@google.com>* options.cc (General_options::parse_plugin_opt): New.(General_options::add_plugin): The argument now is just the filename.(General_options::add_plugin_option): New.* options.h (plugin_opt): New.(add_plugin): Change argument name.(add_plugin_option): New.* plugin.cc (Plugin::load): Don't parse the plugin option.* plugin.h (Plugin::Plugin): Rename argument. Init filename_.(Plugin::add_option): New.(Plugin::args_): Change type.(Plugin::filename_): New.(Plugin_manager::add_plugin_option): New.* testsuite/Makefile.am (plugin_test_1): Use new syntax.* testsuite/Makefile.in: Regenerate.2008-12-05 Cary Coutant <ccoutant@google.com>* layout.cc (Layout::include_section): Check for SHF_EXCLUDE.Handle --strip-lto-sections option.* options.h (strip_lto_sections): New option.2008-12-01 Cary Coutant <ccoutant@google.com>* plugin.cc (ld_plugin_message): Change format parameter to const.Fix mismatch between new[] and delete.2008-11-14 Cary Coutant <ccoutant@google.com>* reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_addressinstead of -1U.2008-11-05 Craig Silverstein <csilvers@google.com>* options.cc (General_options::parse_dynamic_list): New function.* options.h (General_options): New flags dynamic_list,dynamic_list_data, dynamic_list_cpp_new, anddynamic_list_cpp_typeinfo. New variable dynamic_list_.(General_options::in_dynamic_list): New function.* script.cc (Lex::Mode): New enum DYNAMIC_LIST.(Lex::can_start_name): Add support for DYNAMIC_LIST mode.(Lex::can_continue_name): Likewise.(yylex): Likewise.(read_script_file): New parameter script_options.(read_dynamic_list): New function.(Script_options::define_dynamic_list): New function.(dynamic_list_keyword_parsecodes): New variable.(dynamic_list_keywords): New variable.* script.h (Script_options::define_dynamic_list): New functionprototype.(read_dynamic_list): New function prototype.* symtab.cc (strprefix): New macro.(Symbol::should_add_dynsym_entry): Support dynamic_list,dynamic_list_data, dynamic_list_cpp_new, anddynamic_list_cpp_typeinfo.* yyscript.y (PARSING_DYNAMIC_LIST): New token.(dynamic_list_expr): New rule.(dynamic_list_nodes): Likewise.(dynamic_list_node): Likewise.* testsuite/Makefile.am (dynamic_list): New test.* testsuite/Makefile.in: Regenerated.* testsuite/dynamic_list.t: New file.* testsuite/dynamic_list.sh: New file.2008-11-05 Craig Silverstein <csilvers@google.com>* testsuite/tls_test_c.c: Add prototype for t11 and t11_last.* testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.(t11_last): Likewise.* testsuite/ver_test_6.c (main): Likewise.2008-10-07 Cary Coutant <ccoutant@google.com>* options.c (General_options::finalize): Add check for -static and-shared.* gold.cc (queue_middle_tasks): Assert that list of dynamic objectsis not empty.2008-10-02 Cary Coutant <ccoutant@google.com>* plugin.cc (make_sized_plugin_object): Fix conditionalcompilation to work when not all targets are enabled.2008-09-29 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::get_file_and_offset): Use filename insteadof name to get library path.(Archive::include_member): Unlock external member of a thin archive.* testsuite/Makefile.am (TEST_AR): New variable.(thin_archive_test_1): New test.(thin_archive_test_2): New test.* testsuite/Makefile.in: Regenerate.* testsuite/thin_archive_main.cc: New file.* testsuite/thin_archive_test_1.cc: New file.* testsuite/thin_archive_test_2.cc: New file.* testsuite/thin_archive_test_3.cc: New file.* testsuite/thin_archive_test_4.cc: New file.2008-09-29 Cary Coutant <ccoutant@google.com>* mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.* object.cc (Sized_relobj::do_layout): Use constant invalid_addressinstead of -1U.(Sized_relobj::do_finalize_local_symbols): Likewise.(Sized_relobj::map_to_kept_section): Likewise.* object.h (Sized_relobj::invalid_address): New constant.(Sized_relobj::do_output_section_offset): Check for invalid_addressand return -1ULL.* output.cc (Output_reloc::local_section_offset): Use constantinvalid_address instead of -1U.(Output_reloc::get_address): Likewise.(Output_section::output_address): Change -1U to -1ULL.* output.h (Output_reloc::invalid_address): New constant.* reloc.cc (Sized_relobj::write_sections): Use constantinvalid_address instead of -1U.(Sized_relobj::relocate_sections): Likewise.* symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbolvalues for merge sections.* target-reloc.h (relocate_for_relocatable): Use constantinvalid_address instead of -1U.2008-09-19 Cary Coutant <ccoutant@google.com>Add plugin functionality for link-time optimization (LTO).* configure.ac (plugins): Add --enable-plugins option.* configure: Regenerate.* config.in: Regenerate.* Makefile.am (LIBDL): New variable.(CCFILES): Add plugin.cc.(HFILES): Add plugin.h.(ldadd_var): Add LIBDL.* Makefile.in: Regenerate.* archive.cc: Include "plugin.h".(Archive::setup): Don't preread archive symbols when using a plugin.(Archive::get_file_and_offset): Add memsize parameter. Change callers.(Archive::get_elf_object_for_member): Call plugin hooks for claimingfiles.(Archive::include_member): Add symbols from plugin objects.* archive.h (Archive::get_file_and_offset): Add memsize parameter.* descriptors.cc (Descriptors::open): Check for file descriptorsabandoned by plugins.(Descriptors::claim_for_plugin): New function.* descriptors.h (Descriptors::claim_for_plugin): New function.(Open_descriptor::is_claimed): New field.(claim_descriptor_for_plugin): New function.* fileread.cc (File_read::claim_for_plugin): New function.* fileread.h (File_read::claim_for_plugin): New function.(File_read::descriptor): New function.* gold.cc: Include "plugin.h".(queue_initial_tasks): Add task to call plugin hooks for generatingnew object files.* main.cc: Include "plugin.h".(main): Load plugin libraries.* object.h (Pluginobj): Declare.(Object::pluginobj): New function.(Object::do_pluginobj): New function.(Object::set_target): New function.* options.cc: Include "plugin.h".(General_options::parse_plugin): New function.(General_options::General_options): Initialize plugins_ field.(General_options::add_plugin): New function.* options.h (Plugin_manager): Declare.(General_options): Add --plugin option.(General_options::has_plugins): New function.(General_options::plugins): New function.(General_options::add_plugin): New function.(General_options::plugins_): New field.* plugin.cc: New file.* plugin.h: New file.* readsyms.cc: Include "plugin.h".(Read_symbols::do_read_symbols): Check for archive before checkingfor ELF file. Call plugin hooks to claim files.* resolve.cc (Symbol_table::resolve): Record when symbol is referencedfrom a real object file; force override when processing replacementfiles.* symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.(Symbol::init_base_object): Likewise.(Symbol::init_base_output_data): Likewise.(Symbol::init_base_output_segment): Likewise.(Symbol::init_base_constant): Likewise.(Symbol::init_base_undefined): Likewise.(Symbol::output_section): Assert that object is not a plugin.(Symbol_table::add_from_pluginobj): New function.(Symbol_table::sized_finalize_symbol): Treat symbols from plugins asundefined.(Symbol_table::sized_write_globals): Likewise.(Symbol_table::add_from_pluginobj): Instantiate template.* symtab.h (Sized_pluginobj): Declare.(Symbol::in_real_elf): New function.(Symbol::set_in_real_elf): New function.(Symbol::in_real_elf_): New field.(Symbol_table::add_from_pluginobj): New function.* testsuite/Makefile.am (AM_CFLAGS): New variable.(LIBDL): New variable.(LDADD): Add LIBDL.(check_PROGRAMS): Add plugin_test_1 and plugin_test_2.(check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.(check_DATA): Add plugin_test_1.err and plugin_test_2.err.(MOSTLYCLEANFILES): Likewise.* testsuite/Makefile.in: Regenerate.* testsuite/plugin_test.c: New file.* testsuite/plugin_test_1.sh: New file.* testsuite/plugin_test_2.sh: New file.2008-09-16 Ian Lance Taylor <iant@google.com>* target-reloc.h (relocate_section): Check whether a symbol isdefined by the ABI before reporting an undefined symbol error.* target.h (Target::is_defined_by_abi): Make parameter const.(Target::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.* sparc.cc (Target_sparc::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.in: Rebuild.* fileread.cc (make_view): Add casts to avoid warning.2008-09-16 Alexandre Oliva <aoliva@redhat.com>* i386.cc (Target_i386::define_tls_base_symbol): Update comments.* x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.2008-09-16 Alexandre Oliva <aoliva@redhat.com>* options.h (General_options::output_is_executable): New.(General_options::output_is_pie): New.* i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_STARTfor shared libraries.* x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.2008-09-11 Chris Demetriou <cgd@google.com>* options.h (origin): New -z option.* layout.cc (Layout:finish_dynamic_section): If "-z origin"is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGINin DT_FLAGS_1.2008-09-05 Cary Coutant <ccoutant@google.com>* fileread.cc (File_read::make_view): Add check for attempt to mapbeyond end of file.2008-09-05 Cary Coutant <ccoutant@google.com>* symtab.cc (Symbol_table::add_from_dynobj): Fix typos inexplicit instantiations.2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>PR gold/6858* options.cc (General_options::finalize): Allow undefined symbolsin shlibs if linking -shared.PR gold/6859* symtab.cc (Symbol::init_base_undefined): Mark explicitly undefinedsymbols as not needing a dynsym entry.2008-08-20 Craig Silverstein <csilvers@google.com>* fileread.cc (File_read::open): Do not lock the file unless itwas successfully opened.2008-08-14 Cary Coutant <ccoutant@google.com>* x86_64.cc (Target_x86_64::Relocate::relocat_tls):Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.* testsuite/tls_test.cc (struct int128): 128-bit structfor testing TLS relocs with non-zero addend.(v12): New TLS variable.(t12): New test.(t_last): Add check for v12.* testsuite/tls_test.h (t12): New function.* testsuite/tls_test_main.cc (thread_routine): Call new test.2008-08-13 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::attach_allocated_section_to_segment): Don'tset tls_segment_ or relro_segment_.(Layout::make_output_segment): Set tls_segment_ and relro_segment_when appropriate.* output.h (Output_section::clear_is_relro): New function.* output.cc (Output_segment::add_output_section): Handle SHF_TLSsections specially even when output_data_ is empty.(Output_segment::maximum_alignment): When first section is relro,only force alignment for PT_LOAD segments.* script.cc (script_data_segment_align): New function.(script_data_segment_relro_end): New function.* script-c.h (script_data_segment_align): Declare.(script_data_segment_relro_end): Declare.* script-sections.h (class Script_sections): Declaredata_segment_align and data_segment_relro_end. Add fieldssegment_align_index_ and saw_relro_end_.* script-sections.cc (class Sections_element): Add set_is_relrovirtual function. Add new bool* parameter to place_orphan_here.Add get_output_section virtual function.(class Output_section_definition): Add set_is_relro. Add newbool* parameter to place_orphan_here. Add get_output_section.Add is_relro_ field.(Output_section_definition::Output_section_definition): Initializeevaluated_address_, evaluated_load_address, evaluated_addralign_,and is_relro_ fields.(Output_section_definition::place_orphan_here): Add is_relroparameter.(Output_section_definition::set_section_addresses): Set relro foroutput section.(Output_section_definition::alternate_constraint): Likewise.(class Orphan_output_section): Add new bool* parameter toplace_orphan_here. Add get_output_section.(Orphan_output_section::place_orphan_here): Add is_relroparameter.(Script_sections::Script_sections): Initializedata_segment_align_index_ and saw_relro_end_.(Script_sections::data_segment_align): New function.(Script_sections::data_segment_relro_end): New function.(Script_sections::place_orphan): Set or clear is_relro.(Script_sections::set_section_addresses): Force alignment of firstTLS section.* yyscript.y (exp): Call script_data_segment_align andscript_data_segment_relro_end.* testsuite/relro_script_test.t: New file.* testsuite/relro_test.cc (using_script): Declare.(t1, t2): Test using_script.* testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.(relro_script_test_SOURCES): Define.(relro_script_test_DEPENDENCIES): Define.(relro_script_test_LDFLAGS): Define.(relro_script_test_LDADD): Define.(relro_script_test.so): New target.* testsuite/Makefile.in: Rebuild.2008-08-06 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::total_archives, Archive::total_members)(Archive::total_members_loaded): New variables.(Archive::setup): Add parameter. Add option to prereadarchive symbols.(Archive::read_armap): Add counter.(Archive::get_file_and_offset): New function.(Archive::get_elf_object_for_member): New function.(Archive::read_all_symbols): New function.(Archive::read_symbols): New function.(Archive::add_symbols): Add counters.(Archive::include_all_members): Use armap to find members if it'salready built.(Archive::include_member): Skip reading symbols if already read.Factored code into Archive::get_file_and_offset andArchive::get_elf_object_for_member. Changed call toMapfile::report_include_archive_member.(Archive::print_stats): New function.* archive.h: Declare Object and Read_symbols_data classes.(Archive::Archive): Add initializers for new members.(Archive::setup): Add parameter.(Archive::print_stats): New function.(Archive::total_archives, Archive::total_members)(Archive::total_members_loaded): New variables.(Archive::get_file_and_offset): New function.(Archive::get_elf_object_for_member): New function.(Archive::read_all_symbols): New function.(Archive::read_symbols): New function.(Archive::Archive_member): New class.(Archive::members_): New member.(Archive::num_members_): New member.* main.cc: Include archive.h.(main): Call Archive::print_stats.* mapfile.cc (Mapfile::report_include_archive_member): Deletearchive parameter; member_name is now the fully-decorated name.* mapfile.h (Mapfile::report_include_archive_member): Likewise.* options.h: (General_options): Add --preread-archive-symbols option.* readsyms.cc (Read_symbols::do_read_symbols): Change call toArchive::setup.2008-08-04 Ian Lance Taylor <iant@google.com>* symtab.h (Symbol::use_plt_offset): New function.* i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.* powerpc.cc (Relocate::relocate): Likewise.* sparc.cc (Relocate::relocate): Likewise.* x86_64.cc (Relocate::relocate): Likewise.* testsuite/weak_plt.sh: New test.* testsuite/weak_plt_main.cc: New test.* testsuite/weak_plt_shared.cc: New test.* testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.(check_PROGRAMS): Add weak_plt.(check_DATA): Add weak_plt_shared.so.(weak_plt_main_pic.o, weak_plt): New targets.(weak_plt_shared_pic.o, weak_plt_shared.so): New targets.* testsuite/Makefile.in: Rebuild.* testsuite/Makefile.am (weak_alias_test_1.so): Depend upongcctestdir/ld.(weak_alias_test_2.so, weak_alias_test_4.so): Likewise.* testsuite/Makefile.in: Rebuild.2008-08-04 Alan Modra <amodra@bigpond.net.au>* Makefile.am (POTFILES.in): Set LC_ALL=C.* Makefile.in: Regenerate.* po/POTFILES.in: Regenerate.2008-07-29 Ian Lance Taylor <iant@google.com>* script.cc (Script_options::finalize_symbols): Finalize SECTIONSsymbols before other symbols.* testsuite/script_test_2.cc (test_addr): Declare.(test_addr_alias): Declare.(main): Check that test_addr and test_addr_alias have the rightvalues.* testsuite/script_test_2.t: Define test_addr_alias andtest_addr.2008-07-24 Ian Lance Taylor <iant@google.com>PR 5990* descriptors.cc: New file.* descriptors.h: New file.* gold-threads.h (class Hold_optional_lock): New class.* fileread.cc: Include "descriptors.h".(File_read::~File_read): Release descriptor rather than closingit.(File_read::open) [file]: Call open_descriptor rather than open.Set is_descriptor_opened_.(File_read::open) [memory]: Assert that descriptor is not open.(File_read::reopen_descriptor): New function.(File_read::release): Release descriptor.(File_read::do_read): Make non-const. Reopen descriptor.(File_read::read): Make non-const.(File_read::make_view): Reopen descriptor.(File_read::do_readv): Likewise.* fileread.h (class File_read): Add is_descriptor_opened_ field.Update declarations.* layout.cc: Include "descriptors.h".(Layout::create_build_id): Use open_descriptor rather than open.* output.cc: Include "descriptors.h".(Output_file::open): Use open_descriptor rather than open.* archive.cc (Archive::const_iterator): Change Archive to benon-const.(Archive::begin, Archive::end): Make non-const.(Archive::count_members): Likewise.* archive.h (class Archive): Update declarations.* object.h (Object::read): Make non-const.* Makefile.am (CCFILES): Add descriptors.cc.(HFILES): Add descriptors.h.* Makefile.in: Rebuild.PR 6716* gold.h: Always include <clocale>. Add Solaris workaroundsfollowing code in binutils/sysdep.h.PR 6048* ehframe.cc (Eh_frame::add_ehframe_input_section): Check whetherthis->eh_frame_hdr_ is NULL before using it.* dynobj.cc (Versions::Versions): Update comment.* dynobj.cc (Versions::Versions): If there is an soname, use it asthe base version name.* stringpool.cc (Stringpool_template::add_with_length): Set key toarray size plus one.(Stringpool_template::set_string_offsets): Subtract one from keybefore using it as an array index.(Stringpool_template::get_offset_with_length): Likewise.(Stringpool_template::write_to_buffer): Likewise.* stringpool.h (Stringpool_template::get_offset_from_key):Likewise.2008-07-23 Ian Lance Taylor <iant@google.com>PR 6658* object.h (Merged_symbol_value::value): Do our best to handle anegative addend.PR 6647* script.cc (Version_script_info::get_versions): Don't add emptyversion tag to return value.(Version_script_info::get_symbol_version_helper): Change returntype to bool. Add pversion parameter. Change all callers.(script_register_vers_node): Don't require a non-NULL tag.* script.h (class Version_script_info): Update declarations.(Version_script_info::get_symbol_version): Change return type tobool. Add version parameter. Change all callers.* symtab.cc (Sized_symbol::add_from_relobj): Rework versionhandling. Handle an empty version from a version script.(Symbol_table::define_special_symbol): Likewise.* testsuite/ver_test_10.script: New file.* testsuite/ver_test_10.sh: New file.* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.(check_DATA): Add ver_test_10.syms.(ver_test_10.syms, ver_test_10.so): New target.* testsuite/Makefile.in: Rebuild.2008-07-23 Simon Baldwin <simonb@google.com>* symtab.cc (Symbol_table::sized_write_symbol): Only set st_sizeto zero for undefined symbols from dynamic libraries.2008-07-23 Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::resolve): Remove version parameter.Change all callers.* symtab.h (class Symbol_table): Update declaration.* testsuite/ver_test_9.cc: New file.* testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.(ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.(ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.(ver_test_9.so, ver_test_9.o): New targets.* testsuite/Makefile.in: Rebuild.2008-07-22 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Define --check-sections.* layout.cc (Layout::set_segment_offsets): Handle--check-sections.* options.h (class General_options): Define -n/--nmagic and-N/--omagic.* options.cc (General_options::finalize): For -n/--nmagic or-N/--omagic, set -static.* layout.cc (Layout::attach_allocated_section_to_segment): If-N/--omagic, don't put read-only and read-write sections indifferent segments.(Layout::find_first_load_seg): If -N/--omagic, don't insist onfinding a read-only segment.(Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,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.* script-sections.cc (Script_sections::create_segments): If-n/--omagic, don't put read-only and read-write sections indifferent segments.* cref.cc: New file.* cref.h: New file.* options.h (class General_options): Add --print-symbol-counts.* main.cc (main): Issue defined symbol report if requested.* archive.cc (Archive::interpret_header): Make into a const memberfunction.(Archive::add_symbols): Call Input_objects::archive_start andarchive_stop.(Archive::const_iterator): Define new class.(Archive::begin, Archive::end): New functions.(Archive::include_all_members): Rewrite to use iterator.(Archive::count_members): New function.* archive.h (class Archive): Update declarations.(Archive::filename): New function.* object.cc: Include "cref.h".(Sized_relobj::Sized_relobj): Initialize defined_count_.(Sized_relobj::do_get_global_symbol_counts): New function.(Input_objects::add_object): Add object to cross-referencer.(Input_objects::archive_start): New function.(Input_objects::archive_stop): New function.(Input_objects::print_symbol_counts): New function.* object.h: Declare Cref and Archive.(Object::get_global_symbol_counts): New function.(Object::do_get_global_symbol_counts): New pure virtual function.(class Sized_relobj): Add defined_count_ field. Updatedeclarations.(class Input_objects): Add cref_ field. Update constructor.Update declarations.* dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ anddefined_count_.(Sized_dynobj::do_add_symbols): Allocate symbols_ if printingsymbol counts.(Sized_dynobj::do_get_global_symbol_counts): New function.* dynobj.h (class Sized_dynobj): Add fields symbols_ anddefined_count_. Update declarations. Define Symbols typedef.* symtab.cc (Symbol_table::add_from_relobj): Add definedparameter. Change all callers.(Symbol_table::add_from_dynobj): Add sympointers and definedparameters. Change all callers.* symtab.h (class Symbol_table): Update declarations.* Makefile.am (CCFILES): Add cref.cc.(HFILES): Add cref.h.* Makefile.in: Rebuild.2008-07-22 Simon Baldwin <simonb@google.com>* symtab.cc (Symbol_table::sized_write_symbol): Set symbol sizeto zero when writing undefined symbols.2008-07-22 Ian Lance Taylor <iant@google.com>* output.cc (Output_section::add_input_section): Don't try tomerge empty merge sections.2008-07-21 Craig Silverstein <csilvers@google.com>* symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):Include symbol version in error message.2008-07-20 Chris Demetriou <cgd@google.com>* configure.ac (gold_cv_c_random_seed): New configured variable.(RANDOM_SEED_CFLAGS): New substituted variable.* Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).* configure: Rebuild.* Makefile.in: Likewise.* testsuite/Makefile.in: Likewise.2008-07-18 Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::add_from_object): Rewrite the casewhere we see NAME/NULL and NAME/VERSION as separate symbols.* testsuite/ver_test_main.cc (main): Call t4.(t4, t4_2a): Define.* testsuite/ver_test_2.cc (t4_2): Define.* testsuite/ver_test_2.script: Put t4_2a in VER2.* testsuite/ver_test_4.cc (t4_2a): Define.* testsuite/ver_test_4.script: Put t4_2a in VER2.* testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.2008-07-17 Ian Lance Taylor <iant@google.com>* dynobj.cc (Versions::add_def): If we give an error about amissing version, go ahead and create the version anyhow.2008-07-10 Ian Lance Taylor <iant@google.com>Handle output sections with more than 0x7fffffff bytes.* object.h (class Relobj): Change map_to_output_ tooutput_sections_, and just keep a section pointer. Change alluses. Move comdat group support to Sized_relobj.(Relobj::is_section_specially_mapped): Remove.(Relobj::output_section): Remove poff parameter. Change allcallers.(Relobj::output_section_offset): New function.(Relobj::set_section_offset): Rewrite.(Relobj::map_to_output): Remove.(Relobj::output_sections): New function.(Relobj::do_output_section_offset): New pure virtual function.(Relobj::do_set_section_offset): Likewise.(class Sized_relobj): Add section_offsets_ field. Add comdatgroup support from Relobj. Update declarations.(Sized_relobj::get_output_section_offset): New function.(Sized_relobj::do_output_section_offset): New function.(Sized_relobj::do_set_section_offset): New function.* object.cc (Relobj::output_section_address): Remove.(Sized_relobj::Sized_relobj): Initialize new fields.(Sized_relobj::include_section_group): Cast find_kept_object toSized_relobj.(Sized_relobj::include_linkonce_section): Likewise.(Sized_relobj::do_layout): Use separate arrays for output sectionand output offset.(Sized_relobj::do_count_local_symbols): Change map_to_output tooutput_sections.(Sized_relobj::do_finalize_local_symbols): Change map_to_output tooutput_sections and section_offsets.(Sized_relobj::write_local_symbols): Likewise.(map_to_kept_section): Compute output address directly.* reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output tooutput_sections and section_offsets.(Sized_relobj::write_sections): Likewise.(Sized_relobj::relocate_sections): Likewise.* symtab.cc (sized_finalize_symbol): Use output_section_offset.* output.h (class Output_reloc): Update declarations. Changeu2_.relobj to Sized_relobj*.(class Output_data_reloc): Change add functions to useSized_relobj*.* output.cc (Output_reloc::Output_reloc): Change relobj toSized_relobj*.(Output_reloc::local_section_offset): Change return type toElf_Addr. Use get_output_section_offset.(Output_reloc::get_address): Likewise.(Output_section::is_input_address_mapped): Don't callis_section_specially_mapped.(Output_section::output_offset): Likewise.(Output_section::output_address): Likewise.(Output_section::starting_output_address): Likewise.* copy-relocs.cc (Copy_relocs::copy_reloc): Change objectparameter to Sized_relobj*.(Copy_relocs::need_copy_reloc): Likewise.(Copy_relocs::save): Likewise.* copy-relocs.h (class Copy_relocs): Update declarations.(class Copy_relocs::Copy_reloc_entry): Change constructor to useSized_relobj*. Change relobj_ field to Sized_relobj*.* target-reloc.h (relocate_for_relocatable): Changeoffset_in_output_section type to Elf_Addr. Change code that usesit as well.* layout.cc (Layout::layout): Always set *off.* mapfile.cc (Mapfile::print_input_section): Useoutput_section_offset.* i386.cc (Target_i386::copy_reloc): Change object parameter toSized_relobj*.* powerpc.cc (Target_powerpc::copy_reloc): Likewise.* sparc.cc (Target_sparc::copy_reloc): Likewise.* x86_64.cc (Target_x86_64::copy_reloc): Likewise.2008-07-03 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::include_section): Do not discard unrecognizedSHT_STRTAB sections.2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>* script.cc (Lex::can_continue_name): Make '?' allowable inversion-script names.* testsuite/version_script.map: Change glob pattern to use '?'2008-06-30 Manish Singh <yosh@gimp.org>PR 6585* symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):Correct typo.2008-06-30 Ian Lance Taylor <iant@google.com>PR 6660PR 6682* powerpc.cc (Powerpc_relocate_functions::addr16_ha) [bothversions]: Don't try to read the value in the contents, since wedon't use it. Use the template endianness when writing.2008-06-25 Cary Coutant <ccoutant@google.com>* fileread.cc (File_read::make_view): Assert on zero-length view.* object.cc (Sized_relobj::do_read_symbols): Don't try to readsymbol table when there are no symbols to read.2008-06-23 Craig Silverstein <csilvers@google.com>* version.cc (version_string): Bump to 1.72008-06-18 Craig Silverstein <csilvers@google.com>* powerpc.cc (Powerpc_relocate_functions::addr16_ha): castconstant 0xFFFF to type Valtype.(Powerpc_relocate_functions::rel16_ha): Likewise.2008-06-17 Ian Lance Taylor <iant@google.com>* output.h (Output_section::Input_section): Initialize p2align_ tozero for Output_section_data constructors.(Output_section::Input_section::addralign): If not an inputsection, return the alignment of the Output_section_data.* testsuite/copy_test.cc: New file.* testsuite/copy_test_1.cc: New file.* testsuite/copy_test_2.cc: New file.* testsuite/Makefile.am (check_PROGRAMS): Add copy_test.(copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.(copy_test_LDFLAGS, copy_test_LDADD): New variables.(copy_test_1_pic.o, copy_test_1.so): New targets.(copy_test_2_pic.o, copy_test_2.so): New targets.* testsuite/Makefile.in: Rebuild.* script-sections.cc (Script_sections::place_orphan): Initializelocal variable exact.2008-06-13 David Edelsohn <edelsohn@gnu.org>* powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.2008-06-12 David Edelsohn <edelsohn@gnu.org>David S. Miller <davem@davemloft.net>* powerpc.cc: New file.* Makefile.am (TARGETSOURCES): Add powerpc.cc(ALL_TARGETOBJS): Add powerpc.$(OBJEXT)* configure.tgt: Add entries for powerpc-* and powerpc64-*.* Makefile.in: Rebuild.2008-06-09 Ian Lance Taylor <iant@google.com>* testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and<exception>.(throwing, orig_terminate): New static variables.(terminate_handler): New static function.(t2): Set terminate handler.2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>PR 6584* binary.cc (Binary_to_elf::sized_convert): Fix .dataalignment.2008-05-30 Cary Coutant <ccoutant@google.com>* archive.cc (Archive::include_all_members) Correct to stepover symbol table and extended name table in thin archives.2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>PR 6407* target-reloc.h (relocate_for_relocatable): Fix new_offsetcalculation.2008-05-28 Caleb Howe <cshowe@google.com>* reduced_debug_output.cc: New file.* reduced_debug_output.h: New file.* options.h (class General_options): Add --strip-debug-non-line.* options.cc (General_options::finalize): Add strip_debug_non_lineto the strip heirarchy.* layout.h (class Layout): Add debug_abbrev_ and debug_info_fields.* layout.cc: Include "reduced_debug_output.h".(Layout::Layout): Initialize new fields.(line_only_debug_sections): New static array.(is_lines_only_debug_sections): New static inline function.(Layout::include_section): Handle --strip-debug-non-line.(Layout::make_output_section): If --strip-debug-non-line, buildnew output sections for .debug_abbrev and .debug_info.* dwarf_reader.cc (read_unsigned_LEB_128): Move to namespacegold. Warn about possible overflow.(read_signed_LEB_128): Likewise.* dwarf_reader.h: (read_unsigned_LEB_128): Declare.(read_signed_LEB_128): Declare.* Makefile.am (CCFILES): Add reduced_debug_output.cc.(HFILES): Add reduced_debug_output.h.* Makefile.in: Rebuild.2008-05-21 Ian Lance Taylor <iant@google.com>* mapfile.cc: New file.* mapfile.h: New file.* options.h (class General_options): Add -M/--print-map and -Map.* options.cc (General_options::finalize): Make -M equivalent to-Map -.* main.cc: Include <cstdio> and "mapfile.h".(main): Open mapfile if requested.* gold.cc (class Middle_runner): Add mapfile_ field. Updateconstructor. Change caller.(queue_initial_tasks): Add mapfile parameter. Change caller.(queue_middle_tasks): Likewise.* gold.h (queue_initial_tasks, queue_middle_tasks): Updatedeclarations.* archive.cc: Include "mapfile.h".(Archive::add_symbols): Add mapfile parameter. Change allcallers. Pass mapfile, symbol, and reason to include_member.(Archive::include_all_members): Add mapfile parameter. Change allcallers.(Archive::include_member): Add mapfile, sym, and why parameters.Change all callers. Report inclusion to map file.* archive.h: Include "fileread.h".(class Archive): Update declarations.(Archive::file): New const method.(class Add_archive_symbols): Add mapfile_ field. Updateconstructor. Change all callers.* readsyms.h (class Read_symbols): Likewise.(class Finish_group): Likewise.(class Read_script): Likewise.* common.cc: Include "mapfile.h".(Symbol_table::allocate_commons): Add mapfile parameter. Changeall callers.(Symbol_table::do_allocate_commons): Likewise.(Symbol_table::do_allocate_commons_list): Likewise. Report commonsymbol allocation to mapfile.* common.h (class Allocate_commons_task): Add mapfile_ field.Update constructor. Change all callers.* symtab.h (class Symbol_table): Update declarations.* layout.cc: Include "mapfile.h".(Layout_task_runner::run): Print information to mapfile.(Layout::create_gold_note): Change Output_data_fixed_space toOutput_data_zero_fill.(Layout::create_build_id): Likewise.(Layout::print_to_mapfile): New function.* layout.h (class Layout_task_runner): Add mapfile_ field. Updateconstructor. Change caller.(class Layout): Declare print_to_mapfile.* output.cc (Output_section::Input_section::print_to_mapfile): Newfunction.(Output_section::add_input_section): If producing a map, alwaysadd to input_sections_ list.(Output_section::do_print_to_mapfile): New function.(Output_segment::print_sections_to_mapfile): New function.(Output_segment::print_section_list_to_mapfile): New function.* output.h: Include "mapfile.h".(Output_data::print_to_mapfile): New function.(Output_data::do_print_to_mapfile): New virtual function.(Output_segment_headers::do_print_to_mapfile): New function.(Output_file_header::do_print_to_mapfile): New function.(Output_data_const::do_print_to_mapfile): New function.(class Output_data_const_buffer): Add map_name_ field. Updateconstructor. Change all callers. Add do_print_to_mapfilefunction.(class Output_data_fixed_space): Likewise.(class Output_data_space): Likewise.(class Output_data_zero_fill): New class.(Output_data_strtab::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_data_group::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_symtab_xindex::do_print_to_mapfile): New function.(class Output_section): Declare do_print_to_mapflie. Declareprint_to_mapfile in Input_section.(class Output_segment): Declare new functions.* object.h (Sized_relobj::symbol_count): New function.* script-sections.cc(Output_section_element_dot_assignment::set_section_addresses):Change Output_data_fixed_space to Output_data_zero_fill.(Output_data_expression::do_print_to_mapfile): New function.* script.cc (read_input_script): Add mapfile parameter. Changeall callers.* script.h (read_input_script): Update declaration.* ehframe.h (Eh_frame_hdr::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.(Output_merge_string::do_print_to_mapfile): New function.* i386.cc (Output_data_plt_i386::do_print_to_mapfile): Newfunction.* sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): Newfunction.* x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): Newfunction.* Makefile.am (CCFILES): Add mapfile.cc.(HFILES): Add mapfile.h.* Makefile.in: Rebuild.2008-05-19 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add -z relro.* layout.cc (Layout::Layout): Initialize relro_segment_.(Layout::add_output_section_data): Return the output section.(Layout::make_output_section): Rcognize relro sections and markthem appropriately.(Layout::attach_allocated_section_to_segment): Put relro sectionsin a PT_GNU_RELRO segment.(Layout::create_initial_dynamic_sections): Mark the .dynamicsection as relro.(Layout::segment_precedes): Sort PT_GNU_RELRO segments afterPT_TLS segments.(Layout::linkonce_mapping): Map d.rel.ro.local to.data.rel.ro.local.(Layout::output_section_name): Us .data.rel.ro.local for anysection which begins with that.* layout.h (class Layout): Update add_output_section_datadeclaration. Add relro_segment_ field.* output.cc (Output_section::Output_section): Initialize is_relro_and is_relro_local_ fields.(Output_segment::add_output_section): Group relro sections.(Output_segment::is_first_section_relro): New function.(Output_segment::maximum_alignment): If there is a relro section,align the segment to the common page size.(Output_segment::set_section_addresses): Track whether we arelooking at relro sections. If the last section is a relrosection, align to the common page size.(Output_segment::set_section_list_addresses): Add in_relroparameter. Change all callers. Align to the page size whenmoving from relro to non-relro section.(Output_segment::set_offset): Align memsz of a PT_GNU_RELROsegment.* output.h (class Output_section): Add is_relro_ andis_relro_local_ fields.(Output_section::is_relro): New function.(Output_section::set_is_relro): New function.(Output_section::is_relro_local): New function.(Output_section::set_is_relro_local): New function.(class Output_segment): Update declarations.* i386.cc (Target_i386::got_section): Mark .got section as relro.* sparc.cc (Target_sparc::got_section): Likewise.* x86_64.cc (Target_x86_64::got_section): Likewise.* testsuite/relro_test_main.cc: New file.* testsuite/relro_test.cc: New file.* testsuite/Makefile.am (check_PROGRAMS): Add relro_test.(relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.(relro_test_LDFLAGS, relro_test_LDADD): New variables.(relro_test.so, relro_test_pic.o): New targets.* testsuite/Makefile.in: Rebuild.2008-05-16 Ian Lance Taylor <iant@google.com>* output.cc (Output_segment::add_output_section): Remove frontparameter.* output.h (class Output_segment): Removeadd_initial_output_section and overloaded add_output_section.Update declaration of remaining add_output_section.* layout.cc (Layout::create_interp): Call add_output_sectionrather than add_initial_output_section.(Layout::finish_dynamic_section): Likewise.* i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic typefor TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if weknow the dynamic type.* x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_field. Initialize it in constructor.(Target_x86_64::Relocate::relocate_tls): Record that we saw a TLSblock reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS blockreloc.* output.cc (Output_reloc::get_address): Change return type toElf_Addr.* output.h (class Output_reloc): Update get_address declaration.* x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit typesfor section addresses.2008-05-09 Ian Lance Taylor <iant@google.com>PR 6493* gold.cc (gold_nomem): Use return value of write.2008-05-08 Ian Lance Taylor <iant@google.com>* symtab.c (Symbol::init_base_output_data): Add versionparameter. Change all callers.(Symbol::init_base_output_segment): Likewise.(Symbol::init_base_constant): Likewise.(Symbol::init_base_undefined): Likewise.(Sized_symbol::init_output_data): Likewise.(Sized_symbol::init_output_segment): Likewise.(Sized_symbol::init_constant): Likewise.(Sized_symbol::init_undefined): Likewise.(Symbol_table::do_define_in_output_data): If the new symbol has aversion, mark it as the default.(Symbol_table::do_define_in_output_segment): Likewise.(Symbol_table::do_define_as_constant): Likewise.* symtab.h (class Symbol): Update declarations.(class Sized_symbol): Likewise.* resolve.cc (Symbol::override_version): New function.(Symbol::override_base): Call override_version.(Symbol::override_base_with_special): Likewise.* testsuite/ver_script_8.script: New file.* testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.(ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.(ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.(ver_test_8_1.so, ver_test_8_2.so): New targets.2008-05-06 Ian Lance Taylor <iant@google.com>PR 6049* options.h (DEFINE_set): Add VARNAME_begin and VARNAME_endfunctions.(class General_options): Remove existing --undefined, and add--no-undefined instead. Add new --undefined as synonym for -u.* archive.cc (Archive::add_symbols): Check whether symbol wasnamed with -u.* gold.cc (queue_middle_tasks): Add -u symbols to symbol table.* symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; changeall uses. Add IS_UNDEFINED. Update declarations to splitdifferent versions of init_base. Declare init_base_undefined.(Symbol::is_defined): Handle IS_UNDEFINED.(Symbol::is_undefined): Likewise.(Symbol::is_weak_undefined): Call is_undefined.(Symbol::is_absolute): Handle IS_CONSTANT.(class Sized_symbol): Update declarations to split differentversions of init. Declare init_undefined.(class Symbol_table): Declare new functions.* symtab.cc (Symbol::init_base_object): Rename from init_base.Change all callers.(Symbol::init_base_output_data): Likewise.(Symbol::init_base_output_segment): Likewise.(Symbol::init_base_constant): Likewise.(Symbol::init_base_undefined): New function.(Sized_symbol::init_object): Rename from init. Change allcallers.(Sized_symbol::init_output_data): Likewise.(Sized_symbol::init_output_segment): Likewise.(Sized_symbol::init_constant): Likewise.(Sized_symbol::init_undefined): New function.(Symbol_table::add_undefined_symbols_from_command_line): Newfunction.(Symbol_table::do_add_undefined_symbols_from_command_line): Newfunction.(Symbol::final_value_is_known): Handle IS_UNDEFINED.(Symbol::output_section): Likewise.(Symbol::set_output_section): Likewise.(Symbol_table::sized_finalize_symbol): Likewise.(Symbol_table::sized_write_globals): Likewise.* resolve.cc (Symbol_table::should_override): Likewise.(Symbol::override_base_with_special): Likewise.* symtab.cc (Symbol_table::add_from_dynobj): If we see a protectedsymbol, change it to have default visibility.* testsuite/protected_1.cc: New file.* testsuite/protected_2.cc: New file.* testsuite/protected_3.cc: New file.* testsuite/protected_main_1.cc: New file.* testsuite/protected_main_2.cc: New file.* testsuite/protected_main_3.cc: New file.* testsuite/Makefile.am (check_PROGRAMS): Add protected_1.(protected_1_SOURCES, protected_1_DEPENDENCIES): Define.(protected_1_LDFLAGS, protected_1_LDADD): Define.(protected_1.so): New target.(protected_1_pic.o, protected_2_pic.o): New targets.(protected_3_pic.o): New target.(check_PROGRAMS): Add protected_2.(protected_2_SOURCES, protected_2_DEPENDENCIES): Define.(protected_2_LDFLAGS, protected_2_LDADD): Define.* testsuite/Makefile.in: Rebuild.* options.h (DEFINE_var): Add set_user_set_##varname__.(DEFINE_bool_alias): New macro.(class General_options): Define -Bstatic using DEFINE_bool_aliasrather than DEFINE_special. Add --undefined as an alias for -zdefs.* options.cc (General_options::parse_Bstatic): Remove.* options.h (class General_options): Add --fatal-warnings.* main.cc (main): Implement --fatal-warnings.* errors.h (Errors::warning_count): New function.* options.h (class General_options): Add -Bsymbolic-functions.* symtab.h (Symbol::is_preemptible): Check for-Bsymbolic-functions.2008-05-05 Ian Lance Taylor <iant@google.com>* options.h (DEFINE_bool): For DASH_Z, create the negative optionas noVARNAME rather than no-VARNAME.(class General_options): Add option -z combreloc.* output.h (class Output_reloc) [SHT_REL]: Declare compare andget_address.(Output_reloc::sort_before) [SHT_REL]: New function.(Output_reloc::sort_before) [SHT_RELA]: New function.(class Output_data_reloc_base): Add sort_relocs_ field. DefineSort_relocs_comparison.(Output_data_reloc_base::Output_data_reloc_base): Add sort_relocsparameter. Change all callers.(Output_data_reloc::Output_data_reloc) [both versions]: Addsort_relocs parameter. Change all callers.* output.cc (Output_reloc::get_address): New function, broken outof write_rel.(Output_reloc::write_rel): Call it.(Output_reloc::compare): New function.(Output_data_reloc_base::do_write): Optionally sort relocs.* configure.ac: If targ_extra_obj is set, link it in.* configure.tgt: Initialize all variables.(x86_64*): Set targ_extra_obj and targ_extra_size.* configure: Rebuild.* object.cc (Sized_relobj::include_section_group): Adjust sectionindexes read from group data. Build vector to pass tolayout_group.* layout.cc (Layout::layout_group): Add flags and shndxesparameters. Remove contents parameter. Change caller. Updateexplicit instantiations.* layout.h (class Layout): Update layout_group declaration.* output.cc (Output_data_group::Output_data_group): Add flags andinput_shndxes parameters. Remove contents parameter. Changecaller.(Output_data_group::do_write): Change input_sections_ toinput_shndxes_.* output.h (class Output_data_group): Update constructordeclaration. Rename input_sections_ to input_shndxes_.* testsuite/many_sections_test.cc: Add template.2008-04-30 Cary Coutant <ccoutant@google.com>* target-reloc.h (relocate_section): Fix dead-pointer bug.* layout.cc (Layout::include_section): Refactored check for debuginfo section.(Layout::add_comdat): Add new parameters. Change typeof signature parameter. Add object and shndx to signatures table.(Layout::find_kept_object): New function.* layout.h: Include <cstring>.(Layout::is_debug_info_section): New function.(Layout::add_comdat): Add new parameters.(Layout::find_kept_object): New function.(Layout::Kept_section): New struct.(Layout::Signatures): Change type of map range.* object.cc (Relobj::output_section_address): New function.(Sized_relobj::include_section_group): Add new parameters. Changecalls to Layout::add_comdat. Change to build table of kept comdatgroups and table mapping discarded sections to kept sections.(Sized_relobj::include_linkonce_section): Likewise. Add new parameter.(Sized_relobj::do_layout): Change calls to include_section_group andinclude_linkonce_section.(Sized_relobj::do_finalize_local_symbols): Do not set local symbolvalue to zero when section is discarded.(Sized_relobj::map_to_kept_section): New function.* object.h (Relobj::output_section_address): New function.(Relobj::Comdat_group): New type.(Relobj::find_comdat_group): New function.(Relobj::Comdat_group_table): New type.(Relobj::Kept_comdat_section): New type.(Relobj::Kept_comdat_section_table): New type.(Relobj::add_comdat_group): New function.(Relobj::set_kept_comdat_section): New function.(Relobj::get_kept_comdat_section): New function.(Relobj::comdat_groups_): New field.(Relobj::kept_comdat_sections_): New field.(Symbol_value::input_value): Update comment.(Sized_relobj::map_to_kept_section) New function.(Sized_relobj::include_linkonce_section): Add new parameter.* target-reloc.h (Comdat_behavior): New type.(get_comdat_behavior): New function.(relocate_section): Add code to map a discarded section to thecorresponding kept section when applying a relocation.2008-04-30 Craig Silverstein <csilvers@google.com>* dwarf_reader.cc (next_generation_count): New static var.(Addr2line_cache_entry): New struct.(addr2line_cache): New static var.(Dwarf_line_info::one_addr2line): Added caching.(Dwarf_line_info::clear_addr2line_cache): New function.* dwarf_reader.h (Dwarf_line_info::one_addr2line): Addcache-size parameter.(Dwarf_line_info::one_addr2line_cache): New function.* symtab.cc (Symbol_table::detect_odr_violations): Passnew cache-size argument to one_addr2line(), and clear cache.2008-04-28 Cary Coutant <ccoutant@google.com>* i386.cc (Relocate::relocate): Fix typos for R_386_PC16 andR_386_PC8 relocations.2008-04-23 Ian Lance Taylor <iant@google.com>* object.cc (Sized_relobj::include_section_group): Check forinvalid section group.* object.cc (make_elf_object): Correct test for 64-bit ELF fileheader size.* readsyms.cc (Read_symbols::do_read_symbols): Use get_view ratherthan read for file header.* archive.cc (Archive::include_member): Likewise.2008-04-23 Paolo Bonzini <bonzini@gnu.org>* aclocal.m4: Regenerate.* configure: Regenerate.2008-04-19 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Bump to 1.6.* testsuite/Makefile.am (many_sections_r_test): New target.(many_sections_r_test_SOURCES): Remove.(many_sections_r_test_DEPENDENCIES): Remove.(many_sections_r_test_LDFLAGS): Remove.(many_sections_r_test_LDADD): Remove.* object.cc (Sized_relobj::do_add_symbols): Always passlocal_symbol_count_ to add_from_relobj.* testsuite/Makefile.am (many_sections_check.h): Only check one inevery thousand variables.* testsuite/Makefile.in: Rebuild.* object.cc (Xindex::initialize_symtab_xindex): New function.(Xindex::read_symtab_xindex): New function.(Xindex::sym_xindex_to_shndx): New function.(Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section ifavailable.(Sized_relobj::do_initialize_xindex): New function.(Sized_relobj::do_read_symbols): Adjust section links.(Sized_relobj::symbol_section_and_value): Add is_ordinaryparameter. Change all callers.(Sized_relobj::include_section_group): Adjust section links andsymbol section indexes.(Sized_relobj::do_layout): Adjust section links.(Sized_relobj::do_count_local_symbols): Adjust section links andsymbol section indexes.(Sized_relobj::do_finalize_local_symbols): Distinguish betweenordinary and special symbols.(Sized_relobj::write_local_symbols): Add symtab_xindex anddynsym_xindex parameters. Change all callers. Adjust sectionlinks. Use SHN_XINDEX when needed.(Sized_relobj::get_symbol_location_info): Adjust section links.Don't get fooled by special symbols.* object.h (class Xindex): Define.(class Object): Add xindex_ parameter. Declare virtual functoindo_initialize_xindex.(Object::adjust_sym_shndx): New function.(Object::set_xindex): New protected function.(class Symbol_value): Add is_ordinary_shndx_ field.(Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.(Symbol_value::value): Assert ordinary section.(Symbol_value::initialize_input_to_output_map): Likewise.(Symbol_value::set_input_shndx): Add is_ordinary parameter.Change all callers.(Symbol_value::input_shndx): Add is_ordinary parameter. Changeall callers.(class Sized_relobj): Update declarations.(Sized_relobj::local_symbol_input_shndx): Add is_ordinaryparameter. Change all callers.(Sized_relobj::adjust_shndx): New function.* dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_field.(Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndxparameter. Change all callers. Pick up SHT_DYNSYM_SHNDX sectionfor SHT_DYNSYM section if available. Set dynsym_shndx_ field.(Sized_dynobj::read_dynsym_section): Adjust section links.(Sized_dynobj::read_dynamic): Likewise.(Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjustsection links.(Sized_dynobj::do_initialize_xindex): New function.* dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declaredo_initialize_xindex.(Sized_dynobj::adjust_shndx): New function.* layout.cc (Layout::Layout): Initialize symtab_xindex_ anddynsym_xindex_ fields.(Layout::finalize): Add a call to set_section_indexes beforecreating the symtab sections.(Layout::set_section_indexes): Don't do anything if the sectionalready has a section index.(Layout::create_symtab_sections): Add shnum parameter. Changecaller. Create .symtab_shndx section if needed.(Layout::create_shdrs): Add shstrtab_section parameter. Changecaller.(Layout::allocated_output_section_count): New function.(Layout::create_dynamic_symtab): Create .dynsym_shndx section ifneeded.* layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_fields. Update declarations.(Layout::symtab_xindex): New function.(Layout::dynsym_xindex): New function.(class Write_symbols_task): Add layout_ field.(Write_symbols_task::Write_symbols_task): Add layout parameter.Change caller.* output.cc (Output_section_headers::Output_section_headers): Addshstrtab_section parameter. Change all callers.(Output_section_headers::do_sized_write): Store overflow valuesfor section count and section string table section index insection header zero.(Output_file_header::do_sized_write): Check for overflow ofsection count and section string table section index.(Output_symtab_xindex::do_write): New function.(Output_symtab_xindex::endian_do_write): New function.* output.h (class Output_section_headers): Add shstrtab_section_.Update declarations.(class Output_symtab_xindex): Define.(Output_section::has_out_shndx): New function.* symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_field.(Symbol::init_base): Add st_shndx and is_ordinary parameters.Change all callers.(Sized_symbol::init): Likewise.(Symbol::output_section): Check for ordinary symbol.(Symbol_table::add_from_object): Remove orig_sym parameter. Addst_shndx, is_ordinary, and orig_st_shndx parameters. Change allcallers.(Symbol_table::add_from_relobj): Add symndx_offset parameter.Change all callers. Simplify handling of symbols from sectionsnot included in the link.(Symbol_table::add_from_dynobj): Handle ordinary symboldistinction.(Weak_alias_sorter::operator()): Assert that symbols areordinary.(Symbol_table::sized_finalize_symbol): Handle ordinary symboldistinction.(Symbol_table::write_globals): Add symtab_xindex and dynsym_xindexparameters. Change all callers.(Symbol_table::sized_write_globals): Likewise. Handle ordinarysymbol distinction. Use SHN_XINDEX when needed.(Symbol_table::write_section_symbol): Add symtab_xindexparameter. Change all callers.(Symbol_table::sized_write_section_symbol): Likewise. UseSHN_XINDEX when needed.* symtab.h (class Symbol): Add is_ordinary_shndx_ field. Updatedeclarations.(Symbol::shndx): Add is_ordinary parameter. Change all callers.(Symbol::is_defined): Check is_ordinary.(Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.(Symbol::is_absolute, Symbol::is_common): Likewise.(class Sized_symbol): Update declarations.(class Symbol_table): Update declarations.* resolve.cc (Symbol::override_base): Add st_shndx and is_ordinaryparameters. Change all callers.(Sized_symbol::override): Likewise.(Symbol_table::override): Likewise.(symbol_to_bits): Add is_ordinary parameter. Change all callers.(Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,is_ordinary, and orig_st_shndx parameters. Change all callers.* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbolto be in an ordinary section.* dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Addobject and is_ordinary parameters. Change all callers.(Sized_dwarf_line_info::read_relocs): Add object parameter.Change all callers. Don't add undefined or non-ordinary symbolsto reloc_map_.(Sized_dwarf_line_info::read_line_mappings): Add object parameter.Change all callers.* dwarf_reader.h (class Sized_dwarf_line_info): Updatedeclarations.* ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.* reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.(Sized_relobj::relocate_sections): Likewise.* target-reloc.h (scan_relocs): Adjust section symbol index.(scan_relocatable_relocs): Likewise.* i386.cc (Scan::local): Check for ordinary symbols.* sparc.cc (Scan::local): Likewise.* x86_64.cc (Scan::local): Likewise.* testsuite/binary_unittest.cc (Sized_binary_test): Update callsto symbol_section_and_value.* testsuite/many_sections_test.cc: New file.* testsuite/Makefile.am (BUILT_SOURCES): Define.(check_PROGRAMS): Add many_sections_test.(many_sections_test_SOURCES): Define.(many_sections_test_DEPENDENCIES): Define.(many_sections_test_LDFLAGS): Define.(BUILT_SOURCES): Add many_sections_define.h.(many_sections_define.h): New target.(BUILT_SOURCES): Add many_sections_check.h.(many_sections_check.h): New target.(check_PROGRAMS): Add many_sections_r_test.(many_sections_r_test_SOURCES): Define.(many_sections_r_test_DEPENDENCIES): Define.(many_sections_r_test_LDFLAGS): Define.(many_sections_r_test_LDADD): Define.(many_sections_r_test.o): New target.* testsuite/Makefile.in: Rebuild.2008-04-17 Cary Coutant <ccoutant@google.com>* errors.cc (Errors::info): New function.(gold_info): New function.* errors.h (Errors::info): New function.* gold.h (gold_info): New function.* object.cc (Input_objects::add_object): Print trace output.* options.cc (options::parse_set): New function.(General_options::parse_wrap): Deleted.(General_options::General_options): Deleted initializer.* options.h (options::String_set): New typedef.(options::parse_set): New function.(DEFINE_set): New macro.(General_options::wrap): Changed to use DEFINE_set. Changedcallers of any_wrap_symbols and is_wrap_symbol.(General_options::trace, General_options::trace_symbol):New options.(General_options::any_wrap_symbols, General_options::is_wrap_symbol)(General_options::wrap_symbols_): Deleted.* symtab.cc (Symbol_table::add_from_object): Print trace output.2008-04-17 David S. Miller <davem@davemloft.net>* options.cc (General_options::parse_V): New function.* options.h: Add entries for -V and -Qy.2008-04-17 Ian Lance Taylor <iant@google.com>* common.cc (Symbol_table::allocate_commons): Remove optionsparameter. Change caller.(Symbol_table::do_allocate_commons): Remove options parameter.Change caller. Just call do_allocate_commons_list twice.(Symbol_table::do_allocate_commons_list): New function, broken outof do_allocate_commons.* common.h (class Allocate_commons_task): Remove options_ field.Update constructor.* symtab.cc (Symbol_table::Symbol_table): Initializetls_commons_.(Symbol_table::add_from_object): Put TLS common symbols ontls_commons_ list.(Symbol_table::sized_finalize_symbol): Handle STT_TLS symbolswhich are IN_OUTPUT_DATA.* symtab.h (class Symbol_table): Add tls_commons_ field. Updateallocate_commons and do_allocate_commons declarations. Declaredo_allocate_commons_list.* gold.cc (queue_middle_tasks): Update creation ofAllocate_commons_task to not pass options.* testsuite/Makefile.am (INCLUDES): Add -I.. .(TLS_TEST_C_FLAGS): New variable.(tls_test_c_pic.o): New target.(tls_test_shared.so): Link in tls_test_c_pic.o.(tls_test_c_pic_ie.o): New target.(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_c.o): New target.(tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.(tls_pic_test_LDADD): Likewise.(tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.(tls_shared_gd_to_ie_test_LDADD): Likewise.(tls_test_c_gnu2.o): New target.(tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Addtls_test_c_gnu2.o.(tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.(tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.(tls_test_shared_nonpic.so): Link in tls_test_c.o.* testsuite/tls_test.cc: Include "config.h".(t_last): Call t11_last.* testsuite/tls_test.h (t11, t11_last): Declare.* testsuite/tls_test_c.c: New file.* testsuite/tls_test_main.cc (thread_routine): Call t11.* configure.ac: Check for OpenMP support.* configure, config.in, Makefile.in: Rebuild.* testsuite/Makefile.in: Rebuild.2008-04-16 Cary Coutant <ccoutant@google.com>* i386.cc (Target_i386::define_tls_base_symbol): New function.(Target_i386::tls_base_symbol_defined_): New field.(Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.(Target_i386::Scan::global): Likewise.* symtab.cc (sized_finalize_symbol): Add check for TLS symbol.* x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.(Target_x86_64::tls_base_symbol_defined_): New field.(Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.(Target_x86_64::Scan::global): Likewise.2008-04-16 Cary Coutant <ccoutant@google.com>* symtab.h (Symbol::is_strong_undefined): Removed unused function.(Symbol::needs_plt_entry): Allow weak undefined symbols.(Symbol::needs_dynamic_reloc): Allow weak undefined symbols whenbuilding shared libraries.* testsuite/Makefile.am (weak_undef_nonpic_test): New target.(weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)(weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.* testsuite/Makefile.in: Rebuild.* testsuite/weak_undef.h: New file.* testsuite/weak_undef_file1.cc: Add extra test cases.* testsuite/weak_undef_file2.cc: Likewise.* testsuite/weak_undef_test.cc: Likewise.2008-04-16 David S. Miller <davem@davemloft.net>* sparc.cc (Target_sparc::Scan): Change from struct to class.Add issued_non_pic_error_ field. Declare check_non_pic.(Target_sparc::Scan::check_non_pic): New function.(Target_sparc::Scan::local): Call check_non_pic as appropriate.(Target_sparc::Scan::global): Likewise.* configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.* configure: Rebuild.* options.h (DEFINE_enable): New macro.(new_dtags): New enable option.(initfirst, interpose, loadfltr, nodefaultlib,nodelete, nodlopen, nodump): New -z options.* layout.cc (Layout:finish_dynamic_section): If newdtags enabled, emit DT_RUNPATH. Also, emit aDT_FLAGS_1 containing any specified -z flags.2008-04-16 Ian Lance Taylor <iant@google.com>* copy-relocs.cc: New file.* copy-relocs.h: New file.* reloc.cc: Remove Copy_relocs code.* reloc.h: Likewise.* reloc-types.h (struct Reloc_types) [both versions]: Addget_reloc_addend_noerror.* output.h (class Output_data_reloc<elfcpp::SHT_REL>): Addvariants of add_global which take an addend which must be zero.* i386.cc: Include "copy-relocs.h".(class Target_i386): Change type of copy_relocs_ to variable,update initializer.(Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.Change all callers.(Target_i386::do_finalize_sections): Change handling ofcopy_relocs_.* sparc.cc: Include "copy-relocs.h".(class Target_sparc): Change type of copy_relocs_ to variable,update initializer.(Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.Change all callers.(Target_sparc::do_finalize_sections): Change handling ofcopy_relocs_.* x86_64.cc: Include "copy-relocs.h".(class Target_x86_64): Change type of copy_relocs_ to variable,update initializer.(Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocsclass. Change all callers.(Target_x86_64::do_finalize_sections): Change handling ofcopy_relocs_.* Makefile.am (CCFILES): Add copy-relocs.cc.(HFILES): Add copy-relocs.h.* Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.* testsuite/script_test_4.sh: Permit leading zeroes.2008-04-15 Ian Lance Taylor <iant@google.com>* script-sections.cc (Script_sections::create_segments): Useheader_size_adjustment even when there is enough room for theheaders.* testsuite/script_test_4.sh: New file.* testsuite/script_test_4.t: New file.* testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.(check_DATA): Add script_test_4.stdout.(MOSTLYCLEANFILES): Likewise.(script_test_4): New target.(script_test_4.stdout): New target.* testsuite/Makefile.in: Rebuild.* sparc.cc: Add definitions for Output_data_plt_sparc classconstants.2008-04-14 David S. Miller <davem@davemloft.net>* sparc.cc: New file.* Makefile.am (TARGETSOURCES): Add sparc.cc(ALL_TARGETOBJS): Add sparc.$(OBJEXT)* configure.tgt: Document targ_extra_size andtarg_extra_big_endian. Add entries for sparc-* andsparc64-*.* configure.ac: Handle targ_extra_size andtarg_extra_big_endian.* Makefile.in: Rebuild.* configure: Likewise.* po/POTFILES.in: Likewise.* po/gold.pot: Likewise.2008-04-14 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::Layout): Initialize sections_are_attached_.(Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTRin the name/type/flags to section mapping. Don't callallocate_output_section.(Layout::choose_output_section): Change parameter from adjust_nameto is_input_section. Don't permit input sections after sectionsare attached to segments. Don't call allocate_output_section.(Layout::layout_eh_frame): Call update_flags_for_input_section,not write_enable_output_section.(Layout::make_output_section): Don't push tounattached_section_list_ nor call attach_to_segment. Callattach_section_to_segment if sections are attached.(Layout::attach_sections_to_segments): New function.(Layout::attach_section_to_segment): New function.(Layout::attach_allocated_section_to_segment): Rename fromattach_to_segment. Remove flags parameter.(Layout::allocate_output_section): Remove function.(Layout::write_enable_output_section): Remove function.* layout.h (class Layout): Update for above changes. Add newfield sections_are_attached_.* output.h (Output_section::update_flags_for_input_section): Newfunction.* output.cc (Output_section::add_input_section): Callupdate_flags_for_input_section.* gold.cc (queue_middle_tasks): Call attach_sections_to_segments.2008-04-11 Cary Coutant <ccoutant@google.com>* i386.cc (Target_i386::got_mod_index_entry): Restore code previouslythought unnecessary.* x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.2008-04-11 Ian Lance Taylor <iant@google.com>* output.h (class Output_section_data): Remove inline definitionof set_addralign.* output.cc (Output_section_data::set_addralign): New function.2008-04-11 Cary Coutant <ccoutant@google.com>Add support for TLS descriptors for i386 and x86_64.* i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.(Target_i386::Relocate::tls_desc_gd_to_le): New function.(Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET andGOT_TYPE_TLS_DESC.(Target_i386::got_mod_index_entry): Remove unnecessary code.(Target_i386::Scan::local): Implement R_386_TLS_GOTDESC andR_386_TLS_DESC_CALL relocations. Fix problem with initial-execrelocations.(Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;Fix problem with initial-exec relocations.(Target_i386::Relocate::relocate_tls): Likewise.(Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IErelaxation.* output.cc (Output_data_dynamic::Dynamic_entry::write): Addsupport for section-plus-offset dynamic table entries.* output.h (Output_data_dynamic::add_section_plus_offset): New function.(Output_data_dynamic::Dynamic_entry): Add support forsection-plus-offset dynamic table entries.(Output_data_dynamic::Classification): Likewise.(Output_data_dynamic::classification_): Renamed offset_.* 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::make_plt_section): 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::reserve_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_plt_offset): New function.(Output_data_plt_x86_64::tlsdesc_plt_entry): New field.(Output_data_plt_x86_64::set_final_data_size): Move out of line;add extra PLT entry for TLS descriptors.(Output_data_plt_x86_64::got_): New field.(Output_data_plt_x86_64::tlsdesc_got_offset_): New field.(Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize newfields.(Output_data_plt_x86_64::do_write): Write extra PLT entry for TLSdescriptors.(Target_x86_64::make_plt_entry): Factor out make_plt_section.(Target_x86_64::got_mod_index_entry): Remove unnecessary code.(Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC andR_386_TLS_DESC_CALL relocations.(Target_x86_64::Scan::global): Likewise.(Target_x86_64::do_finalize_sections): Add dynamic table entriesfor TLS descriptors.(Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.(Target_x86_64::Relocate::tls_gd_to_ie): Fix problem withGD-to-IE relaxation.* configure.ac: Export new conditional variables TLS_GNU2_DIALECTand TLS_DESCRIPTORS.* Makefile.in: Rebuild.* configure: Rebuild.* testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.(tls_test_shared2.so): New target.(tls_shared_gd_to_ie_test_SOURCES): 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_LDADD): New variable.(tls_shared_gnu2_gd_to_ie_test): New target.(tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):New targets.(tls_shared_gnu2_gd_to_ie_test_SOURCES): 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_LDADD): New variable.(tls_shared_gnu2_test): New target.(tls_test_gnu2_shared.so): New target.(tls_shared_gnu2_test_SOURCES): New variable.(tls_shared_gnu2_test_DEPENDENCIES): New variable.(tls_shared_gnu2_test_LDFLAGS): New variable.(tls_shared_gnu2_test_LDADD): New variable.* testsuite/Makefile.in: Rebuild.* testsuite/Makefile.2008-04-11 Ian Lance Taylor <iant@google.com>* testsuite/Makefile.am (justsyms_2r.o): Add dependency onjustsyms.t.* testsuite/Makefile.in: Rebuild.* testsuite/script_test_2a.cc (script_test_string_a): Make 8 byteslong.* testsuite/script_test_2.cc (main): Adjust test.2008-04-11 David S. Miller <davem@davemloft.net>Ian Lance Taylor <iant@google.com>* options.h (General_options): Add entries for '-Y' and'-relax'.* options.cc (General_options:finalize): If -Y was used, add thoseentries to the library path instead of the default "/lib" and"/usr/lib".2008-04-11 David S. Miller <davem@davemloft.net>* testsuite/justsyms.t: Start at 0x100.* testsuite/justsyms_1.cc: Adjust justsyms_string assertion.* testsuite/script_test_2b.cc (script_test_string_b): Make 8 byteslong.* testsuite/script_test_2.cc: Adjust string and section lengthchecks.2008-04-09 Ian Lance Taylor <iant@google.com>PR gold/5996* script-sections.cc (Sections_element::allocate_to_segment): Addorphan parameter.(Output_section_definition::allocate_to_segment): Likewise.(Orphan_output_section::allocate_to_segment): Likewise.(Script_sections::attach_sections_using_phdrs_clause): Don'tpropagate non-PT_LOAD segments to orphan sections.* testsuite/Makefile.am (script_test_3.stdout): Generate usingreadelf rather than objdump.* testsuite/script_test_3.sh: Adjust accordingly. Test that.interp section and PT_INTERP segment are the same size.* testsuite/Makefile.in: Rebuild.* symtab.cc (Symbol_table::add_from_dynobj): Only look for weakaliases for symbols defined in the same object.* testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.(weak_alias_test_SOURCES): New variable.(weak_alias_test_DEPENDENCIES): New variable.(weak_alias_test_LDFLAGS): New variable.(weak_alias_test_LDADD): New variable.(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_3.o): New target.(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_1.cc: New file.* testsuite/weak_alias_test_2.cc: New file.* testsuite/weak_alias_test_3.cc: New file.2008-04-08 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Add --noinhibit-exec option.* main.cc (main): Check --noinhibit-exec.* options.h (class General_options): Define --wrap as a specialoption. Add wrap_symbols_ field.(General_options::any_wrap_symbols): New function.(General_options::is_wrap_symbol): New function.* options.cc (General_options::parse_wrap): New function.(General_options::General_options): Initialize wrap_symbols_.* symtab.cc (Symbol_table::wrap_symbol): New function.(Symbol_table::add_from_object): Handle --wrap.* symtab.h (class Symbol_table): Declare wrap_symbol.* target.h (Target::wrap_char): New function.(Target::Target_info): Add wrap_char field.* i386.cc (Target_i386::i386_info): Initialize wrap_char.* x86_64.cc (Target_x86_64::x86_64_info): Likewise.* testsuite/testfile.cc (Target_test::test_target_info):Likewise.* errors.cc (Errors::undefined_symbol): Mention symbol version ifthere is one.* layout.h (class Layout): Add added_eh_frame_data_ field.* layout.cc (Layout::Layout): Initialize new field.(Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frameoutput section until we find a section we merged successfully.* object.cc (Sized_relobj::check_eh_frame_flags): Don't requirethat the size be non-zero.* merge.cc (Object_merge_map::get_output_offset): Remove inlinequalifier.2008-04-08 Craig Silverstein <csilvers@google.com>* configure.ac: Export new conditional variable HAVE_ZLIB.* testsuite/Makefile.am (flagstest_o_specialfile): Conditionon HAVE_ZLIB.(flagstest_o_specialfile_and_compress_debug_sections): Likewise.* configure, Makefile.in, testsuite/Makefile.in: Rebuild.2008-04-07 Ian Lance Taylor <iant@google.com>* version.cc (version_string): Set to "1.5".* x86_64.cc (Target_x86_64::Scan): Change from struct to class.Add issued_non_pic_error_ field. Declare check_non_pic.(Target_x86_64::Scan::check_non_pic): New function.(Target_x86_64::Scan::local): Call check_non_pic as appropriate.(Target_x86_64::Scan::global): Likewise.* output.cc (Output_reloc<SHT_REL>::local_section_offset): Addaddend parameter. Change caller. Handle merge sections.(Output_reloc<SHT_REL>::symbol_value): Change parameter type fromAddress to Addend. Don't add in the result oflocal_section_offset, pass down the addend and use the returnedvalue.* output.h (class Output_reloc<SHT_REL>): Add Addend typedef.Update declarations of local_section_offset and symbol_value.* testsuite/two_file_test_1.cc (t18): New function.* testsuite/two_file_test_2.cc (f18): New function.* testsuite/two_file_test_main.cc (main): Call t18.* testsuite/two_file_test.h (t18, f18): Declare.* configure.ac: Don't test for objdump, c++filt, or readelf.* testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILTconditionals.(TEST_READELF): New variable.(TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.(check_PROGRAMS): Add two_file_strip_test.(two_file_strip_test): New target.(check_PROGRAMS): Add two_file_same_shared_strip_test.(two_file_same_shared_strip_test_SOURCES): 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_LDADD): New variable.(two_file_shared_strip.so): New target.(ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.(ver_test_5.syms, ver_test_7.syms): Likewise.(ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.(strip_test_3.stdout): Use TEST_OBJDUMP.* configure, Makefile.in, testsuite/Makefile.in: Rebuild.2008-04-04 Cary Coutant <ccoutant@google.com>* symtab.h (Symbol::is_weak_undefined): New function.(Symbol::is_strong_undefined): New function.(Symbol::is_absolute): New function.(Symbol::needs_plt_entry): Exclude weak undefined symbols.(Symbol::needs_dynamic_reloc): Exclude weak undefined andabsolute symbols.* testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.(weak_undef_test): New target.* testsuite/Makefile.in: Rebuild.* testsuite/weak_undef_file1.cc: New file.* testsuite/weak_undef_file2.cc: New file.* testsuite/weak_undef_test.cc: New file.2008-04-03 Craig Silverstein <csilvers@google.com>* compressed_output.h (class Output_compressed_section): Useunsigned buffer.* compressed_output.cc (zlib_compress): Use unsigned buffers,add zlib header.(zlib_compressed_suffix): Removed.(Output_compressed_section::set_final_data_size): Use unsignedbuffers.* testsuite/Makefile.am (flagstest_compress_debug_sections):Fix linker invocation.(flagstest_o_specialfile_and_compress_debug_sections):Likewise.* testsuite/Makefile.in: Regenerated.2008-04-02 David S. Miller <davem@davemloft.net>* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.2008-04-02 Craig Silverstein <csilvers@google.com>* TODO: New file.2008-04-02 Ian Lance Taylor <iant@google.com>* fileread.cc (File_read::find_view): Add byteshift and vshiftedparameters. Update for new key type to views_. Change allcallers.(File_read::read): Adjust for byteshift in returned view.(File_read::add_view): New function, broken out offind_and_make_view.(File_read::make_view): New function, broken out offind_and_make_view.(File_read::find_or_make_view): Add offset and alignedparameters. Rewrite accordingly. Change all callers.(File_read::get_view): Add offset and aligned parameters. Adjustfor byteshift in return value.(File_read::get_lasting_view): Likewise.* fileread.h (class File_read): Update declarations.(class File_read::View): Add byteshift_ field. Add byteshift toconstructor. Add byteshift method.* archive.h (Archive::clear_uncached_views): New function.(Archive::get_view): Add aligned parameter. Change all callers.* object.h (Object::get_view): Add aligned parameter. Change allcallers.(Object::get_lasting_view): Likewise.* fileread.cc (File_read::release): Don't call clear_views ifthere are multiple objects.* fileread.h (File_read::clear_uncached_views): New function.* archive.cc (Add_archive_symbols::run): Call clear_uncached_viewson the archive.2008-03-31 Cary Coutant <ccoutant@google.com>Add thin archive support.* archive.cc (Archive::armagt): New const.(Archive::setup): Remove task parameter and calls to unlock.(Archive::unlock_nested_archives): New function.(Archive::read_header): Add nested_off parameter. Changeall callers.(Archive::interpret_header): Likewise.(Archive::include_all_members): Change to handle thinarchives.(Archive::include_member): Likewise.* archive.h (Archive::Archive): Add new parameters andinitializers.(Archive::armagt): New const.(Archive::setup): Remove task parameter.(Archive::unlock_nested_archives): New function.(Archive::read_header): Add nested_off parameter.(Archive::interpret_header): Likewise.(Archive::Nested_archive_table): New typedef.(Archive::is_thin_archive_): New field.(Archive::nested_archives_): New field.(Archive::options_): New field.(Archive::dirpath_): New field.(Archive::task_): New field.* readsyms.cc (Read_symbols::do_read_symbols): Add checkfor thin archives. Pass additional parameters toArchive::Archive. Unlock the archive file after callingArchive::setup.2008-03-29 Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::do_define_as_constant): Don't force aversion symbol to be local.* testsuite/ver_test_4.sh: New file.* testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.(check_DATA): Add ver_test_4.syms.(ver_test_4.syms): New target.* testsuite/Makefile.in: Rebuild.* output.cc(Output_section::Input_section_sort_entry::has_priority): Newfunction.(Output_section::Input_section_sort_entry::match_file_name): Newfunction.(Output_section::Input_section_sort_entry::match_section_name):Remove.(Output_section::Input_section_sort_entry::match_section_name_prefix):Remove.(Output_section::Input_section_sort_entry::match_section_file):Remove.(Output_section::Input_section_sort_compare::operator()): Rewriteusing new Input_section_sort_entry functions. Sort crtbegin andcrtend first. Sort sections with no priority before sections witha priority.* testsuite/initpri1.c (d3): Check j != 4.(cd5): New constructor/destructor function.(main): Check j != 2.* symtab.cc (Symbol_table::add_from_object): If we don't use thenew symbol when resolving, don't call set_is_default.* testsuite/ver_test_7.cc: New file.* testsuite/ver_test_7.sh: New file.* testsuite/Makefile.am (ver_test_7.so): New target.(ver_test_7.o): New target.(check_SCRIPTS): Add ver_test_7.sh.(check_DATA): Add ver_test_7.syms.(ver_test_7.syms): New target.2008-03-28 Ian Lance Taylor <iant@google.com>* layout.cc (Layout::layout): If we see an input section with aname that needs sorting, set the must_sort flag for the outputsection.(Layout::make_output_section): If the name of the output sectionindicates that it might require sorting, set the may_sort flag.* output.h (Output_section::may_sort_attached_input_sections): Newfunction.(Output_section::set_may_sort_attached_input_sections): Newfunction.(Output_section::must_sort_attached_input_sections): Newfunction.(Output_section::set_must_sort_attached_input_sections): Newfunction.(class Output_section): Declare Input_section_sort_entry. DefineInput_section_sort_compare. Declaresort_attached_input_sections. Add new fields:may_sort_attached_input_sections_,must_sort_attached_input_sections_,attached_input_sections_are_sorted_.* output.cc (Output_section::Output_section): Initialize newfields.(Output_section::add_input_section): Add an entry toinput_sections_ if may_sort or must_sort are true.(Output_section::set_final_data_size): Callsort_attached_input_sections if necessary.(Output_section::Input_section_sort_entry): Define new class.(Output_section::Input_section_sort_compare::operator()): Newfunction.(Output_section::sort_attached_input_sections): New function.* configure.ac: Check whether the compiler supports constructorpriorities. Define a CONSTRUCTOR_PRIORITY automake conditional.* testsuite/initpri1.c: New file.* testsuite/Makefile.am (check_PROGRAMS): Add initpri1 ifCONSTRUCTOR_PRIORITY.(initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.(initpri1_LDFLAGS): New variable.* configure, Makefile.in, testsuite/Makefile.in: Rebuild.2008-03-27 Ian Lance Taylor <iant@google.com>* common.cc (Sort_commons::operator): Correct sorting algorithm.* testsuite/common_test_1.c: New file.* testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.(common_test_1_SOURCES): New variable.(common_test_1_DEPENDENCIES): New variable.(common_test_1_LDFLAGS): New variable.* symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_and commons_ correctly when NAME/VERSION does not overrideNAME/NULL.* testsuite/ver_test_6.c: New file.* testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6(ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.(ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.2008-03-26 Ian Lance Taylor <iant@google.com>* symtab.cc (Symbol_table::add_from_relobj): Don't set the versionof an undefined symbol from a version script.* testsuite/Makefile.am (ver_test_5.so): New target.(ver_test_5.o): New target.(check_SCRIPTS): Add ver_test_5.sh.(check_DATA): Add ver_test_5.syms.(ver_test_5.syms): New target.* testsuite/ver_test_5.cc: New file.* testsuite/ver_test_5.script: New file.* testsuite/ver_test_5.sh: New file.* Makefile.in, testsuite/Makefile.in: Rebuild.PR gold/5986Fix problems building gold with gcc 4.3.0.* gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.(gold_error_at_location, gold_warning_at_location): Use it.* configure.ac: Check whether we can compile and use a templatefunction with a printf attribute.* x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit valuewhen jumping over bytes.* object.cc: Instantiate Object::read_section_data.* debug.h: Include <cstring>* dwarf_reader.cc: Include <algorithm>* main.cc: Include <cstring>.* options.cc: Include <cstring>.* output.cc: Include <cstring>.* script.cc: Include <cstring>.* script.h: Include <string>.* symtab.cc: Include <cstring> and <algorithm>.* target-select.cc: Include <cstring>.* version.cc: Include <string>.* testsuite/testmain.cc: Include <cstdlib>.* configure, config.in: Rebuild.2008-03-25 Ian Lance Taylor <iant@google.com>* options.cc: Include "../bfd/bfdver.h".(options::help): Print bug reporting address.* version.cc (print_version): Adjust output for current value ofBFD_VERSION_STRING.* NEWS: New file.* options.cc (options::help): Print list of supported targets.* target-select.h: Include <vector>.(class Target_selector): Make machine_, size_, and is_big_endian_fields const. Add bfd_name_ and instantiated_target_ fields.(Target_selector::Target_selector): Add bfd_name parameter.(Target_selector::recognize): Make non-virtual, calldo_recognize.(Target_selector::recognize_by_name): Make non-virtual, calldo_recognize_by_name.(Target_selector::supported_names): New function.(Target_selector::bfd_name): New function.(Target_selector::do_instantiate_target): New pure virtualfunction.(Target_selector::do_recognize): New virtual function.(Target_selector::do_recognize_by_name): New virtual function.(Target_selector::instantiate_target): New private function.(supported_target_names): Declare.* target-select.cc (Target_selector::Target_selector): Update fornew parameter and fields.(select_target_by_name): Check that the name matches beforecalling recognize_by_name.(supported_target_names): New function.* i386.cc (class Target_selector_i386): Update Target_selectorconstructor call. Remove recognize and recognize_by_name. Adddo_instantiate_target.* x86_64.cc (class Target_selector_x86_64): Likewise.* testsuite/testfile.cc (class Target_selector_test): Update forchanges to Target_selector.* README: Rewrite, with some notes on unsupported features.2008-03-24 Cary Coutant <ccoutant@google.com>* i386.cc (Target_i386::Got_type): New enum declaration.(Target_i386::Scan::local): Updated callers of Output_data_gotmember functions.(Target_i386::Scan::global): Likewise.(Target_i386::Relocate::relocate): Likewise.(Target_i386::Relocate::relocate_tls): Likewise.* object.h (Got_offset_list): New class.(Sized_relobj::local_has_got_offset): Added got_type parameter.(Sized_relobj::local_got_offset): Likewise.(Sized_relobj::set_local_got_offset): Likewise.(Sized_relobj::local_has_tls_got_offset): Removed.(Sized_relobj::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.* 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_rela): Likewise.(Output_data_got::add_global_pair_with_rel): 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_with_rel): 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_rela): New function.(Output_data_got::add_global_tls): Removed.(Output_data_got::add_global_tls_with_rel): Removed.(Output_data_got::add_global_tls_with_rela): Removed.(Output_data_got::add_local_tls): Removed.(Output_data_got::add_local_tls_with_rel): Removed.(Output_data_got::add_local_tls_with_rela): Removed.* 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_rela): Likewise.(Output_data_got::add_global_pair_with_rel): 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_with_rel): 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_rela): New function.(Output_data_got::add_global_tls): Removed.(Output_data_got::add_global_tls_with_rel): Removed.(Output_data_got::add_global_tls_with_rela): Removed.(Output_data_got::add_local_tls): Removed.(Output_data_got::add_local_tls_with_rel): Removed.(Output_data_got::add_local_tls_with_rela): Removed.* resolve.cc (Symbol::override_base_with_special): Removedreference to has_got_offset_ field.* symtab.cc (Symbol::init_fields): Replaced initializationof got_offset_ with got_offsets_. Removed initializationof has_got_offset_* symtab.h (Symbol::has_got_offset): Aded got_type parameter.(Symbol::got_offset): Likewise.(Symbol::set_got_offset): Likewise.(Symbol::has_tls_got_offset): Removed.(Symbol::tls_got_offset): Removed.(Symbol::set_tls_got_offset): Removed.(Symbol::got_offset_): Removed.(Symbol::tls_mod_got_offset_): Removed.(Symbol::tls_pair_got_offset_): Removed.(Symbol::got_offsets_): New field.(Symbol::has_got_offset): Removed.(Symbol::has_tls_mod_got_offset): Removed.(Symbol::has_tls_pair_got_offset): Removed.* x86_64.cc (Target_x86_64::Got_type): New enum declaration.(Target_x86_64::Scan::local): Updated callers of Output_data_gotmember functions.(Target_x86_64::Scan::global): Likewise.(Target_x86_64::Relocate::relocate): Likewise.(Target_x86_64::Relocate::relocate_tls): Likewise.2008-03-25 Ben Elliston <bje@au.ibm.com>* yyscript.y: Fix spelling error in comment.2008-03-24 Ian Lance Taylor <iant@google.com>* options.h (class General_options): Define build_id option.* layout.h (class Layout): Declare write_build_id, create_note,create_build_id. Add build_id_note_ member.* layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,"libiberty.h", "md5.h", "sha1.h".(Layout::Layout): Initialize eh_frame_data_,eh_frame_hdr_section_, and build_id_note_.(Layout::finalize): Call create_build_id.(Layout::create_note): New function, broken out ofLayout::create_gold_note.(Layout::create_gold_note): Call create_note.(Layout::create_build_id): New function.(Layout::write_build_id): New function.(Close_task_runner::run): Call write_build_id.* x86_64.cc: Correct license to GPLv3.2008-03-23 Ian Lance Taylor <iant@google.com>* options.cc: Include "demangle.h".(parse_optional_string): New function.(parse_long_option): Handle takes_optional_argument.(parse_short_option): Update dash_z initializer. Handletakes_optional_argument.(General_options::General_options): Initialize do_demangle_.(General_options::finalize): Set do_demangle_. Handle demanglingstyle.* options.h (parse_optional_string): Declare.(struct One_option): Add optional_arg field. Update constructor.Update call constructor calls. Add takes_optional_argumentfunction.(DEFINE_var): Add optional_arg__ parameter. Change all callers.(DEFINE_optional_string): Define.(General_options::demangle): Change from DEFINE_bool toDEFINE_optional_string.(General_options::no_demangle): New function.(General_options::do_demangle): New function.(General_options::set_do_demangle): New function.(General_options::execstack_status_): Move definition to end ofclass definition.(General_options::static_): Likewise.(General_options::do_demangle_): New field.* object.cc (big_endian>::get_symbol_location_info): CallOptions::do_demangle, not Options::demangle.* symtab.cc (demangle): Likewise.2008-03-22 Ian Lance Taylor <iant@google.com>* gold.h: Include <cstddef> and <sys/types.h>* options.h: Include <cstring>.2008-03-21 Ian Lance Taylor <iant@google.com>* Added source code to GNU binutils.
Go to most recent revision | Compare with Previous | Blame | View Log
