+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 after
+ plugin 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 all
+ references.
+ (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 transfer
+ vector.
+ (Plugin_manager::claim_file): Create plugin object even if
+ plugin did not call the add_symbols callback.
+ (Plugin_obj::get_symbol_resolution_info): Guard against plugin
+ asking for more symbols than were added.
+ * testsuite/Makefile.am (plugin_test_1): Add test case with
+ no global symbols.
+ (empty.syms): New target.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/plugin_test.c (claim_file_hook): Add new debug
+ message. Don't call add_symbols if no globals.
+ (all_symbols_read_hook): Don't provide replacement for empty
+ claimed file.
+
+2008-12-12 Ian Lance Taylor <iant@google.com>
+
+ * target-reloc.h (Default_scan_relocatable_relocs): Only discard
+ r_type == 0 for a local symbol with r_sym == 0.
+ (scan_relocatable_relocs): Pass r_sym to
+ local_non_section_strategy.
+ * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
+ r_sym parameter.
+
+ * configure.ac: Update test for TLS descriptors: they are
+ supported 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 each
+ function, 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 replacement
+ object 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 full
+ prototypes 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_address
+ instead 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, and
+ dynamic_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 function
+ prototype.
+ (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, and
+ dynamic_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 objects
+ is not empty.
+
+2008-10-02 Cary Coutant <ccoutant@google.com>
+
+ * plugin.cc (make_sized_plugin_object): Fix conditional
+ compilation 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 instead
+ of 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_address
+ instead 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_address
+ and return -1ULL.
+ * output.cc (Output_reloc::local_section_offset): Use constant
+ invalid_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 constant
+ invalid_address instead of -1U.
+ (Sized_relobj::relocate_sections): Likewise.
+ * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
+ values for merge sections.
+ * target-reloc.h (relocate_for_relocatable): Use constant
+ invalid_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 claiming
+ files.
+ (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 descriptors
+ abandoned 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 generating
+ new 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 checking
+ for ELF file. Call plugin hooks to claim files.
+ * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
+ from a real object file; force override when processing replacement
+ files.
+ * 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 as
+ undefined.
+ (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 is
+ defined 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_START
+ for 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_ORIGIN
+ in DT_FLAGS_1.
+
2008-09-05 Cary Coutant <ccoutant@google.com>
* fileread.cc (File_read::make_view): Add check for attempt to map