aboutsummaryrefslogtreecommitdiff
path: root/gold
AgeCommit message (Collapse)AuthorFilesLines
2009-10-12 * plugin.cc: Include "gold.h" before other header files.Ian Lance Taylor2-1/+6
2009-10-102009-10-10 Chris Demetriou <cgd@google.com>Chris Demetriou12-47/+237
* 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_argument changes. (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-10 * descriptor.cc: Include <cstdio> and "binary-io.h".Ian Lance Taylor3-1/+13
(Descriptors::open): Open the files in binary mode always. * script.cc (Lex::get_token): Treat \r as whitespace.
2009-10-10 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.Ian Lance Taylor2-1/+4
2009-10-09 * configure.ac: Check for readv function also.Ian Lance Taylor6-2/+30
* fileread.cc (readv): Define if not HAVE_READV. * fileread.h (File_read:: max_readv_entries): Set to 1 if readv does not exist. * config.in: Regenerate. * configure: Regenerate.
2009-10-092009-10-09 Doug Kwan <dougkwan@google.com>Doug Kwan15-121/+839
* layout.cc (Layout::make_output_section): Call target hook to make ordinary output section. (Layout::finalize): Adjust parameter list of call the Target::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 from Sized_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 to protected. (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 memebers merge_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-fill generation and remove an old comment. (Output_section::add_relaxed_input_section): New method definition. (Output_section::add_merge_input_section): Use merge section by properties map to speed to search. Update merge section maps as 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 to Output_section::convert_input_sections_to_relaxed_sections and change interface 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-fill generation as appropriate. (Output_section::get_input_sections): Invalidate relaxed input section map. (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 to Output_section_data_build. (Output_relaxed_input_section::Output_relaxed_input_section): Adjust base 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. Also define 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 to Output_section::convert_input_sections_to_relaxed_sections and change interface 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): Call current_data_size and addralign methods of relaxed input sections. (Orphan_output_section::set_section_addresses): Call current_data_size and addralign methods of relaxed input sections. * symtab.cc (Symbol_table::compute_final_value): Extract template from the body of Symbol_table::sized_finalize_symbol. (Symbol_table::sized_finalized_symbol): Call Symbol_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 table and layout. Adjust call to do_relax. (Target::do_make_output_section): New method declaration. (Target::do_relax): Add parameters for input objects, symbol table and layout.
2009-10-09 * pread.c: Include stdio.h.Ian Lance Taylor2-1/+6
2009-10-09 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is notIan Lance Taylor2-0/+8
defined.
2009-10-09 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Ian Lance Taylor4-9/+24
Change read_shndx type to unsigned int. (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned int. (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 unsigned int. (Sized_dwarf_line_info::read_line_mappings): Likewise. * layout.cc (Layout::create_symtab_sections): Cast the result of local_symcount * symsize to off_t in the gold_assert.
2009-10-09 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true forIan Lance Taylor2-23/+188
R_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. Handle R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and R_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): Handle R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and R_ARM_BASE_ABS.
2009-10-09 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.Ian Lance Taylor2-1/+129
(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-09elfcpp/:Ian Lance Taylor4-21/+233
* elf_file.h: (class Elf_strtab): New class. gold/: * gold.cc: (queue_initial_tasks): Pass incremental_inputs to Incremental_checker. * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to unsigned 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): Use Sized_incremental_binary::check_inputs. (Incremental_inputs::report_command_line): Save command line in command_line_. * incremental.h: (Incremental_binary::find_incremental_inputs_section): New method. (Incremental_binary::do_find_incremental_inputs_section): Add strtab_shndx parameter. (Incremental_binary::do_check_inputs): New pure virtual method. (Sized_incremental_binary::do_check_inputs): Declare. (Incremental_checker::Incremental_checker): Add incremental_inputs parameter, 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-09elfcpp/:Ian Lance Taylor5-62/+343
* elfcpp_file.h: Fix header guard. Include <cstdio>. (class Elf_recognizer): New class, code from gold/object.cc. (Elf_file::find_section_by_type): New method. gold/: * 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): New method. (make_sized_incremental_binary): New function. (open_incremental_binary): New function. (can_incrementally_link_file): Add checks if output is ELF and has inputs 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): Use elfcpp::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 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):Ian Lance Taylor2-0/+224
New function. (Arm_relocate_functions::insert_val_arm_movw_movt): New function. (Arm_relocate_functions::extract_thumb_movw_movt_addend): New function. (Arm_relocate_functions::insert_val_thumb_movw_movt): New function. (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 * arm.cc (Arm_relocate_functions::got_prel) New function.Ian Lance Taylor2-0/+35
(Scan::local, Scan::global): Handle R_ARM_GOT_PREL. (Relocate::relocate): Likewise. (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2009-10-06 * options.h (class General_options): DefineIan Lance Taylor32-63/+1321
split_stack_adjust_size parameter. * object.h (class Object): Add uses_split_stack_ and has_no_split_stack_ fields. Add uses_split_stack and has_no_split_stack accessor functions. Declare handle_split_stack_section. (class Reloc_symbol_changes): Define. (class Sized_relobj): Define Function_offsets. Declare split_stack_adjust, split_stack_adjust_reltype, and find_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): Call handle_split_stack_section. * reloc.cc (Sized_relobj::relocate_sections): Call split_stack_adjust for executable sections in split_stack objects. 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. Change all callers. * target.h (class Target): Add calls_non_split method. Declare do_calls_non_split virtual method. Declare match_view and set_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 mixing split-stack and non-split-stack objects with -r. * i386.cc (Target_i386::relocate_section): Add reloc_symbol_changes parameter. (Target_i386::do_calls_non_split): New function. * x86_64.cc (Target_x86_64::relocate_section): Add reloc_symbol_changes parameter. (Target_x86_64::do_calls_non_split): New function. * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes parameter. * powerpc.cc (Target_powerpc::relocate_section): Add reloc_symbol_changes parameter. * sparc.cc (Target_sparc::relocate_section): Add reloc_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_section function. * testsuite/Makefile.in: Rebuild.
2009-10-06Tweak last patch.Ian Lance Taylor1-9/+11
2009-10-06 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.Ian Lance Taylor2-1/+43
(Target_i386::Relocate::relocate_tls): Call fix_up_ldo before changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push the address on ldo_addrs_. (Target_i386::Relocate::fix_up_ldo): New function.
2009-10-06 * plugin.cc (add_input_library): New.Ian Lance Taylor3-5/+30
(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-10-012009-09-30 Doug Kwan <dougkwan@google.com>Doug Kwan9-57/+54
* arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function symbol and call Symbol::may_need_copy_reloc to determine if a copy reloc is needed. * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z nocopyreloc is given in command line. (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not given in command line. * i386.cc (Target_i386::may_need_copy_reloc): Remove. (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead of 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_reloc instead 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_reloc instead 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_reloc instead of the removed Target_x86_64::may_need_copy_reloc.
2009-09-30 * object.h (class Object): Remove target_ field, and target,Ian Lance Taylor20-188/+227
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 all callers. Set or test parameter target. * dynobj.cc (Sized_dynobj::target): Remove target parameter. Change all callers. * parameters.cc (Parameters::set_target): Change parameter type to be 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. Remove default_target method. Add sized_target and clear_target methods. 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 punconfigured as NULL if we aren't searching. (Add_symbols::run): Don't check for compatible target. * fileread.cc (Input_file::open_binary): Call parameters_force_valid_target. * gold.cc (queue_middle_tasks): Likewise. * plugin.cc (make_sized_plugin_object): Likewise. Don't call set_target on object. * dynobj.h (class Sized_dynobj): Update declarations. * archive.cc (Archive::get_elf_object_for_member): Return NULL if make_elf_object returns NULL. (Archive::include_member): Don't check whether object target is compatible. * output.cc (Output_section::add_input_section): Get target from parameters. (Output_section::relax_input_section): Likewise. * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from parameters. (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 object parameter. 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 from parameters. * symtab.h (class Symbol_table): Update declaration. * testsuite/binary_unittest.cc (gold_testsuite): Remove target parameter. Change all callers. Clear parameter target. (Binary_test): Test target here. * testsuite/object_unittest.cc (gold_testsuite): Remove target_test_pointer parameter. Change all callers. (Object_test): Test target here.
2009-09-27 * testsuite/initpri1.c: Don't try to use constructor priorities ifIan Lance Taylor2-5/+20
compiling with gcc before 4.3.
2009-09-22 * testsuite/retain_symbols_file_test.sh (check_present): ChangeIan Lance Taylor2-4/+10
output file name to retain_symbols_file_test.stdout. (check_absent): Likewise.
2009-09-18 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.Craig Silverstein8-6/+157
* 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, new variable symbols_to_retain. * symtab.cc (Symbol_table::sized_finalize_symbol): Test should_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-18Updated Spanish and Vietnamese translationsNick Clifton2-13/+17
2009-09-182009-09-17 Doug Kwan <dougkwan@google.com>Doug Kwan9-175/+1307
* 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 members record_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 to Layout::relaxation_loop_body. (Layout::set_asection_address_from_script): Move code for orphan section 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 size computation to Output_section_headers::do_size. (Output_segment_headers::do_size): New method definition. (Output_file_header::Output_file_header): Move size computation to Output_file_header::do_size and call it. (Output_file_header::do_size): New method definition. (Output_data_group::Output_data_group): Adjust call to Output_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): Handle RELAXED_INPUT_SECTION_CODE. (Output_section::Output_section): Initialize data member checkpoint_. (Output_section::~Output_section): Delete checkpoint object pointed by checkpoint_. (Output_section::add_input_section): Always add an Input_section if relaxing. (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 for an 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 input section list lazily. (Output_section::get_input_sections): Change type of input_sections to list of Simple_input_section pointers. Checkpoint input section list lazily. Also handle relaxed input sections. (Output_section::add_input_section_for_script): Take a reference to a Simple_input_section object instead of Relobj pointer and section index as parameter. Handle relaxed input sections. (Output_section::save_states, Output_section::restore_states): New method 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 size if it is fixed. (Output_data::address_and_file_offset_have_reset_values): New method definition. (Output_data::do_address_and_file_offset_have_reset_values): New method definition. (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 parameter is_data_size_fixed and use it to fix data size. (Output_data_const::Output_data_const): Adjust call to base class constructor and fix data size. (Output_data_const_buffer::Output_data_const_buffer): Adjust call to base class constructor and fix data size. (Output_data_fixed_space::Output_data_fixed_space): Adjust call to base class constructor and fix data size. (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base class 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 base class 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): Handle RELAXED_INPUT_SECTION_CODE. Add new overload for Output_relaxed_input_section. (Output_section::Input_section::is_input_section, Output_section::Input_section::set_output_section): Handle relaxed input section. (Output_section::Input_section::is_relaxed_input_section, Output_section::Input_section::output_section_data, Output_section::Input_section::relaxed_input_section): New method definitions. (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum value. (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 base constructor to fix data size. (Output_section_element_data::set_section_addresses): Register Output_data_expression object for relaxation clean up. (struct Input_section_info): Replace Relobj pointer and section index pair with Output_section::Simple_input_section and Convert struct to a class. (Input_section_sorter::operator()): Adjust access to Input_section_info data member to use accessors. (Output_section_element_input::set_section_addresses): Use layout parameter. Adjust code to use Output_section::Simple_input_section and Input_secction_info classes. Register filler for relaxation clean up. (Orphan_output_section::set_section_addresses): Replace Relobj pointer and section index pair with Output_section::Simple_input_section class. Adjust code accordingly. (Phdrs_element::release_segment): New method definition. (Script_sections::attach_sections_using_phdrs_clause): Do not modify segment list. (Script_sections::release_segments): New method definition. * gold/script-sections.h (Script_sections::release_segments): New method declaration. * gold/target.h (Target::may_relax, Target::relax, Target::do_may_relax, Target::do_relax): New method definitions.
2009-09-18 * arm.cc (has_signed_unsigned_overflow): New function.Ian Lance Taylor2-0/+76
(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 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.Cary Coutant3-45/+78
* testsuite/Makefile.in: Regenerate.
2009-09-11 * po/bfd.pot: Updated by the Translation project.Nick Clifton1-0/+4
* po/binutils.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gprof.pot: Updated by the Translation project. * po/sv.po: Updated Swedish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. Updated soruces in ld/* to compile cleanly with -Wc++-compat: * ld.h (enum endian_enum,enum symbolic_enum,enum dynamic_list_enum): Move to top level. * ldcref.c: Add casts. * ldctor.c: Add casts. * ldexp.c * ldexp.h (enum node_tree_enum,enum phase_enum): Move to top level. * ldlang.c: Add casts. (lang_insert_orphan): Use enum name instead of integer. * ldlang.h (enum statement_enum): Move to top level. * ldmain.c: Add casts. * ldwrite.c: Add casts. * lexsup.c: Add casts. (enum control_enum): Move to top level. * mri.c: Add casts. (mri_draw_tree): Use enum name instead of integer. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. * as.c (main): Call dwarf2_init. * config/obj-elf.c (struct group_list): New field. (build_group_lists): Use hash lookup. (free_section_idx): New function. (elf_frob_file): Adjust. * dwarf2dbg.c (all_segs_hash, last_seg_ptr): New variables. (get_line_subseg): Adjust. (dwarf2_init): New function. * dwarf2dbg.h (dwarf2_init): New declaration.
2009-09-08 * output.cc (Output_file::open): Add execute permission to empty file.Cary Coutant4-13/+69
* testsuite/Makefile.am (permission_test): New test. * testsuite/Makefile.in: Regenerate.
2009-09-02 * output.cc (Output_file::resize): Call map_no_anonymous ratherIan Lance Taylor2-1/+7
than map.
2009-09-01 * gold.cc: Include "incremental.h".Ian Lance Taylor4-6/+68
(queue_initial_tasks): Call Incremental_checker methods. * incremental.cc: Include "output.h". (Incremental_checker::can_incrementally_link_output_file): New method. * incremental.h (Incremental_checker): New class.
2009-09-01 * output.cc (Output_file::open_for_modification): New method.Ian Lance Taylor2-43/+112
(Output_file::map_anonymous): Changed return type to bool. Record map 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-25 * options.h (Command_line::Pre_options): New class.Cary Coutant3-1/+42
(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 when done constructing. (Command_line::Pre_options::Pre_options): New constructor.
2009-08-24Fixed typo in ChangeLog.Cary Coutant1-1/+2
2009-08-24 (General_options::no_keep_memory): Remove incorrect short option.Cary Coutant2-2/+7
2009-08-24Fix yacc and lex reruns with maintainer-mode off.Ralf Wildenhues3-0/+15
gas/: * Makefile.am (am__skiplex, am__skipyacc): New. * Makefile.in: Regenerate. ld/: * Makefile.am (am__skiplex, am__skipyacc): New. * Makefile.in: Regenerate. binutils/: * Makefile.am (am__skiplex, am__skipyacc): New. * Makefile.in: Regenerate. gold/: * Makefile.am (am__skiplex, am__skipyacc): New. * Makefile.in: Regenerate.
2009-08-22Cleanups in binutils makefiles.Ralf Wildenhues5-6/+16
ld/: * Makefile.am (bin_PROGRAMS): Renamed from ... (noinst_PROGRAMS): ... this. (transform): Override, including the renaming of ld-new to ld. (install-exec-local): Installation of ld in $(bindir) not needed here any more. (AM_CPPFLAGS): Renamed from ... (INCLUDES): ... this. (MAINTAINERCLEANFILES): Add ld.1. * Makefile.in: Regenerate. gold/: * 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. bfd/: * Makefile.am (libbfd_la_LDFLAGS): Initialize early, to allow appending. [INSTALL_LIBBFD] (bfdlib_LTLIBRARIES, bfdinclude_HEADERS): Set only in this condition. [!INSTALL_LIBBFD] (noinst_LTLIBRARIES, libbfd_la_LDFLAGS): New, to build but not install libbfd.la in this condition. (install-bfdlibLTLIBRARIES, uninstall-bfdlibLTLIBRARIES) (install_libbfd, install_libbfd): Remove. * Makefile.in: Regenerate. binutils/: * Makefile.am (AM_CPPFLAGS): Renamed from ... (INCLUDES): ... this. (bin2c$(EXEEXT_FOR_BUILD): Adjust rule. (installcheck-local): Renamed from ... (installcheck): ... this. * Makefile.in: Regenerate. gas/: * Makefile.am (YFLAGS): Remove, not needed any more. (AM_CPPFLAGS): Renamed from ... (INCLUDES): ... this. * Makefile.in: Regenerate. gprof/: * Makefile.am (AM_CPPFLAGS): Renamed from ... (INCLUDES): ... this. * Makefile.in: Regenerate. opcodes/: * Makefile.am (libopcodes_la_LDFLAGS): Initialize early. [INSTALL_LIBBFD] (bfdlib_LTLIBRARIES): Set only in this condition. [INSTALL_LIBBFD] (bfdinclude_DATA): New. [!INSTALL_LIBBFD] (noinst_LTLIBRARIES): New. [!INSTALL_LIBBFD] (libopcodes_la_LDFLAGS): Ensure libopcodes.la is built shared even if it is not to be installed. (install-bfdlibLTLIBRARIES,uninstall-bfdlibLTLIBRARIES) (install_libopcodes, uninstall_libopcodes): Remove. (AM_CPPFLAGS): Renamed from ... (INCLUDES): ... this. * Makefile.in: Regenerate.
2009-08-22Regenerate tree using Autoconf 2.64 and Automake 1.11.Ralf Wildenhues6-6865/+5914
config/: * override.m4 (_GCC_AUTOCONF_VERSION): Bump to 2.64. /: * configure: Regenerate. etc/: * configure: Regenerate. sim/common/: * config.in: Regenerate. * configure: Likewise. sim/iq2000/: * config.in: Regenerate. * configure: Likewise. sim/d10v/: * config.in: Regenerate. * configure: Likewise. sim/igen/: * config.in: Regenerate. * configure: Likewise. sim/m32r/: * config.in: Regenerate. * configure: Likewise. sim/frv/: * config.in: Regenerate. * configure: Likewise. sim/: * avr/config.in: Regenerate. * avr/configure: Likewise. * configure: Likewise. * cris/config.in: Likewise. * cris/configure: Likewise. sim/h8300/: * config.in: Regenerate. * configure: Likewise. sim/mn10300/: * config.in: Regenerate. * configure: Likewise. sim/ppc/: * config.in: Regenerate. * configure: Likewise. sim/erc32/: * config.in: Regenerate. * configure: Likewise. sim/arm/: * config.in: Regenerate. * configure: Likewise. sim/m68hc11/: * config.in: Regenerate. * configure: Likewise. sim/lm32/: * config.in: Regenerate. * configure: Likewise. sim/sh64/: * config.in: Regenerate. * configure: Likewise. sim/v850/: * config.in: Regenerate. * configure: Likewise. sim/cr16/: * config.in: Regenerate. * configure: Likewise. sim/moxie/: * config.in: Regenerate. * configure: Likewise. sim/m32c/: * config.in: Regenerate. * configure: Likewise. sim/mips/: * config.in: Regenerate. * configure: Likewise. sim/mcore/: * config.in: Regenerate. * configure: Likewise. sim/testsuite/d10v-elf/: * configure: Regenerate. sim/testsuite/: * configure: Regenerate. sim/testsuite/frv-elf/: * configure: Regenerate. sim/testsuite/m32r-elf/: * configure: Regenerate. sim/testsuite/mips64el-elf/: * configure: Regenerate. sim/sh/: * config.in: Regenerate. * configure: Likewise. gold/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * testsuite/Makefile.in: Likewise. gprof/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * configure: Likewise. * gconfig.in: Likewise. opcodes/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. gas/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. ld/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. gdb/: * aclocal.m4: Regenerate. * config.in: Likewise. * configure: Likewise. * gnulib/Makefile.in: Likewise. gdb/doc/: * configure: Regenerate. gdb/gdbserver/: * aclocal.m4: Regenerate. * config.in: Likewise. * configure: Likewise. gdb/testsuite/: * configure: Regenerate. * gdb.hp/configure: Likewise. * gdb.hp/gdb.aCC/configure: Likewise. * gdb.hp/gdb.base-hp/configure: Likewise. * gdb.hp/gdb.compat/configure: Likewise. * gdb.hp/gdb.defects/configure: Likewise. * gdb.hp/gdb.objdbg/configure: Likewise. * gdb.stabs/configure: Likewise. binutils/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. bfd/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. bfd/doc/: * Makefile.in: Regenerate. readline/: * configure: Regenerate. readline/examples/rlfe/: * configure: Regenerate.
2009-08-22Minor fixes in sim, gold, gdb for Autoconf 2.64, Automake 1.11.Ralf Wildenhues5-4/+11
gold/: * Makefile.am (AUTOMAKE_OPTIONS): Add foreign. * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. gdb/: * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE, AC_AIX, AC_ISC_POSIX. sim/common/: * aclocal.m4 (SIM_CHECK_MEMBER): Replace definition with definition of AC_CHECK_MEMBER.
2009-08-19 * resolve.cc (Symbol_table::resolve): Don't complain about definedCary Coutant2-2/+9
symbols in shared libraries overridden by hidden or internal symbols in the main program.
2009-08-192009-08-19 Chris Demetriou <cgd@google.com>Chris Demetriou2-8/+16
* testsuite/debug_msg.sh: Match .* rather than ${srcdir} when checking source file names in error messages.
2009-08-182009-08-18 Doug Kwan <dougkwan@google.com>Doug Kwan7-54/+165
* dynobj.cc (Sized_dynobj::setup): Take a Target object instead of an elcpp::Ehdr as parameter. Adjust call to set_target. * dynobj.h (Sized_dynobj::setup): Take a Target object instead of an elfcpp::Ehdr as parameter. * object.cc (Object::set_target): Remove the version that looks up a target and sets it. (Sized_relobj::setup): Take a Target object instead of an elfcpp::Ehdr as parameter. Adjust call to set_target. (make_elf_sized_object): Find target and ask target to make an ELF object. * object.h: (Object::set_target): Remove the version that looks up a target and sets it. (Sized_relobj::setup): Take a Target object instead of an 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 * gold.h (FUNCTION_NAME): Define.Ian Lance Taylor2-1/+17
(gold_unreachable): Use FUNCTION_NAME.
2009-08-132009-08-12 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam2-3/+11
* icf.cc (Icf::find_identical_sections): Issue a warning when a symbol in the --keep-unique list is not found.
2009-08-12Sriraman Tallam <tmsriram@google.com>Sriraman Tallam8-1/+152
* icf.cc (Icf::find_identical_sections): Unfold symbols that have been 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 PR 10471Cary Coutant7-3/+220
* resolve.cc (Symbol_table::resolve): Check for references from dynamic 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-112009-08-11 Doug Kwan <dougkwan@google.com>Doug Kwan2-8/+29
* arm.cc: Update comments. (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX segment to locate the .ARM.exidx section if present.
2009-08-10Revert the previous change.Doug Kwan2-1/+6
http://sourceware.org/ml/binutils-cvs/2009-08/msg00043.html
2009-08-07*** empty log message ***Sriraman Tallam2-1/+5