summaryrefslogtreecommitdiff
path: root/gold
Commit message (Collapse)AuthorAgeFilesLines
* PowerPC64 GOLD: complain on misaligned _DS relocsAlan Modra2015-02-242-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.
* Set GOLD_DEFAULT_SIZE to 32 for x32H.J. Lu2015-02-223-0/+7
| | | | | * configure.ac (default_size): Set to 32 for x32. * configure: Regenerated.
* Fix gold error: hidden symbol '...' is not defined locallyAlan Modra2015-02-182-0/+7
| | | | | | | | Found when applying relocs in .debug that reference removed functions. PR 17954 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default visibility.
* Simplify Garbage_collection::add_reference a bit.Rafael Ávila de Espíndola2015-02-172-5/+6
| | | | | this->section_reloc_map_[src_id] is created if it doesn't exist, so there is no point in doing a find.
* avoid std::vector copy.Rafael Ávila de Espíndola2015-02-172-1/+5
|
* Use std::upper_bound to simplify code a bit.Rafael Ávila de Espíndola2015-02-172-8/+9
| | | | With std::upper_bound we don't have to check p->input_offset > input_offset.
* [gold] Recognize DWARF5/GCC5 DW_LANG_Fortran03 and DW_LANG_Fortran08.Mark Wielaard2015-02-172-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.
* Fix --dynamic-list so that symbols not in the list are still exported.Cary Coutant2015-02-166-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.
* Remove redundant include of "output.h".Cary Coutant2015-02-162-1/+5
| | | | | | gold/ PR gold/17971 * incremental.cc: Remove redundant include of "output.h".
* Add missing TLSLE relocations for gold aarch64 backend.Jing Yu2015-02-123-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.
* gold/arm.cc: Output mapping symbol for PLT codeWill Newton2015-02-112-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.
* Replace two_file_shared_2.so with two_file_shared_1.soH.J. Lu2015-02-093-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.
* Gold testsuite make cleanAlan Modra2015-02-093-5/+14
| | | | | | * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a, plugin_test_thin.a and defsym_test. * testsuite/Makefile.in: Regenerate.
* Combine loop epilogue into main loop body to reduce duplication.Rafael Ávila de Espíndola2015-02-042-13/+7
|
* Add missing ChangeLog entry.Cary Coutant2015-02-041-0/+7
|
* Resolve forwarding symbols in plugins.Peter Collingbourne2015-02-042-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.
* Add missing ChangeLog entries.Cary Coutant2015-02-031-0/+39
|
* Fix a file descriptor leak in gold.Cary Coutant2015-02-0310-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.
* Add extra debugging output for files and descriptors.Cary Coutant2015-02-032-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.
* Fix bug with previous patch for unresolved TLS symbol.Cary Coutant2015-02-022-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.
* This patch adds IFUNC support for arm gold backend.Han Shen2015-01-294-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
* Correct GOLD PowerPC64 local-dynamic TLS linker optimizationAlan Modra2015-01-292-6/+15
| | | | | | | Similar to b86ac8e3 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD and GOT_TLSGD to LE optimization.
* Allow undefined references to TLS symbols.Cary Coutant2015-01-282-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-25 Cary Coutant <ccoutant@google.com>Cary Coutant2015-01-252-7/+13
| | | | | | gold/ * output.cc (Output_segment::set_section_addresses): Fix calculation of size of relro segment.
* [GOLD] Correct powerpc64 ifunc plt entry testAlan Modra2015-01-222-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.
* Fix a bug in resolving HI16/LO16 relocation pairs for MIPS.Cary Coutant2015-01-142-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.
* Don't align start of segment unless alignment is larger than page size.Cary Coutant2015-01-092-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.
* Handle stack split for x32H.J. Lu2015-01-0612-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.
* Handle Initial-Exec to Local-Exec for x32H.J. Lu2015-01-062-0/+12
| | | | | | PR gold/17809 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle x32.
* Regenerate Makeile.in file for copyright updateAlan Modra2015-01-021-1/+1
|
* Correct printed year in copyright notices for gold.Alan Modra2015-01-023-2/+7
|
* ChangeLog rotatation and copyright year updateAlan Modra2015-01-02393-395/+399
|
* ARM: Add support for value 3 of Tag_ABI_VFP_args attributeAlan Modra2014-12-252-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.
* ARM: Add support for value 3 of Tag_ABI_VFP_args attributeTerry Guo2014-12-252-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.
* gold/Cary Coutant2014-12-222-1/+6
| | | | * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
* Change SometimesInlineFunction to "return i * i * 3;"H.J. Lu2014-12-202-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;".
* Fix internal error in gold when -Map and --compress-debug-sections are usedCary Coutant2014-12-162-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.
* Cast current_group_size to unsigned longH.J. Lu2014-12-142-1/+6
| | | | | * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub): Cast current_group_size to unsigned long when reporting error.
* Give informative error message for stub-group-sizeJing Yu2014-12-102-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_.
* ChangeLog typo fixAlan Modra2014-12-041-1/+1
|
* PowerPC gold, fix 32-bit branch address arithmeticAlan Modra2014-12-042-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.
* powerpc gold, work around pr17670Alan Modra2014-12-043-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.
* Compile pie_copyrelocs_test.cc with -fno-exceptions ↵H.J. Lu2014-12-033-5/+26
| | | | | | | | -fno-asynchronous-unwind-tables PR gold/17675 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New. * testsuite/Makefile.in: Regenerated.
* powerpc gold, fix pr17566Alan Modra2014-12-042-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.
* Add support for -z global.Dmitriy Ivanov2014-12-013-0/+11
| | | | | | | gold/ * layout.cc (Layout::finish_dynamic_section): When '-z global' is specified set DF_1_GLOBAL in DT_FLAGS_1 flags. * options.h (General_options): New -z option (global).
* Fix extraneous warning about executable stack.Cary Coutant2014-12-012-3/+17
| | | | | | | | | | | | | | | | | | PR gold/17578 notes that gold will print a warning about an executable stack when the -z execstack option is given, even when there is no --warn_execstack option. The warning is completely useless and unexpected, since the user explicitly requested an executable stack, and did not even ask for warnings. This patch fixes that, and adds an extra warning when --warn_execstack and -z noexecstack are both given and an input file requires an executable stack. gold/ PR gold/17578 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack is given. (Layout::create_executable_stack_info): Warn when -z noexecstack is given but some inputs require executable stack.
* Update list of debug sections for --strip-debug-xxx options.Cary Coutant2014-11-262-0/+15
| | | | | | | | | | | | Add .debug_gdb_scripts, .debug_gnu_pubnames, .debug_gnu_pubtypes, and .debug_str_offsets to lists of sections to strip or keep when stripping debug info. gold/ * layout.cc (gdb_sections): Keep .debug_gdb_scripts and .debug_str_offsets; strip .debug_gnu_pubnames and .debug_gnu_pubtypes. (lines_only_debug_sections): Strip all four new sections.
* Fix for gold linking tlsdesc into an executable with -pie.Han Shen2014-11-262-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Also included in this patch is a minor typo fix in gold/ChangeLog.) When linking the following tlsdesc access sequence into an executable with -pie, adrp x0, :tlsdesc:tls_gd ldr x1, [x0, #:tlsdesc_lo12:tls_gd] add x0, x0, :tlsdesc_lo12:tls_gd .tlsdesccall tls_gd blr x1 mrs x1, tpidr_el0 add x0, x1, x0 ldr w0, [x0] current gold-aarch64 backend does tls-desc-gd-to-ie relaxation, into adrp x0, 1000 <__FRAME_END__+0x720> ldr x1, [x0,#4064] ;; <=== the target register should be x0 nop nop mrs x1, tpidr_el0 add x0, x1, x0 ldr w0, [x0] This code is wrong. The fix changes ldr target register into x0.
* Retry powerpc gold stub grouping when groups prove too largeAlan Modra2014-11-262-132/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An unusually large number of stubs can result in the default section group size being too large; sections plus stubs exceed the range of a branch. Restarting the relaxation pass with a smaller group size can sometimes help. * powerpc.cc (struct Stub_table_owner): New. (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an unsigned int vector. Update all references. (powerpc_relobj::set_stub_table): Take an unsigned int param rather than a Stub_table. Update callers. (Powerpc_relobj::clear_stub_table): New function. (Target_powerpc): Add relax_failed_, relax_fail_count_ and stub_group_size_ vars. (Target_powerpc::new_stub_table): Delete. (max_branch_delta): New function, extracted from.. (Target_powerpc::Relocate::relocate): ..here.. (Target_powerpc::Branch_info::make_stub): ..and here. Return status on whether stub created successfully. (Stub_control::Stub_control): Add "no_size_errors" param. Move default sizing to.. (Target_powerpc::do_relax): ..here. Init stub_group_size_ and reduce on relax failure. (Target_powerpc::group_sections): Add "no_size_errors" param. Use stub_group_size_. Set up group info in a temp vector, before building Stub_table vector. Account for input sections possibly already converted to relaxed sections. (Stub_table::init): Delete. Merge into.. (Stub_table::Stub_table): ..here. (Stub_table::can_reach_stub): New function. (Stub_table::add_plt_call_entry): Add "from" parameter and return true iff stub could be reached. (Stub_table::add_long_branch_entry): Similarly. Add "r_type" param too. (Stub_table::clear_stubs): Add "all" param.
* [GOLD] PowerPC relaxation corner caseAlan Modra2014-11-262-0/+14
| | | | | | | | | | | It's possible for the section grouping code to decide that the last section looked at (the first section by address) doesn't fit into a group. In one case that section is already a group owner and that is handled correctly. In other cases the section should be put into its own group. Like this: * powerpc.cc (Stub_control::set_output_and_owner): New function. (Target_powerpc::group_sections): Use it.