X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Fsparc.cc;h=fce72404596407b75df6684e74121f8dd770fd32;hb=c86ec09cd9820e50cc038dc3960fbf4df650e185;hp=dc4612dc2a1093afba2e2512267a15d3a3a72bf8;hpb=7160c10d6530b79ea45d435933b07765f610f54d;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/sparc.cc b/gold/sparc.cc index dc4612dc2a..fce7240459 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -1,6 +1,6 @@ // sparc.cc -- sparc target support for gold. -// Copyright (C) 2008-2016 Free Software Foundation, Inc. +// Copyright (C) 2008-2019 Free Software Foundation, Inc. // Written by David S. Miller . // This file is part of gold. @@ -499,6 +499,7 @@ Target::Target_info Target_sparc<32, true>::sparc_info = NULL, // attributes_vendor "_start", // entry_symbol_name 32, // hash_entry_size + elfcpp::SHT_PROGBITS, // unwind_section_type }; template<> @@ -527,6 +528,7 @@ Target::Target_info Target_sparc<64, true>::sparc_info = NULL, // attributes_vendor "_start", // entry_symbol_name 32, // hash_entry_size + elfcpp::SHT_PROGBITS, // unwind_section_type }; // We have to take care here, even when operating in little-endian @@ -2150,6 +2152,7 @@ Target_sparc::Scan::check_non_pic(Relobj* object, unsigned int case elfcpp::R_SPARC_RELATIVE: case elfcpp::R_SPARC_IRELATIVE: case elfcpp::R_SPARC_COPY: + case elfcpp::R_SPARC_32: case elfcpp::R_SPARC_64: case elfcpp::R_SPARC_GLOB_DAT: case elfcpp::R_SPARC_JMP_SLOT: @@ -2304,7 +2307,7 @@ Target_sparc::Scan::local( reloc.get_r_addend(), is_ifunc); break; } - /* Fall through. */ + // Fall through. case elfcpp::R_SPARC_HIX22: case elfcpp::R_SPARC_LOX10: @@ -2814,6 +2817,7 @@ Target_sparc::Scan::global( // and code transform the GOT load into an addition. break; } + // Fall through. case elfcpp::R_SPARC_GOT10: case elfcpp::R_SPARC_GOT13: case elfcpp::R_SPARC_GOT22: @@ -3353,6 +3357,7 @@ Target_sparc::Relocate::relocate( gdop_valid = true; break; } + // Fall through. case elfcpp::R_SPARC_GOT10: case elfcpp::R_SPARC_GOT13: case elfcpp::R_SPARC_GOT22: @@ -3468,6 +3473,13 @@ Target_sparc::Relocate::relocate( Reloc::lo10(view, object, psymval, addend); break; + case elfcpp::R_SPARC_GOTDATA_OP_LOX10: + if (gdop_valid) + { + Reloc::gdop_lox10(view, got_offset); + break; + } + // Fall through. case elfcpp::R_SPARC_GOT10: Reloc::lo10(view, got_offset, addend); break; @@ -3486,13 +3498,6 @@ Target_sparc::Relocate::relocate( } break; - case elfcpp::R_SPARC_GOTDATA_OP_LOX10: - if (gdop_valid) - { - Reloc::gdop_lox10(view, got_offset); - break; - } - /* Fall through. */ case elfcpp::R_SPARC_GOT13: Reloc::rela32_13(view, got_offset, addend); break; @@ -3503,7 +3508,7 @@ Target_sparc::Relocate::relocate( Reloc::gdop_hix22(view, got_offset); break; } - /* Fall through. */ + // Fall through. case elfcpp::R_SPARC_GOT22: Reloc::hi22(view, got_offset, addend); break; @@ -3727,7 +3732,7 @@ Target_sparc::Relocate::relocate_tls( const bool is_final = (gsym == NULL - ? !parameters->options().output_is_position_independent() + ? !parameters->options().shared() : gsym->final_value_is_known()); const tls::Tls_optimization optimized_type = optimize_tls_reloc(is_final, r_type); @@ -4161,7 +4166,7 @@ Target_sparc::Relocate::relax_call( if (op3 != 0x3d) { // First check RS1 - reg = (delay_insn >> 14) & 0x15; + reg = (delay_insn >> 14) & 0x1f; if (reg == 15) return;