aboutsummaryrefslogtreecommitdiff
path: root/gold
AgeCommit message (Collapse)AuthorFilesLines
2009-04-02 * gold.h (reserve_unordered_map): Define, three versions, one forIan Lance Taylor5-33/+85
each version of Unordered_map. * layout.cc (Layout::Layout): Remove options parameter. Add number_of_input_files parameter. Don't initialize options_. Initialize number_of_input_files_ and resized_signatures_. Move sections_are_attached_. (Layout::layout_group): Reserve space for group_signatures_. (Layout::find_or_add_kept_section): Change name parameter to be a reference. Resize signatures_ map when it gets large enough. (Layout::layout_eh_frame): Use parameters->options() instead of this->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 Layout constructor. Don't pass options.
2009-03-30 * ffsll.c (ffsll): Correct implementation.Ian Lance Taylor2-3/+12
2009-03-28 * ffsll.c: New file.Ian Lance Taylor10-5/+72
* 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.
2009-03-27 * mremap.c: New file.Ian Lance Taylor7-3/+78
* 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 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output isCary Coutant4-1/+11
position independent. * sparc.cc (Target_sparc::check_non_pic): Likewise. * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
2009-03-25 * symtab.h (needs_plt_entry): Check for unsatisfied reference fromCary Coutant2-2/+12
an executable. (needs_dynamic_reloc): Likewise.
2009-03-24 * yyscript.y (file_cmd): Recognize EXTERN.Ian Lance Taylor4-1/+47
(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 * object.cc (is_elf_object): Define.Ian Lance Taylor5-81/+95
* object.h (is_elf_object): Declare. * archive.cc (Archive::get_elf_object_for_member): Call is_elf_object. * readsymc.cc (Read_symbols::do_read_symbols): Likewise.
2009-03-24 * output.cc (Output_file::map_anonymous): Define.Ian Lance Taylor3-7/+35
(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 * target-select.cc (instantiate_target): Don't acquire the lock ifIan Lance Taylor3-4/+14
the instantiated_target_ field has already been set.
2009-03-242009-03-23 Ian Lance Taylor <iant@google.com>Ian Lance Taylor11-39/+220
* 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): Initialize new fields. (Target_selector::instantiate_target): Define. * descriptors.h: Include "gold-threads.h". (class Descriptors): Add initialize_lock_ field. * descriptors.cc (Descriptors::Descriptors): Initialize new field. (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): Remove instantiated_target_ field. In do_recognize call instantiate_target rather than do_instantiate_target. In do_instantiate_target just allocate a new target. * sparc.cc (class Target_selector_sparc): Likewise.
2009-03-242009-03-23 Ian Lance Taylor <iant@google.com>Ian Lance Taylor14-16/+259
* freebsd.h: New file. * i386.cc: Include "freebsd.h". (Target_i386): Derive from Target_freebsd rather than Sized_target. (Target_selector_i386): Derive from Target_selector_freebsd rather than Target_selector. * x86_64.cc: Include "freebsd.h". (Target_x86_64): Derive from Target_freebsd rather than Sized_target. (Target_selector_x86_64): Derive from Target_selector_freebsd rather than Target_selector. * target.h (class Target): Add adjust_elf_header and do_adjust_elf_header. * output.cc (Output_file_header:: do_sized_write): Call target adjust_elf_header routine. * configure.tgt: Set targ_osabi. * configure.ac: Define GOLD_DEFAULT_OSABI. * parameters.cc (Parameters::default_target): Pass GOLD_DEFAULT_OSABI to select_target. * target-select.h (class Target_selector): Make instantiate_target protected rather than private. * Makefile.am (HFILES): Add freebsd.h. * configure, Makefile.in, config.in: Rebuild.
2009-03-23 * merge.cc (do_add_input_section): Correct pend value. ChangeIan Lance Taylor2-3/+11
message about last entry not being null terminated from error to warning.
2009-03-20include/elf:Ian Lance Taylor4-7/+162
* common.h (SHT_GNU_INCREMENTAL_INPUTS): Define. elfcpp: * elfcpp.h (SHT_GNU_INCREMENTAL_INPUTS): Define. gold: * incremental.cc: New file. * Makefile.am (CCFILES): Add incremental.cc. * Makefile.in: Rebuild.
2009-03-192009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2-0/+10
* layout.cc (Layout::output_section_name): Preserve names of '.note.' sections.
2009-03-19 * descriptors.cc (Descriptors::open): Check that the options areIan Lance Taylor2-1/+8
valid before using them.
2009-03-19 * script-sections.h: Include <list>.Ian Lance Taylor3-182/+376
(class Script_sections): Change Sections_elements from std::vector to std::list. Typedef public Elements_iterator. Add orphan_section_placement_, data_segment_align_start_, and saw_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 and orphan_section_init. Remove virtual function place_orphan_here. (class Output_section_definition): Add is_relro and orphan_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): Check saw_data_segment_align_. Use data_segment_align_start_ rather than data_segment_align_index_. (Script_sections::place_orphan): Rewrite to use Orphan_section_placement.
2009-03-18 * archive.cc (Archive::add_symbols): Check for a version attachedIan Lance Taylor4-13/+87
to 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.
2009-03-17 * configure.ac: Check for chsize and posix_fallocate. ReplaceIan Lance Taylor8-11/+248
ftruncate. * ftruncate.c: New file, from gnulib. * output.cc (posix_fallocate): Define dummy version if not HAVE_POSIX_FALLOCATE. (Output_file::map): Call posix_fallocate rather than lseek and write. * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE. * configure, Makefile.in, config.in: Rebuild.
2009-03-172009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov3-8/+17
* 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 * descriptors.cc: Include "options.h".Ian Lance Taylor2-18/+50
(FD_CLOEXEC, O_CLOEXEC): Define if not defined. (Descriptors::open): Always use O_CLOEXEC when opening a new descriptor. If we have a plugin, and O_CLOEXEC was not defined, then set FD_CLOEXEC.
2009-03-17 * sparc.cc (class Target_sparc): Add has_got_section.Ian Lance Taylor2-2/+36
(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.
2009-03-17 * symtab.cc (Symbol_table::define_default_version): New function,Ian Lance Taylor3-109/+234
broken out of add_from_object. (Symbol_table::add_from_object): Call define_default_version. (Symbol_table::define_special_symbol): Add resolve_oldsym parameter. Change all callers. If the version for a symbol comes from a version script, resolve it with the symbol with the same name with no version. Also add the symbol without a version if appropriate. (do_define_in_output_data): If resolving with oldsym, don't delete sym. (do_define_in_output_segment): Likewise. (do_define_as_constant): Likewise. * symtab.h (class Symbol_table): Update declarations.
2009-03-14 * readsyms.cc (Read_symbols::incompatible_warning): New function.Ian Lance Taylor24-139/+587
(Read_symbols::requeue): New function. (Read_symbols::do_read_symbols): If make_elf_object fails because the 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, and it was searched for, requeue the Read_symbols task. On error, release the object. * readsyms.h (class Read_symbols): Add dirindex_ field. Add dirindex parameter to constructor. Change all callers. Declare incompatible_warning and requeue. (class Add_symbols): Add dirpath_, dirindex_, mapfile_, input_argument_ and input_group_ fields. Add them to constructor. 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_objects parameter. Add punconfigured parameter. Change all callers. (Archive::add_symbols): Change return type to bool. Check return value of include_member. (Archive::include_all_members): Likewise. (Archive::include_member): Change return type to bool. Return false if first included object has incompatible target. Set included_member_ field. (Add_archive_symbols::run): If add_symbols returns false, requeue Read_symbols task. * archive.h (class Archive): Add included_member_ field. Initialize it in constructor. Add input_file and searched_for methods. Update declarations. (class Add_archive_symbols): Add dirpath_, dirindex_, and input_argument_ fields. Add them to constructor. Change all callers. * script.cc: Include "target-select.h". (class Parser_closure): Add skip_on_incompatible_target_ and found_incompatible_target_ fields. Add skip_on_incompatible_target parameter to constructor. Change all callers. Add methods skip_on_incompatible_target, clear_skip_on_incompatible_target, found_incompatible_target, and set_found_incompatible_target. (read_input_script): Add dirindex parameter. Change all callers. If parser finds an incompatible target, requeue Read_symbols task. (script_set_symbol): Clear skip_on_incompatible_target in closure. (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. Add searched_for method. (make_elf_object): Update declaration. * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to restart 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.
2009-03-13 * fileread.cc (Input_file::open): Remove options parameter.Ian Lance Taylor10-43/+43
Change all callers. (Input_file::open_binary): Likewise. * script.cc (read_input_script): Likewise. * readsyms.h (class Read_symbols): Remove options_ field. Remove options 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-10Add Spanish translation to gold.Nick Clifton2-0/+1871
Update Indonesian translation for opcodes.
2009-03-06 * options.cc (parse_short_option): Keep dash_z from registering itself.Cary Coutant2-1/+5
2009-03-04 PR 9918Ian Lance Taylor10-58/+135
* target-reloc.h (relocate_section): Pass output_section to relocate. * i386.cc (Target_i386::should_apply_static_reloc): Add output_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-02elfcpp:/Ian Lance Taylor4-0/+160
* elfcpp_swap.h: #include "config.h". Only #include <byteswap.h> if HAVE_BYTESWAP_H is defined; if not, provide definitions for bswap_{16,32,64}. For gcc 4.3 and later, use the builtin bswap functions. Check WORDS_BIGENDIAN rather than __BYTE_ORDER. gold:/ * configure.ac: Check for byteswap.h. * configure: Rebuild. * config.in: Rebuild.
2009-03-01 * layout.cc (Layout::find_or_add_kept_section): New function.Ian Lance Taylor6-101/+126
(Layout::add_comdat): Removed. * layout.h (struct Kept_section): Move out of class Layout. Remove trailing underscores from field names. Add group_sections field. 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 initialize comdat_groups_ field. (Sized_relobj::include_section_group): Use find_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 or Comdat_group_table. Remove find_comdat_group and add_comdat_group. Remove comdat_groups_ field. * plugin.cc (include_comdat_group): Use Layout::find_or_add_kept_section.
2009-02-28 * README: --gc-sections and map files are now supported. DocumentIan Lance Taylor2-2/+16
some build requirements.
2009-02-28 PR 6992Ian Lance Taylor3-2/+15
* symtab.cc (Symbol_table::sized_write_section_symbol): In a relocatable link set the value of the section symbol to zero. * object.cc (Sized_relobj::do_finalize_local_symbols): In a relocatable link don't include the section address in the local symbol value.
2009-02-28 PR 6811Ian Lance Taylor10-60/+100
* 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 set system_library_directory_. (input_objects::found_in_system_library_directory): Remove. * symtab.cc (Symbol_table::write_globals): Remove input_objects parameter. 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.
2009-02-28 PR 5990Ian Lance Taylor3-1/+22
* descriptors.h (Open_descriptor): Add is_on_stack field. * descriptors.cc (Descriptors::open): If the descriptor is on the top of the stack, remove it. Initialize is_on_stack field. (Descriptors::release): Only add pod to stack if it is not on the stack already. (Descriptors::close_some_descriptor): Clear stack_next and is_on_stack fields.
2009-02-28 PR 7091Ian Lance Taylor4-24/+52
* output.cc (Output_section::find_starting_output_address): Rename from starting_output_address; add PADDR parameter; change return type. * output.h (class Output_section): Declare find_starting_output_address instead of starting_output_address. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a section symbol for which we can't find a merge section.
2009-02-27 PR 9836Ian Lance Taylor7-14/+120
* symtab.cc (Symbol_table::add_from_object): If the visibility is hidden 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 hidden or internal, force the symbol to be local. * symtab.h (class Symbol): Add set_visibility and override_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 * layout.cc (Layout::choose_output_section): Don't rename sectionsCary Coutant8-11/+168
when 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 (From Rafael Espindola)Cary Coutant9-120/+49
* archive.cc (Archive::include_member): Update calls to add_symbols. * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add the Layout argument. * dynobj.h (do_add_symbols): Add the Layout argument. * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the Layout 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 to Add_symbols. Use Add_symbols instead of Add_plugin_symbols. (Add_symbols::run): Make it work with Pulginobj.
2009-02-07 * object.cc (Sized_relobj::do_layout): Make info message startIan Lance Taylor2-1/+6
with lower case letter.
2009-02-07 * binary.cc: Fix file comment.Ian Lance Taylor2-1/+3
2009-02-06 * options.h (enum Incremental_disposition): Define.Ian Lance Taylor3-4/+96
(class General_options): Add new options: --incremental, --incremental_changed, --incremental_unchanged, --incremental_unknown. Add incremental_disposition_ and implicit_incremental_ fields. (General_options::incremental_disposition): New function. (class Position_dependent_options): Add incremental_disposition option. (Position_dependent_options::copy_from_options): Set incremental dispositions. * options.cc (General_options::parse_incremental_changed): New function. (General_options::parse_incremental_unchanged): New function. (General_options::parse_incremental_unknown): New function. (General_options::General_options): Initialize new fields incremental_disposition_ and implicit_incremental_. (General_options::finalize): Check for uasge of --incremental-* without --incremental.
2009-02-062009-02-06 Chris Demetriou <cgd@google.com>Chris Demetriou8-67/+100
* gold.h (gold_undefined_symbol): Change to take only a Symbol pointer and to report location as the file name associated with the symbol. (gold_undefined_symbol_at_location): New function to replace the old gold_undefined_symbol functionality. * target-reloc.h (relocate_section): Update to use gold_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 a string, rather than calculating it from a relocation. * errors.cc (Errors::fatal): Print "fatal error:" before the formatted message. (Errors::error, Errors::error_at_location): Print "error: " before the formatted message. (Errors::undefined_symbol): Take location as a string, rather than calculating it from a relocation. (gold_undefined_symbol_at_location): New function akin to old gold_undefined_symbol, calculates location from relocation. (gold_undefined_symbol): Change to take only a Symbol pointer and 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 PR 9812Ian Lance Taylor2-2/+10
* reduced_debug_output.h (Output_reduced_debug_abbrev_section::failed): Use format for gold_warning. (Output_reduced_debug_info_section::faild): Likewise.
2009-02-01 * script.cc (Lazy_demangler): New class.Ian Lance Taylor2-12/+59
(Version_script_info::get_symbol_version_helper): Demangle a symbol only once.
2009-01-30 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC callsCary Coutant3-3/+11
to __tls_get_addr. * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise. * ChangeLog: Fixed typo in previous ChangeLog entry (version 1.9).
2009-01-28 * version.cc (version_string): Bump to 1.8.Ian Lance Taylor2-1/+3
2009-01-28 * gold.h: Include <cstring> and <stdint.h>.Ian Lance Taylor5-20/+29
* version.cc: Include <cstdio>. * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a warning. * reduced_debug_output.cc (insert_into_vector): Rename from Insert_into_vector; change all callers. Use Swap_unaligned to avoid aliasing issue; remove union since it is unnecessary.
2009-01-28Wrong date and missing space in last checkin.Sriraman Tallam1-1/+1
2009-01-282009-01-20 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam23-138/+1495
* 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 tasks when corresponding options are invoked. (queue_middle_gc_tasks): New function. (queue_middle_tasks): Reorder tasks to allow relocs to be read and processed 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 twice during garbage collection and defer layout of section during the first 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 to Plugin_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 and determine 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 for sections 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 for symbols whose corresponding sections are garbage collected. (Symbol_table::Symbol_table): Add new parameter for the garbage collection 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 objects as garbage. (Symbol_table::add_from_object): Likewise. (Symbol_table::add_from_relobj): When building shared objects, do not treat externally visible symbols as garbage. (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol table 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 virtual function. * x86_64.cc (Target_x86_64::gc_process_relocs): New function. * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2009-01-23* options.h (General_options::gc_sections): Define as a no-op for now.Christopher Faylor3-0/+20
(General_options::no_keep_memory): Ditto. (General_options::Bshareable): Define. * options.cc (General_options::finalize): Honor -Bshareable.