* resolve.cc (Symbol::override_base): Don't override st_type
from plugin placeholder symbols.
(Symbol_table::resolve): Likewise.
(Symbol_table::should_override): Don't complain about TLS mismatch
if the TO symbol is a plugin placeholder.
* testsuite/Makefile.am (plugin_test_tls): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/plugin_test_tls.sh: New test script.
* testsuite/two_file_test_2_tls.cc: New test source.
* testsuite/two_file_test_tls.cc: New test source.
gold/
* layout.cc (Layout::set_segment_offsets): Taking care of the case when
the maximum segment alignment is larger than the page size.
* testsuite/Makefile.am (large_symbol_alignment): Test that Gold
correctly aligns the symbols with large alignemnt.
* testsuite/Makefile.in: Regenerate.
* testsuite/large_symbol_alignment.cc: New file.
Sriraman Tallam <tmsriram@google.com>
* options.h (sort_section): New option.
* output.h (Input_section_sort_section_prefix_special_ordering_compare):
Rename from Input_section_sort_section_name_special_ordering_compare.
(Input_section_sort_section_name_compare): New struct.
* output.cc (Output_section::Input_section_sort_section_name_compare::
operator()): New function.
(Output_section::sort_attached_input_sections): Use new sort function
for .text if --sort-section=name is specified.
* layout.cc (Layout::make_output_section):
Add sorting by name when --sort-section=name is specified.
* testsuite/Makefile.am (text_section_grouping): Test option
--sort-section=name.
* testsuite/Makefile.in: Regenerate.
* testsuite/section_sorting_name.cc: New file.
* testsuite/section_sorting_name.sh: New file.
* symtab.h (Symbol::is_cxx_vtable): New function.
* target-reloc.h (relocate_section): Check for vtable symbol.
* testsuite/Makefile.am (missing_key_func.sh): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/missing_key_func.cc: New test source.
* testsuite/missing_key_func.sh: New test script.
* object.cc (Sized_relobj_file::get_symbol_location_info): Set
type of enclosing symbol.
(Relocate_info::location): Check symbol type when describing symbol.
* object.h (Symbol_location_info): Remove unused line_number;
add enclosing_symbol_type.
* testsuite/debug_msg.sh: Adjust expected output.
PR ld/15365
* layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
ld/
PR ld/15365
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Restrict __ehdr_start's export class to no less than STV_HIDDEN.
ld/testsuite/
PR ld/15365
* ld-elf/ehdr_start.d: Expect __ehdr_start to be STB_LOCAL.
* ld-mips-elf/ehdr_start-1.nd: New test.
* ld-mips-elf/ehdr_start-2.nd: New test.
* ld-mips-elf/ehdr_start-1.ld: New test linker script.
* ld-mips-elf/ehdr_start-2.ld: New test linker script.
* ld-mips-elf/ehdr_start-new.s: New test source.
* ld-mips-elf/ehdr_start-o32.s: New test source.
* ld-mips-elf/mips-elf.exp: Run the new tests.
gold/
* output.cc (Output_section::add_merge_input_section): Allow
to merge sections if the alignment is more than character size.
* merge.h (Output_merge_string::Output_merge_string): Remove
assert.
* merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
only not-null strings. Check the alignment of strings.
* stringpool.h
(Stringpool_template<Stringpool_char>::Stringpool_template): Add
alignment as the argument.
(Stringpool_template<Stringpool_char>::addralign_): New class member.
* stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
Align non-zero length strings according to the addralign_.
(Stringpool_template<Stringpool_char>::set_string_offsets):
Updating offsets according to the given alignment.
* testsuite/Makefile.am (text_section_grouping): Test if string
literals are getting merged.
* testsuite/Makefile.in: Regenerate.
* testsuite/merge_string_literals_1.c: New file.
* testsuite/merge_string_literals_2.c: Ditto.
* testsuite/merge_string_literals.sh: Ditto.
gold/
* gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
* layout.cc (Hash_task): New class.
(Layout::queue_build_id_tasks): New function.
(Layout::write_build_id): Handle single-thread portion of build ID
computation. (In some cases, all of it is single-threaded.) Replace
{sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
functionality in fewer lines of code.
* layout.h (Layout::queue_build_id_tasks): New function declaration.
* options.h (General_options): make "--build-id" default to tree
rather than sha1. Add two new options related to --build-id=tree:
--build-id-chunk-size-for-treehash and
--build-id-min-file-size-for-treehash.
* Makefile.am: add testing of --build-id=tree and related new options
(these tests will be invoked by "make check").
* Makefile.in: Regenerate.
owner when sections are not adjacent and exceed group size.
(Target_powerpc::group_sections): Handle corner case.
(Target_powerpc::Branch_info::make_stub): Handle case where
stub table doesn't exist due to branches in non-exec sections.
(Target_powerpc::Relocate::relocate): Likewise.
* archive.cc (Archive::get_elf_object_for_member): Create the elf
object before calling the plugin claim_file handler. Pass the elf
object of the archive to the plugin. Delete the elf object if the
plugin claims the file.
* symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
is_needed by weak references. Clear version for symbols defined
in as-needed objects that are not needed.
static and public. Add report_err param. Return false for data refs.
(Target_powerpc::rela_dyn_section): New overloaded function.
(Target_powerpc::plt_, iplt_): Elucidate.
(Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
(Output_data_plt_powerpc::do_write): Don't write .iplt.
(Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
(Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
calls. Put ifunc dynamic relocs in irela_dyn_section. Only
push_branch and make_plt_entry for ifunc syms when
reloc_needs_plt_for_ifunc.
(Target_powerpc::Relocate::relocate): Don't use plt entry value
for ifunc unless reloc_needs_plt_for_ifunc.
gold/
* dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
tu_length parameter. Adjust all callers.
* dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
* dwp.cc: Include dwarf.h.
(Section_bounds): New struct type.
(Unit_set): New struct type.
(Dwo_file::Dwo_file): Initialize new data member.
(Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
Combine and rename to...
(Dwo_file::read_unit_index): ...this.
(Dwo_file::sized_read_compunit_index)
(Dwo_file::sized_read_typeunit_index): Combine and rename to...
(Dwo_file::sized_read_unit_index): ...this.
(Dwo_file::copy_section): Remove section_name, is_str_offsets
parameters; add section_id parameter.
(Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
(Dwo_file::add_unit_set): ...this.
(Dwo_file::shndx_map_): Remove.
(Dwo_file::sect_offsets_): New data member.
(Dwp_output_file::Dwp_output_file): Initialize new data members.
(Dwp_output_file::add_section): Rename to...
(Dwp_output_file::add_contribution): ...this.
(Dwp_output_file::add_cu_set): Combine parameters into a struct.
(Dwp_output_file::add_tu_set): Likewise.
(Dwp_output_file::Contribution): New type.
(Dwp_output_file::Section::contributions): New data member.
(Dwp_output_file::Cu_or_tu_set): Remove.
(Dwp_output_file::Section::Section): New ctor.
(Dwp_output_file::Dwp_index::Shndx_pool): Remove.
(Dwp_output_file::Dwp_index::Section_table): New type.
(Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
(Dwp_output_file::Dwp_index::enter_set): Change type of "set"
parameter.
(Dwp_output_file::Dwp_index::shndx_pool): Remove.
(Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
(Dwp_output_file::Dwp_index::section_table): New member function.
(Dwp_output_file::Dwp_index::section_table_end): New member function.
(Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
(Dwp_output_file::Dwp_index::section_table_rows): New member function.
(Dwp_output_file::Dwp_index::section_table_cols): New member function.
(Dwp_output_file::Dwp_index::shndx_pool_): Remove.
(Dwp_output_file::Dwp_index::section_table_): New data member.
(Dwp_output_file::Dwp_index::section_mask_): New data member.
(Dwp_output_file::add_output_section): New member function.
(Dwp_output_file::write_new_section): New member function.
(Dwp_output_file::write_contributions): New member function.
(Dwp_output_file::section_id_map_): New data member.
(class Dwo_id_info_reader): Remove.
(class Unit_reader): New class.
(get_dwarf_section_name): New function.
(Dwo_file::read_executable): Adjust initializations of class data.
(Dwo_file::read): Add support for v2 package file format.
(Dwo_file::read_unit_index): Likewise.
(Dwo_file::sized_read_unit_index): Likewise.
(Dwo_file::copy_section): Likewise.
(Dwo_file::add_unit_set): Likewise.
(Dwp_output_file::add_output_section): Likewise.
(Dwp_output_file::add_contribution): Likewise.
(Dwp_output_file::Dwp_index::find_or_add): Use row index to check
for empty slot.
(Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
file format.
(Dwp_output_file::Dwp_index::grow): Use row index to check for empty
slot.
(Dwp_output_file::initialize): Remove unused function.
(Dwp_output_file::finalize): Add support for v2 package file format.
(Dwp_output_file::write_index): Likewise.
* gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
function prototype.
* dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
function into class definition in header file.
(Dwarf_info_reader::warn_corrupt_debug_section): New function.
* dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
New function.
(Dwarf_info_reader::check_buffer): Move here from .cc file.
* target.cc (Target::do_plt_fde_location): New function.
* ehframe.h (class FDE): Add post_map field to u_.from_linker,
accessor function, and constructor param.
(struct Post_fde, Post_fdes): Declare.
(Cie::write): Add post_fdes param.
* ehframe.cc (Fde::write): Use plt_fde_location.
(struct Post_fde): Define.
(Cie::write): Stash FDEs added post merge mapping.
(Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
(Eh_frame::do_sized_write): Arrange to write post map FDES after
other FDEs.
* powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
(Target_powerpc::has_glink): New function.
(Target_powerpc::do_relax): Add eh_frame info for stubs.
(struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
glink_eh_frame_fde_32, default_fde): New data.
(Stub_table::eh_frame_added_): New var.
(Stub_table::find_long_branch_entry, stub_address, stub_offset):
Make const.
(Stub_table::add_eh_frame): New function.
(Output_data_glink::add_eh_frame): New function.
(Target_powerpc::make_glink_section): Call add_eh_frame.
2013-01-24 Sriraman Tallam <tmsriram@google.com>
* layout.cc (Layout::layout): Check for option text_reorder.
(Layout::make_output_section): Ditto.
* options.h (text_reorder): New option.
* output.cc (Input_section_sort_compare): Remove special ordering
of section names.
(Output_section::
Input_section_sort_section_name_special_ordering_compare::
operator()): New function.
(Output_section::sort_attached_input_sections): Use new sort function
for .text.
* output.h (Input_section_sort_section_name_special_ordering_compare):
New struct.
* testsuite/Makefile.am (text_section_grouping): Test option
--no-text-reorder
* testsuite/Makefile.in: Regenerate.
* testsuite/text_section_grouping.sh: Check order of functions without
default text reordering.