aboutsummaryrefslogtreecommitdiff
path: root/gold
AgeCommit message (Collapse)AuthorFilesLines
2015-03-09Fix failure in exception_static_test.Cary Coutant6-40/+91
Because the __EH_FRAME_BEGIN__ symbol is provided in an empty .eh_frame section in crtbeginT.o, if crt1.o has a non-empty .eh_frame section, we place all optimized .eh_frame sections into the output section ahead of the __EH_FRAME_BEGIN__ symbol, which breaks EH for statically-linked binaries. This patch fixes the problem by delaying the attachment of the optimized .eh_frame sections to the output section until we see the end marker section (or to the end of pass 1 if we never see an end marker). gold/ PR gold/14675 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type; return enum indicating whether .eh_frame section is empty, optimizable, unrecognized, or an end marker. Adjust explicit instantiations. * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type. (Eh_frame::add_ehframe_input_section): Change return type. * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section. * layout.cc (Layout::layout_eh_frame): Don't add optimized sections to the .eh_frame output section until we see the end marker. (Layout::finalize_eh_frame_section): New. * layout.h: (Layout::finalize_eh_frame_section): New.
2015-03-05Remove typename on elfcpp::Elf_types<size>::Elf_AddrH.J. Lu2-4/+9
GCC 4.2 complains: binutils/gold/object.cc:3261: error: using ‘typename’ outside of template This patch removes typename. It works with both GCC 4.2 and 4.8. * output.cc (Relobj::initialize_input_to_output_map<size>): Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
2015-03-04Fix a race condition when setting default target for ARM targets.Cary Coutant2-4/+10
gold/ * parameters.cc (Parameters::set_target_once): Call Target::select_as_default_target just once from here... (set_parameters_target): ...instead of from here.
2015-03-04Remove empty class Merge_map.Rafael Ávila de Espíndola10-208/+199
2015-03-02 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> * ehframe.cc (Cie::set_output_offset): Pass in and use a Output_section_data instead of a Merge_map. (Eh_frame::Eh_frame): Don't initialize merge_map_. (Eh_frame::read_cie): Use add_merge_mapping instead of Merge_map::add_mapping. (Eh_frame::read_fde): Ditto. (Eh_frame::set_final_data_size): Use this instead of this->merge_map_. (Eh_frame::do_output_offset): Use merge_output_offset istead of merge_map_->get_output_offset. (Eh_frame::do_is_merge_section_for): Delete. * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data instead of a Merge_map. (Cie::set_output_offset): Pass in a Output_section_data instead of a Merge_map. (Eh_frame::do_is_merge_section_for): Delete. (Eh_frame::merge_map_): Delete. * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in and use a Output_section_data instead of a Merge_map. (Object_merge_map::add_mapping): Ditto. (Object_merge_map::get_output_offset): Remove the merge_map argument. (Object_merge_map::is_merge_section_for): Pass in and use a Output_section_data instead of a Merge_map. (Merge_map): Delete. (Output_merge_base::do_output_offset): Use merge_output_offset instead of merge_map_.get_output_offset. (Output_merge_base::do_is_merge_section_for): Delete. (Output_merge_data::do_add_input_section): Use object->add_merge_mapping instead of add_mapping. (Output_merge_string<Char_type>::finalize_merged_data): Ditto. * merge.h (Merge_map): Delete forward declaration. (Object_merge_map::add_mapping): Pass in and use a Output_section_data instead of a Merge_map. (Object_merge_map::get_output_offset): Remove the merge_map argument. (Object_merge_map::is_merge_section_for): Pass in and use a Output_section_data instead of a Merge_map. (Input_merge_map::Object_merge_map::merge_map): Replace with output_data. (Object_merge_map::get_or_make_input_merge_map): Pass in and use a Output_section_data instead of a Merge_map. (Merge_map): Delete. (Output_merge_base::Output_merge_base): Don't initialize merge_map_. (Output_merge_base::do_is_merge_section_for): Delete. (Output_merge_base::add_mapping): Delete. (Output_merge_base::merge_map_): Delete. * object.cc (Relobj::initialize_input_to_output_map): New. (Relobj::initialize_input_to_output_map): New. (Relobj::merge_output_offset): New. (Relobj::is_merge_section_for): New. (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64 bits. * object.h (Relobj::merge_map): Delete. (initialize_input_to_output_map): New. (set_merge_map): Delete. (add_merge_mapping): New. (merge_output_offset): New. (is_merge_section_for): New. * output.cc (Output_section::Input_section::is_merge_section_for): Use object->is_merge_section_for. * output.h (Output_section_data::is_merge_section_for): Delete. (Output_section_data::do_is_merge_section_for): Delete. * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map): Use object->initialize_input_to_output_map. (Merged_symbol_value<size>::value_from_output_section): Use object->merge_output_offset.
2015-03-02Fix crash when processing merge section with entsize of 0.Cary Coutant2-0/+10
2015-02-04 Peter Collingbourne <pcc@google.com> Cary Coutant <ccoutant@google.com> gold/ * output.cc (Output_section::add_merge_input_section): Do not attempt to merge sections with an entsize of 0.
2015-03-02Fix an internal error in do_print_to_mapfile on Arm.Cary Coutant2-0/+10
2015-02-02 Khem Raj <raj.khem@gmail.com> gold/ * attributes.h (class Output_attributes_section_data ): Add do_print_to_mapfile function.
2015-02-24PowerPC64 GOLD: complain on misaligned _DS relocsAlan Modra2-3/+12
PR 18010 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always complain if value is not a multiple of four. (Target_powerpc::Relocate::relocate): Correct handling of R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
2015-02-22Set GOLD_DEFAULT_SIZE to 32 for x32H.J. Lu3-0/+7
* configure.ac (default_size): Set to 32 for x32. * configure: Regenerated.
2015-02-18Fix gold error: hidden symbol '...' is not defined locallyAlan Modra2-0/+7
Found when applying relocs in .debug that reference removed functions. PR 17954 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default visibility.
2015-02-17Simplify Garbage_collection::add_reference a bit.Rafael Ávila de Espíndola2-5/+6
this->section_reloc_map_[src_id] is created if it doesn't exist, so there is no point in doing a find.
2015-02-17avoid std::vector copy.Rafael Ávila de Espíndola2-1/+5
2015-02-17Use std::upper_bound to simplify code a bit.Rafael Ávila de Espíndola2-8/+9
With std::upper_bound we don't have to check p->input_offset > input_offset.
2015-02-17[gold] Recognize DWARF5/GCC5 DW_LANG_Fortran03 and DW_LANG_Fortran08.Mark Wielaard2-1/+8
DWARFv5 defines and GCC5 may output two new DW_LANG constants for the Fortran 2003 and Fortran 2008 standards. Recognize both in gold gdb-index as unsupported. For consistency also add the other new DWARF5/GCC5 language constants in the elfcpp::DW_LANG enum to match include/dwarf2.h. elfcpp/ChangeLog: * dwarf.h (enum DW_LANG): Add DW_LANG_C_plus_plus_11, DW_LANG_C11, DW_LANG_C_plus_plus_14, DW_LANG_Fortran03 and DW_LANG_Fortran08 from ../include/dwarf2.h. gold/ChangeLog: * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize DW_LANG_Fortran03 and DW_LANG_Fortran08.
2015-02-16Fix --dynamic-list so that symbols not in the list are still exported.Cary Coutant6-14/+20
In PR 13577, the complaint was that -Bsymbolic was overriding the binding behavior for symbols listed in the --dynamic-list by setting the DT_SYMBOLIC tag in the dynamic table. In reading the Gnu ld manual, I decided that --dynamic-list should be mutually exclusive of -Bsymbolic, and modified gold so that --dynamic-list would treat symbols listed as preemptible, and all other symbols as internally bound. I was wrong. PR 16992 shows that with --dynamic-list (and not -Bsymbolic), a symbol not listed in the dynamic list is being internally bound within the shared library, but because it's still in the dynamic symbol table, we expose it to a COPY relocation, and things go really bad from there. (I can reproduce the same failure, simply by turning on -Bsymbolic-functions with the Gnu linker. Even though the symbol is bound internally, it's still exported to the dynamic symbol table, and is exposed to a COPY relocation.) I've backed out part of the fix for PR 13577, and -Bsymbolic (or -Bsymbolic-functions) can now be used with --dynamic-list, but if the two are used together, we do not set DT_SYMBOLIC or DF_SYMBOLIC (this matches Gnu ld behavior). We now treat symbols listed in the dynamic list as premptible, but we do not automatically treat symbols not listed there as non-premptible. gold/ PR gold/13577 PR gold/16992 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or DF_SYMBOLIC if --dynamic-list option is used. * options.cc (General_options::finalize): --dynamic-list is not mutually exclusive with -Bsymbolic. * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not listed in --dynamic-list. * testsuite/Makefile.am (dynamic_list_lib2.so): Add -Bsymbolic-functions. * testsuite/Makefile.in: Regenerate.
2015-02-16Remove redundant include of "output.h".Cary Coutant2-1/+5
gold/ PR gold/17971 * incremental.cc: Remove redundant include of "output.h".
2015-02-12Add missing TLSLE relocations for gold aarch64 backend.Jing Yu3-5/+52
gold/ChangeLog: * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,): New relocation. * aarch64.cc (Target_aarch64::Scan::local): Add cases for new TLSLE_MOVW_* relocations. (Target_aarch64::Scan::global): Likewise. (Target_aarch64::Relocate::relocate): Likewise. (Target_aarch64::Relocate::relocate_tls): Add cases and handlings for new TLSLE_MOVW_* relocations.
2015-02-11gold/arm.cc: Output mapping symbol for PLT codeWill Newton2-0/+13
Output an ARM state mapping symbol at the start of the PLT. With the current code objdump will fail to disassemble the PLT that gold creates. gold/ChangeLog: 2015-02-11 Will Newton <will.newton@linaro.org> PR gold/13321 * arm.cc (Target_arm::make_plt_section): Create an ARM state mapping symbol at the start of the PLT.
2015-02-09Replace two_file_shared_2.so with two_file_shared_1.soH.J. Lu3-2/+8
There are two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so There should be two_file_shared_1.so, not two_file_shared_2.so in two_file_shared_2_pic_1_test_DEPENDENCIES. * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES): Replace two_file_shared_2.so with two_file_shared_1.so. * testsuite/Makefile.in: Regenerated.
2015-02-09Gold testsuite make cleanAlan Modra3-5/+14
* testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a, plugin_test_thin.a and defsym_test. * testsuite/Makefile.in: Regenerate.
2015-02-04Combine loop epilogue into main loop body to reduce duplication.Rafael Ávila de Espíndola2-13/+7
2015-02-04Add missing ChangeLog entry.Cary Coutant1-0/+7
2015-02-04Resolve forwarding symbols in plugins.Peter Collingbourne2-6/+18
2015-02-04 Peter Collingbourne <pcc@google.com> * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve forwarding symbols when computing symbol resolution info for plugins.
2015-02-03Add missing ChangeLog entries.Cary Coutant1-0/+39
2015-02-03Fix a file descriptor leak in gold.Cary Coutant10-154/+321
When an LTO linker plugin claims an external member of a thin archive, gold does not properly unlock the file and make its file descriptor available for reuse. This patch fixes the problem by modifying Archive::include_member to unlock the object file via an RAII class instance, ensuring that it will be unlocked no matter what path is taken through the function. gold/ PR gold/15660 * archive.cc (Thin_archive_object_unlocker): New class. (Archive::include_member): Unlock external members of thin archives. * testsuite/Makefile.am (plugin_test_1): Rename .syms files. (plugin_test_2): Likewise. (plugin_test_3): Likewise. (plugin_test_4): Likewise. (plugin_test_5): Likewise. (plugin_test_6): Likewise. (plugin_test_7): Likewise. (plugin_test_8): Likewise. (plugin_test_9): Likewise. (plugin_test_10): Likewise. (plugin_test_11): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms file to decide whether to claim file. (all_symbols_read_hook): Likewise. * testsuite/plugin_test_1.sh: Adjust expected output. * testsuite/plugin_test_2.sh: Likewise. * testsuite/plugin_test_3.sh: Likewise. * testsuite/plugin_test_6.sh: Likewise. * testsuite/plugin_test_tls.sh: Likewise. * testsuite/plugin_test_11.sh: New testcase.
2015-02-03Add extra debugging output for files and descriptors.Cary Coutant2-0/+19
gold/ * descriptors.cc (Descriptors::open): Set artificially-low limit for file descriptors when debugging enabled. Add debug output. (Descriptors::release): Add debug output. (Descriptors::close_some_descriptor): Likewise. (Descriptors::close_all): Likewise. * fileread.cc (File_read::lock): Likewise. (File_read::unlock): Likewise.
2015-02-02Fix bug with previous patch for unresolved TLS symbol.Cary Coutant2-1/+8
We need to check that the output is executable before assuming that we can replace the reference with zero. 2015-02-02 Cary Coutant <ccoutant@google.com> gold/ * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for executable output file.
2015-01-29This patch adds IFUNC support for arm gold backend.Han Shen4-48/+606
This is a feature required in chromeos arm development work. Tested: 1) Built passed all-gold on x86_64 machine 2) Tested with basic gold aarch64 ifunc unittests - a) global ifunc, statically/non-statically linked b) local ifunc, statically/non-statically linked c) global/local, other shared library routine mixed, statically/non-statically linked d) arm/thumb mode ifunc e) linking chrome browser passed
2015-01-29Correct GOLD PowerPC64 local-dynamic TLS linker optimizationAlan Modra2-6/+15
Similar to b86ac8e3 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD and GOT_TLSGD to LE optimization.
2015-01-28Allow undefined references to TLS symbols.Cary Coutant2-3/+24
When --warn-unresolved-symbols is used, gold tries to create a dynamic relocation for it, and gives an internal error if the TLS segment has not already been created. This patch allows the IE-to-LE optimization for an undefined symbol when building an executable, which suppresses the dynamic relocation, and relaxes the requirement to have a TLS segment when applying a relocation for an undefined symbol. 2015-01-28 Cary Coutant <ccoutant@google.com> gold/ * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization for undef TLS symbols. (Target_x86_64::Relocate::relocate_tls): Likewise. (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
2015-01-252015-01-25 Cary Coutant <ccoutant@google.com>Cary Coutant2-7/+13
gold/ * output.cc (Output_segment::set_section_addresses): Fix calculation of size of relro segment.
2015-01-22[GOLD] Correct powerpc64 ifunc plt entry testAlan Modra2-4/+10
Found when attempting to build an ELFv2 Linux kernel. We don't generally need a plt entry for ELFv2 got relocs, only on ifunc, just like ppc32. * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct condition for need of ifunc plt entry. (Target_powerpc::Scan::global <got relocs>): Likewise.
2015-01-14Fix a bug in resolving HI16/LO16 relocation pairs for MIPS.Cary Coutant2-13/+28
2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com> gold/ * mips.cc (reloc_high): Add r_sym. (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to reloc_high constructor. (Mips_relocate_functions::relgot16_local): Likewise. (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and r_type to decide whether LO16 matches HI16. (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16, rello16 and relgot16_local.
2015-01-09Don't align start of segment unless alignment is larger than page size.Cary Coutant2-1/+8
This fixes an issue where a page-aligned data section, combined with -z relro, could lead to a gap between text and data segments larger than a page, and we would fail to overlap the segments in the file. gold/ * layout.cc (Layout::set_segment_offsets): Don't align start of segment unless alignment is larger than page size.
2015-01-06Handle stack split for x32H.J. Lu12-16/+357
X32 uses cmp %fs:NN,%esp, lea NN(%rsp),%r10d, lea NN(%rsp),%r11d, instead of cmp %fs:NN,%rsp, lea NN(%rsp),%r10, lea NN(%rsp),%r11. This patch handles it. PR gold/17729 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32. (DEFAULT_TARGET_X32): Set for x32. * x86_64.cc (cmp_insn_32): New. (lea_r10_insn_32): Likewise. (lea_r11_insn_32): Likewise. (cmp_insn_64): Likewise. (lea_r10_insn_64): Likewise. (lea_r11_insn_64): Likewise. (Target_x86_64<size>::do_calls_non_split): Handle x32. * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh. (check_DATA): Add split_x32 files. (split_x32_[1234n].o): New targets. (split_x32_[124]): New targets. (split_x32_[1234r].stdout): New targets. * testsuite/split_x32.sh: New file. * testsuite/split_x32_1.s: Likewise. * testsuite/split_x32_2.s: Likewise. * testsuite/split_x32_3.s: Likewise. * testsuite/split_x32_4.s: Likewise. * testsuite/split_x32_n.s: Likewise. * configure: Regenerated. * testsuite/Makefile.in: Likewise.
2015-01-06Handle Initial-Exec to Local-Exec for x32H.J. Lu2-0/+12
PR gold/17809 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle x32.
2015-01-02Regenerate Makeile.in file for copyright updateAlan Modra1-1/+1
2015-01-02Correct printed year in copyright notices for gold.Alan Modra3-2/+7
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra393-395/+399
2014-12-25ARM: Add support for value 3 of Tag_ABI_VFP_args attributeAlan Modra2-6/+12
Missing from 5c294fee elfcpp/ * arm.h: Add enums for Tag_ABI_FP_number_model and Tag_ABI_VFP_args. gold/ * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on new enums. (Target_arm::merge_object_attributes, ): Likewise.
2014-12-25ARM: Add support for value 3 of Tag_ABI_VFP_args attributeTerry Guo2-3/+19
*** bfd/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new Tag_ABI_VFP_args value and replace hardcoded values by enum values. (elf32_arm_post_process_headers): Set e_flags in ELF header as hard float only when Tag_ABI_VFP_args is 1, using new enum value AEABI_VFP_args_vfp to check that. *** binutils/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * readelf.c (arm_attr_tag_ABI_VFP_args): Add "compatible". *** gdb/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of Tag_ABI_VFP_args. Also replace hardcoded values by enum values in the switch handling the different values of Tag_ABI_VFP_args. *** gold/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header as hard float only when Tag_ABI_VFP_args is 1, using new enum value AEABI_VFP_args_vfp to check that. (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args value and replace hardcoded values by enum values. *** include/elf/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * arm.h: New AEABI_FP_number_model_* and AEABI_VFP_args_* enum values. *** ld/testsuite/ChangeLog *** 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com> * ld-arm/attr-merge-2a.s: Add Tag_ABI_VFP_args. * ld-arm/attr-merge-2b.s: Likewise. * ld-arm/attr-merge-2.attr: Likewise. * ld-arm/attr-merge-4a.s: Add Tag_ABI_FP_number_model and Tag_ABI_VFP_args. * ld-arm/attr-merge-4b.s: Likewise. * ld-arm/attr-merge-4.attr: Likewise. * ld-arm/attr-merge-6a.s: Likewise. * ld-arm/attr-merge-6b.s: Likewise. * ld-arm/attr-merge-6.attr: Add Tag_ABI_FP_number_model.
2014-12-22gold/Cary Coutant2-1/+6
* powerpc.cc (Target_powerpc::relocate): Fix overflow check.
2014-12-20Change SometimesInlineFunction to "return i * i * 3;"H.J. Lu2-1/+7
The debug_msg test has 2 implementations of SometimesInlineFunction: int SometimesInlineFunction(int i) { return i; } int SometimesInlineFunction(int i) { return i * i; } and One Definition Rule (ODR) violation detection expects they will be compiled into functions of different sizes. Hower, on x86, GCC 4.7 and newer compile them into functions of the same size and ODR violation detection test fails. This patch changes int SometimesInlineFunction(int i) { return i; } to int SometimesInlineFunction(int i) { return i * i * 3; } so that it will be compiled into a function of larger size. PR gold/14608 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed to "return i * i * 3;".
2014-12-16Fix internal error in gold when -Map and --compress-debug-sections are usedCary Coutant2-4/+21
together. gold/ * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes. (Mapfile::print_output_data): Use current_data_size() to avoid assert for sections requiring postprocessing; if address is not valid, print 0. (Mapfile::print_output_section): Use current_data_size(); print note that addresses and sizes are before compression.
2014-12-14Cast current_group_size to unsigned longH.J. Lu2-1/+6
* aarch64.cc (AArch64_relocate_functions::maybe_apply_stub): Cast current_group_size to unsigned long when reporting error.
2014-12-10Give informative error message for stub-group-sizeJing Yu2-10/+26
This patch gives current stub-group-size in error message when stub is too far away. * aarch64.cc (Target_aarch64): Add new variable: stub_group_size_. (AArch64_relocate_functions::maybe_apply_stub): Add new parameter. Update error message. (Target_aarch64::do_relax): Use absolute value of option stub_group_size. Replace local variable with class member stub_group_size_.
2014-12-04ChangeLog typo fixAlan Modra1-1/+1
2014-12-04PowerPC gold, fix 32-bit branch address arithmeticAlan Modra2-5/+14
Mixing 64-bit and 32-bit types led to the wrong promotions. Keep calculation in same type. Also fix a case where PLTREL25 reloc addend should be ignored. * Powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore addend of PLTREL24 reloc when not generating a plt stub. Make max_branch_offset an "Address". (Stub_table::can_read_stub): Make max_branch_offset an "Address". (Target_powerpc::Relocate::relocate): Likewise.
2014-12-04powerpc gold, work around pr17670Alan Modra3-24/+44
pr17670 is about an assert triggering on a branch to an undefined weak symbol, the symbol being undefined due to dropping its comdat group section. (Well sort of. The symbol is actually defined in an .opd section which isn't part of the group, but the code section the opd entry points at is dropped.) So don't assert. Also, don't make long branch stubs to such symbols, and arrange to have target-reloc.h code warn when applying relocs that use the sym. PR 17670 * symtab.cc (Symbol::set_undefined): Remove assertion. * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert on symbols defined in discarded sections, instead return false. Rearrange params, update all callers. (Target_powerpc::Branch_info::make_stub): Don't make stubs for branches to syms in discarded sections. (Global_symbol_visitor_opd::operator()): Set discarded opd syms undefined and flag as discarded. (Target_powerpc::Relocate::relocate): Localize variable.
2014-12-03Compile pie_copyrelocs_test.cc with -fno-exceptions ↵H.J. Lu3-5/+26
-fno-asynchronous-unwind-tables PR gold/17675 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New. * testsuite/Makefile.in: Regenerated.
2014-12-04powerpc gold, fix pr17566Alan Modra2-3/+23
Code stolen from arm.cc. PR 17566 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section when adding dynamic relocations against section symbols.