* target.h (Target::plt_address_for_global): New function.
(Target::plt_address_for_local): New function.
(Target::plt_section_for_global): Remove.
(Target::plt_section_for_local): Remove.
(Target::do_plt_address_for_global): New virtual function.
(Target::do_plt_address_for_local): New virtual function.
(Target::do_plt_section_for_global): Remove.
(Target::do_plt_section_for_local): Remove.
(Target::register_global_plt_entry): Add Symbol_table and Layout
parameters.
* output.cc (Output_data_got::Got_entry::write): Use
plt_address_for_global and plt_address_for_local.
* layout.cc (Layout::add_target_dynamic_tags): Use size and
address of output section.
* i386.cc (class Output_data_plt_i386): Add irelative_rel_,
got_irelative_, and irelative_count_ fields. Update
declarations.
(Output_data_plt_i386::has_irelative_section): New function.
(Output_data_plt_i386::entry_count): Add irelative_count_.
(Output_data_plt_i386::set_final_data_size): Likewise.
(class Target_i386): Add got_irelative_ and rel_irelative_
fields. Update declarations.
(Target_i386::Target_i386): Initialize new fields.
(Target_i386::do_plt_address_for_global): New function replacing
do_plt_section_for_global.
(Target_i386::do_plt_address_for_local): New function replacing
do_plt_section_for_local.
(Target_i386::got_section): Create got_irelative_.
(Target_i386::rel_irelative_section): New function.
(Output_data_plt_i386::Output_data_plt_i386): Initialize new
fields. Don't define __rel_iplt_{start,end}.
(Output_data_plt_i386::add_entry): Add symtab and layout
parameters. Change all callers. Use different PLT and GOT for
IFUNC symbols.
(Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
layout parameters. Change all callers. Use different PLT and
GOT.
(Output_data_plt_i386::rel_tls_desc): Fix formatting.
(Output_data_plt_i386::rel_irelative): New function.
(Output_data_plt_i386::address_for_global): New function.
(Output_data_plt_i386::address_for_local): New function.
(Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
IRELATIVE GOT when changing IFUNC GOT entries.
(Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
reloc.
(Target_i386::do_finalize_sections): Create the __rel_iplt symbols
if we didn't create an IRELATIVE GOT.
(Target_i386::Relocate::relocate): Use plt_address_for_global and
plt_address_for_local.
(Target_i386::do_dynsym_value): Use plt_address_for_global.
* x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
got_irelative_, and irelative_count_ fields. Update
declarations.
(Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
Initialize new fields. Remove symtab parameter. Change all
callers.
(Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
irelative_count_.
(Output_data_plt_x86_64::has_irelative_section): New function.
(Output_data_plt_x86_64::entry_count): Add irelative_count_.
(class Target_x86_64): Add got_irelative_ and rel_irelative_
fields. Update declarations.
(Target_x86_64::Target_x86_64): Initialize new fields.
(Target_x86_64::do_plt_address_for_global): New function replacing
do_plt_section_for_global.
(Target_x86_64::do_plt_address_for_local): New function replacing
do_plt_section_for_local.
(Target_x86_64::got_section): Create got_irelative_.
(Target_x86_64::rela_irelative_section): New function.
(Output_data_plt_x86_64::init): Remove symtab parameter. Change
all callers. Don't create __rel_iplt_{start,end}.
(Output_data_plt_x86_64::add_entry): Add symtab and layout
parameters. Change all callers. Use different PLT and GOT for
IFUNC symbols.
(Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
layout parameters. Change all callers. Use different PLT and
GOT.
(Output_data_plt_x86_64::add_relocation): Add symtab and layout
parameters. Change all callers. Use different PLT and GOT for
IFUNC symbols.
(Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
(Output_data_plt_x86_64::rela_irelative): New function.
(Output_data_plt_x86_64::address_for_global): New function.
(Output_data_plt_x86_64::address_for_local): New function.
(Output_data_plt_x86_64::set_final_data_size): Likewise.
(Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
(Target_x86_64::init_got_plt_for_update): Create got_irelative_.
(Target_x86_64::register_global_plt_entry): Add symtab and layout
parameters.
(Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
reloc.
(Target_x86_64::do_finalize_sections): Create the __rela_iplt
symbols if we didn't create an IRELATIVE GOT.
(Target_x86_64::Relocate::relocate): Use plt_address_for_global and
plt_address_for_local.
(Target_x86_64::do_dynsym_value): Use plt_address_for_global.
* testsuite/ifuncvar1.c: New test file.
* testsuite/ifuncvar2.c: New test file.
* testsuite/ifuncvar3.c: New test file.
* testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
(ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
(ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
(ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
* testsuite/Makefile.in: Rebuild.
input file index to Script_info ctor.
(Sized_incremental_binary::do_file_has_changed): Find the
command-line argument for files named in scripts.
* incremental.h (Script_info::Script_info): New ctor
with input file index.
(Script_info::input_file_index): New function.
(Script_info::input_file_index_): New data member.
(Incremental_binary::get_library): Add const.
(Incremental_binary::get_script_info): Add const.
* readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
* testsuite/Makefile.am (incremental_test_5): New test case.
(incremental_test_6): New test case.
* testsuite/Makefile.in: Regenerate.
--incremental-patch option.
* layout.cc (Free_list::allocate): Extend allocation beyond original
end if enabled.
(Layout::make_output_section): Mark sections that should get
patch space.
* options.cc (parse_percent): New function.
* options.h (parse_percent): New function.
(DEFINE_percent): New macro.
(General_options): Add --incremental-patch option.
* output.cc (Output_section::Output_section): Initialize new data
members.
(Output_section::add_input_section): Print section name when out
of patch space.
(Output_section::add_output_section_data): Likewise.
(Output_section::set_final_data_size): Add patch space when
doing --incremental-full.
(Output_section::do_reset_address_and_file_offset): Remove patch
space.
(Output_segment::set_section_list_addresses): Print debug output
only if --incremental-update.
* output.h (Output_section::set_is_patch_space_allowed): New function.
(Output_section::is_patch_space_allowed_): New data member.
(Output_section::patch_space_): New data member.
* parameters.cc (Parameters::incremental_full): New function.
* parameters.h (Parameters::incremental_full): New function
* testsuite/Makefile.am (incremental_test_2): Add test for
--incremental-patch option.
* testsuite/Makefile.in: Regenerate.
* testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
(t18): Remove function body.
PR gold/12771
* arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
Arm_Address type for relocation result.
(Arm_relocate_functions::abs16): Use unaligned access. Also fix
overflow check.
(Arm_relocate_functions::abs32): Use unaligned access.
(Arm_relocate_functions::rel32): Ditto.
(Arm_relocate_functions::prel31): Ditto.
(Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
* testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
static data relocations.
* testsuite/Makefile.in: Regnerate.
* testsuite/arm_unaligned_reloc.{s,sh}: New files.
PR gold/12952
* resolve.cc (Symbol::override_base_with_special): Don't override
the version if the overriding symbol has a different name.
* dynobj.cc (Versions::add_def): Add dynpool parameter. Change
all callers. If we give an error about an undefined version,
define the base version if necessary.
* dynobj.h (class Versions): Update declaration.
* testsuite/weak_alias_test_5.cc: New file.
* testsuite/weak_alias_test.script: New file.
* testsuite/weak_alias_test_main.cc: Check that versioned_symbol
and versioned_alias have the right value, and call t2.
* testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
weak_alias_test_5.so.
(weak_alias_test_LDADD): Likewise.
(weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
* testsuite/Makefile.in: Rebuild.
* configure.ac: Test whether static linking works, setting
the automake conditional HAVE_STATIC.
* testsuite/Makefile.am: Disable tests using -static if
HAVE_STATIC is not true.
* configure, testsuite/Makefile.in: Rebuild.
* target-select.cc (Target_selector::Target_selector): Add
emulation parameter. Change all callers.
(select_target_by_bfd_name): Rename from select_target_by_name.
Change all callers.
(select_target_by_emulation): New function.
(supported_emulation_names): New function.
* target-select.h (class Target_selector): Add emulation_ field.
Update declarations.
(Target_selector::recognize_by_bfd_name): Rename from
recognize_by_name. Change all callers.
(Target_selector::supported_bfd_names): Rename from
supported_names. Change all callers.
(Target_selector::recognize_by_emulation): New function.
(Target_selector::supported_emulations): New function.
(Target_selector::emulation): New function.
(Target_selector::do_recognize_by_bfd_name): Rename from
do_recognize_by_name. Change all callers.
(Target_selector::do_supported_bfd_names): Rename from
do_supported_names. Change all callers.
(Target_selector::do_recognize_by_emulation): New function.
(Target_selector::do_supported_emulations): New function.
(select_target_by_bfd_name): Change name in declaration.
(select_target_by_emulation): Declare.
(supported_emulation_names): Declare.
* parameters.cc (parameters_force_valid_target): Try to find
target based on emulation from -m option.
* options.h (class General_options): Change doc string for -m.
* options.cc (help): Print emulations.
(General_options::parse_V): Likewise.
* freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
Add emulation parameter. Change all callers.
* arm.cc (Arm_relocate_functions::thm_jump8,
Arm_relocate_functions::thm_jump11): Use a wider signed
type to compute offset.
* testsuite/Makefile.am: Add new tests arm_thm_jump11 and
arm_thm_jump8.
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_branch_in_range.sh: Check test results of
arm_thm_jump11 and arm_thm_jump8.
* testsuite/arm_thm_jump11.s: New test source file.
* testsuite/arm_thm_jump11.t: New linker script.
* testsuite/arm_thm_jump8.s: New test source file.
* testsuite/arm_thm_jump8.t: New linker script.
(ctors_sections_in_init_array): New static variable.
(Layout::is_ctors_in_init_array): New function.
(Layout::layout): Add entry to ctors_sections_in_init_array if
appropriate.
* layout.h (class Layout): Declare is_ctors_in_init_array.
* reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
is_ctors_reverse_view is set.
(Sized_relobj_file::write_sections): Add layout parameter. Change
all callers. Set is_ctors_reverse_view field of View_size.
(Sized_relobj_file::reverse_words): New function.
* object.h (Sized_relobj_file::View_size): Add
is_ctors_reverse_view field.
(class Sized_relobj_file): Update declarations.
* testsuite/initpri3.c: New test.
* testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
initpri3b.
(initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
(initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
(initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
(initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
* testsuite/Makefile.in: Rebuild.
(debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
(debug_msg_cdebug.err): New targets.
* testsuite/Makefile.in: Regenerate.
* testsuite/debug_msg.sh: Check output of link with compressed debug.
Fix checks for link with shared library.
* arm.cc (Arm_output_section::append_text_sections_to_list): Do not
skip empty text sections.
* testsuite/arm_exidx_test.s: Test handling of an empty text section.
* options.h (class General_options): Add --ctors-in-init-array.
* layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
friends as SHT_PROGBITS for merging sections.
(Layout::layout): Remove special handling of .init_array and
friends. Don't sort if doing relocatable link. Sort for .ctors
and .dtors if ctors_in_init_array.
(Layout::make_output_section): Force correct section types for
.init_array and friends. Don't sort if doing relocatable link,
Don't sort .ctors and .dtors if ctors_in_init_array.
(Layout::section_name_mapping): Remove .ctors. and .dtorso.
(Layout::output_section_name): Add relobj parameter. Change all
callers. Handle .ctors. and .dtors. in code rather than table.
Handle .ctors and .dtors if ctors_in_init_array.
(Layout::match_file_name): New function, moved from output.cc.
* layout.h (class Layout): Update declarations.
* output.cc: Include "layout.h".
(Input_section_sort_entry::get_priority): New function.
(Input_section_sort_entry::match_file_name): Just call
Layout::match_file_name.
(Output_section::Input_section_sort_init_fini_compare::operator()):
Handle .ctors and .dtors. Sort by explicit priority rather than
by name.
* configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
* testsuite/initpri2.c: New test.
* testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
(check_PROGRAMS): Add initpri2.
(initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
(initpri2_LDFLAGS, initpri2_LDADD): New variables.
* configure, testsuite/Makefile.in: Rebuild.
incremental_test_4.
* testsuite/Makefile.in: Regenerate.
* testsuite/two_file_test_1_v1.cc: New test source file.
* testsuite/two_file_test_1b_v1.cc: New test source file.
* testsuite/two_file_test_2_v1.cc: New test source file.
info; adjust display of GOT entries.
* incremental.cc (Sized_incremental_binary::setup_readers): Allocate
vector of input objects; remove file_status_.
(Sized_incremental_binary::do_reserve_layout): Remove file_status_.
(Sized_incremental_binary::do_process_got_plt): Adjust calls to
got_plt reader; call target hooks to reserve GOT entries.
(Output_section_incremental_inputs::set_final_data_size): Adjust size
of input file info header and GOT info entry.
(Output_section_incremental_inputs::write_info_blocks): Write dynamic
relocation info.
(Got_plt_view_info::got_descriptor): Remove.
(Got_plt_view_info::sym_index): New data member.
(Got_plt_view_info::input_index): New data member.
(Local_got_offset_visitor::visit): Write input file index.
(Global_got_offset_visitor::visit): Write 0 for input file index.
(Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
with sym_index and input_index.
(Output_section_incremental_inputs::write_got_plt): Adjust size of
incremental info GOT entry; replace got_descriptor with input_index.
(Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
map from input file index to object.
(Sized_relobj_incr::do_layout): Replace direct data member reference
with accessor function.
(Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
* incremental.h (Incremental_input_entry_reader::get_symbol_offset):
Adjust size of input file info header.
(Incremental_input_entry_reader::get_first_dyn_reloc): New function.
(Incremental_input_entry_reader::get_dyn_reloc_count): New function.
(Incremental_input_entry_reader::get_input_section): Adjust size of
input file info header.
(Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
of incremental info GOT entry.
(Incremental_got_plt_reader::get_got_desc): Remove.
(Incremental_got_plt_reader::get_got_symndx): New function.
(Incremental_got_plt_reader::get_got_input_index): New function.
(Sized_incremental_binary::Sized_incremental_binary): Remove
file_status_; add input_objects_.
(Sized_incremental_binary::~Sized_incremental_binary): Remove.
(Sized_incremental_binary::set_file_is_unchanged): Remove.
(Sized_incremental_binary::file_is_unchanged): Remove.
(Sized_incremental_binary::set_input_object): New function.
(Sized_incremental_binary::input_object): New function.
(Sized_incremental_binary::file_status_): Remove.
(Sized_incremental_binary::input_objects_): New data member.
(Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
references.
(Sized_relobj_incr::invalid_address): Move to base class.
(Sized_relobj_incr::is_output_section_offset_invalid): Move to base
class.
(Sized_relobj_incr::do_output_section_offset): Likewise.
(Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
(Sized_relobj_incr::section_offsets_): Likewise.
* object.cc (Sized_relobj::do_for_all_local_got_entries): New
function.
(Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
(Sized_relobj_file::layout_section): Replace refs to section_offsets_
with accessor function.
(Sized_relobj_file::do_layout): Likewise.
(Sized_relobj_file::do_layout_deferred_sections): Likewise.
(Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
(Sized_relobj_file::compute_final_local_value): Replace refs to
section_offsets_ with accessor function.
(Sized_relobj_file::do_finalize_local_symbols): Likewise.
* object.h (Relobj::Relobj): Initialize new data members.
(Relobj::add_dyn_reloc): New function.
(Relobj::first_dyn_reloc): New function.
(Relobj::dyn_reloc_count): New function.
(Relobj::first_dyn_reloc_): New data member.
(Relobj::dyn_reloc_count_): New data member.
(Sized_relobj): Rename Sized_relobj_base to this; adjust all
references.
(Sized_relobj::Address): New typedef.
(Sized_relobj::invalid_address): Move here from child class.
(Sized_relobj::Sized_relobj): Initialize new data members.
(Sized_relobj::sized_relobj): New function.
(Sized_relobj::is_output_section_offset_invalid): Move here from
child class.
(Sized_relobj::get_output_section_offset): Likewise.
(Sized_relobj::local_has_got_offset): Likewise.
(Sized_relobj::local_got_offset): Likewise.
(Sized_relobj::set_local_got_offset): Likewise.
(Sized_relobj::do_for_all_local_got_entries): Likewise.
(Sized_relobj::clear_got_offsets): New function.
(Sized_relobj::section_offsets): Move here from child class.
(Sized_relobj::do_output_section_offset): Likewise.
(Sized_relobj::do_set_section_offset): Likewise.
(Sized_relobj::Local_got_offsets): Likewise.
(Sized_relobj::local_got_offsets_): Likewise.
(Sized_relobj::section_offsets_): Likewise.
(Sized_relobj_file): Rename Sized_relobj to this; adjust all
references.
(Sized_relobj_file::is_output_section_offset_invalid): Move to base
class.
(Sized_relobj_file::sized_relobj): New function
(Sized_relobj_file::local_has_got_offset): Move to base class.
(Sized_relobj_file::local_got_offset): Likewise.
(Sized_relobj_file::set_local_got_offset): Likewise.
(Sized_relobj_file::get_output_section_offset): Likewise.
(Sized_relobj_file::do_for_all_local_got_entries): Likewise.
(Sized_relobj_file::do_output_section_offset): Likewise.
(Sized_relobj_file::do_set_section_offset): Likewise.
(Sized_relobj_file::Local_got_offsets): Likewise.
(Sized_relobj_file::local_got_offsets_): Likewise.
(Sized_relobj_file::section_offsets_): Likewise.
* output.cc (Output_reloc::Output_reloc): Adjust type of relobj
(all constructors).
(set_needs_dynsym_index): Convert relobj to derived class pointer.
(Output_reloc::get_symbol_index): Likewise.
(Output_reloc::local_section_offset): Likewise.
(Output_reloc::get_address): Likewise.
(Output_reloc::symbol_value): Likewise.
(Output_data_got::reserve_slot): Move to class definition.
(Output_data_got::reserve_local): New function.
(Output_data_got::reserve_slot_for_global): Remove.
(Output_data_got::reserve_global): New function.
* output.h (Output_reloc::Output_reloc): Adjust type of relobj
(all constructors, two instantiations).
(Output_reloc::get_relobj): New function (two instantiations).
(Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
(Output_data_reloc_base::add): Convert relobj to derived class pointer.
(Output_data_reloc::add_global): Adjust type of relobj.
(Output_data_reloc::add_global_relative): Likewise.
(Output_data_reloc::add_symbolless_global_addend): Likewise.
(Output_data_reloc::add_local): Likewise.
(Output_data_reloc::add_local_relative): Likewise.
(Output_data_reloc::add_symbolless_local_addend): Likewise.
(Output_data_reloc::add_local_section): Likewise.
(Output_data_reloc::add_output_section): Likewise.
(Output_data_reloc::add_absolute): Likewise.
(Output_data_reloc::add_target_specific): Likewise.
(Output_data_got::reserve_slot): Move definition here.
(Output_data_got::reserve_local): New function.
(Output_data_got::reserve_global): New function.
* reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
section_offsets_ with accessor function.
(Sized_relobj_file::write_sections): Likewise.
(Sized_relobj_file::do_relocate_sections): Likewise.
* target.h (Sized_target::reserve_local_got_entry): New function.
(Sized_target::reserve_global_got_entry): New function.
* x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
(Target_x86_64::reserve_global_got_entry): New function.
(Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
* incremental-dump.cc (dump_incremental_inputs): Mask high-order
bit when checking got_type.
* incremental.cc (Sized_incremental_binary::setup_readers):
Store symbol table and string table locations; initialize bit vector
of file status flags.
(Sized_incremental_binary::do_reserve_layout): Set bit flag for
unchanged files.
(Sized_incremental_binary::do_process_got_plt): New function.
(Sized_incremental_binary::get_symtab_view): Use stored locations.
(Output_section_incremental_inputs::set_final_data_size): Record
file index for each input file.
(Output_section_incremental_inputs::write_got_plt): Store file index
instead of input entry offset for each GOT entry.
* incremental.h
(Incremental_input_entry::Incremental_input_entry): Initialize new
data member.
(Incremental_input_entry::set_offset): Store file index.
(Incremental_input_entry::get_file_index): New function.
(Incremental_input_entry::file_index_): New data member.
(Incremental_binary::process_got_plt): New function.
(Incremental_binary::do_process_got_plt): New function.
(Sized_incremental_binary::Sized_incremental_binary): Initialize new
data members.
(Sized_incremental_binary::~Sized_incremental_binary): New destructor.
(Sized_incremental_binary::set_file_is_unchanged): New function.
(Sized_incremental_binary::file_is_unchanged): New function.
(Sized_incremental_binary::do_process_got_plt): New function.
(Sized_incremental_binary::file_status_): New data member.
(Sized_incremental_binary::main_symtab_loc_): New data member.
(Sized_incremental_binary::main_strtab_loc_): New data member.
* output.cc (Output_data_got::Got_entry::write): Add case
RESERVED_CODE.
(Output_data_got::add_global): Call add_got_entry.
(Output_data_got::add_global_plt): Likewise.
(Output_data_got::add_global_with_rel): Likewise.
(Output_data_got::add_global_with_rela): Likewise.
(Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
(Output_data_got::add_global_pair_with_rela): Likewise.
(Output_data_got::add_local): Call add_got_entry.
(Output_data_got::add_local_plt): Likewise.
(Output_data_got::add_local_with_rel): Likewise.
(Output_data_got::add_local_with_rela): Likewise.
(Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
(Output_data_got::add_local_pair_with_rela): Likewise.
(Output_data_got::reserve_slot): New function.
(Output_data_got::reserve_slot_for_global): New function.
(Output_data_got::add_got_entry): New function.
(Output_data_got::add_got_entry_pair): New function.
(Output_section::add_output_section_data): Edit FIXME.
* output.h
(Output_section_data_build::Output_section_data_build): New
constructor with size parameter.
(Output_data_space::Output_data_space): Likewise.
(Output_data_got::Output_data_got): Initialize new data member; new
constructor with size parameter.
(Output_data_got::add_constant): Call add_got_entry.
(Output_data_got::reserve_slot): New function.
(Output_data_got::reserve_slot_for_global): New function.
(class Output_data_got::Got_entry): Add RESERVED_CODE.
(Output_data_got::add_got_entry): New function.
(Output_data_got::add_got_entry_pair): New function.
(Output_data_got::free_list_): New data member.
* target.h (Sized_target::init_got_plt_for_update): New function.
(Sized_target::register_global_plt_entry): New function.
* x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
Initialize new data member; call init; add constructor with PLT count.
(Output_data_plt_x86_64::init): New function.
(Output_data_plt_x86_64::add_relocation): New function.
(Output_data_plt_x86_64::reserve_slot): New function.
(Output_data_plt_x86_64::free_list_): New data member.
(Target_x86_64::init_got_plt_for_update): New function.
(Target_x86_64::register_global_plt_entry): New function.
(Output_data_plt_x86_64::add_entry): Allocate from free list for
incremental updates.
(Output_data_plt_x86_64::add_relocation): New function.
* testsuite/object_unittest.cc (Object_test): Set default options.
* arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
flag of a SHT_ARM_EXIDX section.
* testsuite/Makefile.am (arm_exidx_test): New test rules.
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_exidx_test.s: New file.
* testsuite/arm_exidx_test.sh: Same.
but mark earlier ones as non-canonical
(offset_to_iterator): Update search target and example
(do_addr2line): Return extra lines in a vector*
(format_file_lineno): Extract from do_addr2line
(one_addr2line): Add vector* out-param
* dwarf_reader.h (Offset_to_lineno_entry): New field recording
when a lineno entry appeared last for its instruction
(Dwarf_line_info): Add vector* out-param
* object.cc (Relocate_info): Pass NULL for the vector* out-param
* symtab.cc (Odr_violation_compare): Include the lineno in the
comparison again.
(linenos_from_loc): New. Combine the canonical line for an
address with its other lines.
(True_if_intersect): New. Helper functor to make
std::set_intersection a query.
(detect_odr_violations): Compare sets of lines instead of just
one line for each function. This became less deterministic, but
has fewer false positives.
* symtab.h: Declarations.
* testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
mix an optimized and non-optimized object in the same binary
(odr_violation2.so): Same.
* testsuite/Makefile.in: Regenerate from Makefile.am.
* testsuite/debug_msg.cc (main): Make OdrDerived classes.
* testsuite/debug_msg.sh: Update line numbers and add
assertions.
* testsuite/odr_violation1.cc: Use OdrDerived, in a
non-optimized context.
* testsuite/odr_violation2.cc: Make sure Ordering::operator()
isn't inlined, and use OdrDerived in an optimized context.
* testsuite/odr_header1.h: Defines OdrDerived, where
optimization will change the
first-instruction-in-the-destructor's file and line number.
* testsuite/odr_header2.h: Defines OdrBase.
* x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
for R_X86_64_32 and R_X86_64_PC32.
* testsuite/Makefile.am (ver_matching_def.so): Depend on and use
ver_matching_def_pic.o.
(ver_matching_def_pic.o): New target.
segment that has been aligned for relro.
* output.cc (Output_segment::set_section_addresses): Change signature;
adjust all callers. Account for alignment when totalling
size of relro sections.
* output.h (Output_segment::set_section_addresses): Change signature.
* testsuite/Makefile.am (relro_test.sh, relro_test.stdout): New
targets.
* testsuite/Makefile.in: Regenerate.
* testsuite/relro_test.cc: Add alignment attributes to test proper
alignment of relro sections when padding is necessary.
* testsuite/relro_test.sh: New script.
(debug_string_to_enum): Add DEBUG_INCREMENTAL).
* gold.cc (queue_initial_tasks): Check parameters for incremental link
mode.
* incremental.cc (report_command_line): Ignore all forms of
--incremental.
* layout.cc (Layout::Layout): Check parameters for incremental link
mode.
* options.cc (General_options::parse_incremental): New function.
(General_options::parse_no_incremental): New function.
(General_options::parse_incremental_full): New function.
(General_options::parse_incremental_update): New function.
(General_options::incremental_mode_): New data member.
(General_options::finalize): Check incremental_mode_.
* options.h (General_options): Update help text for --incremental.
Add --no-incremental, --incremental-full, --incremental-update.
(General_options::Incremental_mode): New enum type.
(General_options::incremental_mode): New function.
(General_options::incremental_mode_): New data member.
* parameters.cc (Parameters::incremental_mode_): New data member.
(Parameters::set_options): Set incremental_mode_.
(Parameters::set_incremental_full): New function.
(Parameters::incremental): New function.
(Parameters::incremental_update): New function.
(set_parameters_incremental_full): New function.
* parameters.h (Parameters::set_incremental_full): New function.
(Parameters::incremental): New function.
(Parameters::incremental_update): New function.
(Parameters::incremental_mode_): New data member.
(set_parameters_incremental_full): New function.
* plugin.cc (Plugin_manager::add_input_file): Check parameters for
incremental link mode.
* reloc.cc (Sized_relobj::do_read_relocs): Likewise.
(Sized_relobj::do_relocate_sections): Likewise.
* testsuite/Makefile.am (incremental_test): Use --incremental-full
option.
* testsuite/Makefile.in: Regenerate.
* testsuite/incremental_test.sh: Filter all forms of --incremental.
current_lma_offset_ field. Rename current_vma_offset_ to
current_offset_. Add last_section_ field.
(Memory_region::get_current_vma_address): Rename to
get_current_address.
(Memory_region::get_current_lma_address): Delete.
(Memory_region::increment_vma_offset): Rename to
increment_offset.
(Memory_region::increment_lma_offset): Delete.
(Memory_region::attributes_compatible): New method. Returns
true if the provided section is compatible with the region.
(Memory_region::get_last_section): New method. Returns the last
section to use the region.
(Memory_region::set_last_section): New method. Stores the last
section to use the region.
(Script_sections::block_in_region): New method. Returns true if
a block of memory is contained within a region.
(Script_sections::find_memory_region): New method. Locates a
memory region to be used to set a VMA or LMA address.
(Output_section_definition::set_section_addresses): Add code to
check for addresses set by memory regions.
(Output_segment::set_section_addresses): Remove memory region
walking code.
(Script_sections::create_segment): Add a warning if a header
segment is created outside of any region.
* script-sections.h (class Script_sections): Add prototypes for
find_memory_region and block_in_region methods.
* testsuite/memory_test.s: Use .long instead of .word.
* testsuite/memory_test.t: Add some more output sections.
* testsuite/memory_test.sh: Update expected output.
* ld.texinfo: Update description of computation of VMA and LMA
addresses for output sections.
* ld-scripts/rgn-at5.t: Add some more output sections.
* ld-scripts/rgn-at5.d: Update expected output.
* arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
defintion if relocation uses GOT entries of the symbol.
* testsuite/icf_safe_test.sh: Fix test.
* testsuite/icf_safe_so_test.sh: Fix test.