• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂152c92b261fd9e4655688bef746ca32352f56bc4 (tree)
時間2017-03-16 08:51:35
作者Vladimir Radosavljevic <Vladimir.Radosavljevic@imgt...>
CommiterCary Coutant

Log Message

Mips: Add support for resolving multiple consecutive relocations.

gold/
* mips.cc (Target_mips::Relocate::calculated_value_): New data
member.
(Target_mips::Relocate::calculate_only_): Likewise.
(Target_mips::Relocate::relocate): Handle multiple consecutive
relocations with the same offset.

Change Summary

差異

--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,13 @@
11 2017-03-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
22
3+ * mips.cc (Target_mips::Relocate::calculated_value_): New data
4+ member.
5+ (Target_mips::Relocate::calculate_only_): Likewise.
6+ (Target_mips::Relocate::relocate): Handle multiple consecutive
7+ relocations with the same offset.
8+
9+2017-03-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
10+
311 * mips.cc (Target_mips::Relocate::relocate): Remove redundant
412 checks for relocatable link.
513 (Mips_relocate_functions::reljalr): Likewise.
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -3857,6 +3857,7 @@ class Target_mips : public Sized_target<size, big_endian>
38573857 {
38583858 public:
38593859 Relocate()
3860+ : calculated_value_(0), calculate_only_(false)
38603861 { }
38613862
38623863 ~Relocate()
@@ -3876,6 +3877,12 @@ class Target_mips : public Sized_target<size, big_endian>
38763877 Target_mips*, Output_section*, size_t, const unsigned char*,
38773878 const Sized_symbol<size>*, const Symbol_value<size>*,
38783879 unsigned char*, Mips_address, section_size_type);
3880+
3881+ private:
3882+ // Result of the relocation.
3883+ Valtype calculated_value_;
3884+ // Whether we have to calculate relocation instead of applying it.
3885+ bool calculate_only_;
38793886 };
38803887
38813888 // This POD class holds the dynamic relocations that should be emitted instead
@@ -11428,6 +11435,13 @@ Target_mips<size, big_endian>::Relocate::relocate(
1142811435 unsigned int r_type3;
1142911436 unsigned char r_ssym;
1143011437 typename elfcpp::Elf_types<size>::Elf_Swxword r_addend;
11438+ // r_offset and r_type of the next relocation is needed for resolving multiple
11439+ // consecutive relocations with the same offset.
11440+ Mips_address next_r_offset = static_cast<Mips_address>(0) - 1;
11441+ unsigned int next_r_type = elfcpp::R_MIPS_NONE;
11442+
11443+ elfcpp::Shdr<size, big_endian> shdr(relinfo->reloc_shdr);
11444+ size_t reloc_count = shdr.get_sh_size() / shdr.get_sh_entsize();
1143111445
1143211446 if (rel_type == elfcpp::SHT_RELA)
1143311447 {
@@ -11444,6 +11458,17 @@ Target_mips<size, big_endian>::Relocate::relocate(
1144411458 r_ssym = Mips_classify_reloc<elfcpp::SHT_RELA, size, big_endian>::
1144511459 get_r_ssym(&rela);
1144611460 r_addend = rela.get_r_addend();
11461+ // If this is not last relocation, get r_offset and r_type of the next
11462+ // relocation.
11463+ if (relnum + 1 < reloc_count)
11464+ {
11465+ const int reloc_size = elfcpp::Elf_sizes<size>::rela_size;
11466+ const Relatype next_rela(preloc + reloc_size);
11467+ next_r_offset = next_rela.get_r_offset();
11468+ next_r_type =
11469+ Mips_classify_reloc<elfcpp::SHT_RELA, size, big_endian>::
11470+ get_r_type(&next_rela);
11471+ }
1144711472 }
1144811473 else
1144911474 {
@@ -11454,9 +11479,19 @@ Target_mips<size, big_endian>::Relocate::relocate(
1145411479 r_type = Mips_classify_reloc<elfcpp::SHT_REL, size, big_endian>::
1145511480 get_r_type(&rel);
1145611481 r_ssym = 0;
11457- r_type2 = 0;
11458- r_type3 = 0;
11482+ r_type2 = elfcpp::R_MIPS_NONE;
11483+ r_type3 = elfcpp::R_MIPS_NONE;
1145911484 r_addend = 0;
11485+ // If this is not last relocation, get r_offset and r_type of the next
11486+ // relocation.
11487+ if (relnum + 1 < reloc_count)
11488+ {
11489+ const int reloc_size = elfcpp::Elf_sizes<size>::rel_size;
11490+ const Reltype next_rel(preloc + reloc_size);
11491+ next_r_offset = next_rel.get_r_offset();
11492+ next_r_type = Mips_classify_reloc<elfcpp::SHT_REL, size, big_endian>::
11493+ get_r_type(&next_rel);
11494+ }
1146011495 }
1146111496
1146211497 typedef Mips_relocate_functions<size, big_endian> Reloc_funcs;
@@ -11716,8 +11751,7 @@ Target_mips<size, big_endian>::Relocate::relocate(
1171611751 unsigned int got_offset = 0;
1171711752 int gp_offset = 0;
1171811753
11719- bool calculate_only = false;
11720- Valtype calculated_value = 0;
11754+ // Whether we have to extract addend from instruction.
1172111755 bool extract_addend = rel_type == elfcpp::SHT_REL;
1172211756 unsigned int r_types[3] = { r_type, r_type2, r_type3 };
1172311757
@@ -11740,10 +11774,23 @@ Target_mips<size, big_endian>::Relocate::relocate(
1174011774 if (r_types[i] == elfcpp::R_MIPS_NONE)
1174111775 break;
1174211776
11743- // TODO(Vladimir)
11744- // Check if the next relocation is for the same instruction.
11745- calculate_only = i == 2 ? false
11746- : r_types[i+1] != elfcpp::R_MIPS_NONE;
11777+ // If we didn't apply previous relocation, use its result as addend
11778+ // for current.
11779+ if (this->calculate_only_)
11780+ {
11781+ r_addend = this->calculated_value_;
11782+ extract_addend = false;
11783+ }
11784+
11785+ // In the N32 and 64-bit ABIs there may be multiple consecutive
11786+ // relocations for the same offset. In that case we are
11787+ // supposed to treat the output of each relocation as the addend
11788+ // for the next. For N64 ABI, we are checking offsets only in a
11789+ // third operation in a record (r_type3).
11790+ this->calculate_only_ =
11791+ (object->is_n64() && i < 2
11792+ ? r_types[i+1] != elfcpp::R_MIPS_NONE
11793+ : (r_offset == next_r_offset) && (next_r_type != elfcpp::R_MIPS_NONE));
1174711794
1174811795 if (object->is_n64())
1174911796 {
@@ -11783,16 +11830,18 @@ Target_mips<size, big_endian>::Relocate::relocate(
1178311830 break;
1178411831 case elfcpp::R_MIPS_16:
1178511832 reloc_status = Reloc_funcs::rel16(view, object, psymval, r_addend,
11786- extract_addend, calculate_only,
11787- &calculated_value);
11833+ extract_addend,
11834+ this->calculate_only_,
11835+ &this->calculated_value_);
1178811836 break;
1178911837
1179011838 case elfcpp::R_MIPS_32:
1179111839 if (should_apply_static_reloc(mips_sym, r_types[i], output_section,
1179211840 target))
1179311841 reloc_status = Reloc_funcs::rel32(view, object, psymval, r_addend,
11794- extract_addend, calculate_only,
11795- &calculated_value);
11842+ extract_addend,
11843+ this->calculate_only_,
11844+ &this->calculated_value_);
1179611845 if (mips_sym != NULL
1179711846 && (mips_sym->is_mips16() || mips_sym->is_micromips())
1179811847 && mips_sym->global_got_area() == GGA_RELOC_ONLY)
@@ -11817,14 +11866,16 @@ Target_mips<size, big_endian>::Relocate::relocate(
1181711866 if (should_apply_static_reloc(mips_sym, r_types[i], output_section,
1181811867 target))
1181911868 reloc_status = Reloc_funcs::rel64(view, object, psymval, r_addend,
11820- extract_addend, calculate_only,
11821- &calculated_value, false);
11869+ extract_addend,
11870+ this->calculate_only_,
11871+ &this->calculated_value_, false);
1182211872 else if (target->is_output_n64() && r_addend != 0)
1182311873 // Only apply the addend. The static relocation was RELA, but the
1182411874 // dynamic relocation is REL, so we need to apply the addend.
1182511875 reloc_status = Reloc_funcs::rel64(view, object, psymval, r_addend,
11826- extract_addend, calculate_only,
11827- &calculated_value, true);
11876+ extract_addend,
11877+ this->calculate_only_,
11878+ &this->calculated_value_, true);
1182811879 break;
1182911880 case elfcpp::R_MIPS_REL32:
1183011881 gold_unreachable();
@@ -11832,8 +11883,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1183211883 case elfcpp::R_MIPS_PC32:
1183311884 reloc_status = Reloc_funcs::relpc32(view, object, psymval, address,
1183411885 r_addend, extract_addend,
11835- calculate_only,
11836- &calculated_value);
11886+ this->calculate_only_,
11887+ &this->calculated_value_);
1183711888 break;
1183811889
1183911890 case elfcpp::R_MIPS16_26:
@@ -11845,8 +11896,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1184511896 case elfcpp::R_MICROMIPS_26_S1:
1184611897 reloc_status = Reloc_funcs::rel26(view, object, psymval, address,
1184711898 gsym == NULL, r_addend, extract_addend, gsym, cross_mode_jump,
11848- r_types[i], target->jal_to_bal(), calculate_only,
11849- &calculated_value);
11899+ r_types[i], target->jal_to_bal(), this->calculate_only_,
11900+ &this->calculated_value_);
1185011901 break;
1185111902
1185211903 case elfcpp::R_MIPS_HI16:
@@ -11857,8 +11908,9 @@ Target_mips<size, big_endian>::Relocate::relocate(
1185711908 r_addend, address,
1185811909 gp_disp, r_types[i],
1185911910 extract_addend, 0,
11860- target, calculate_only,
11861- &calculated_value);
11911+ target,
11912+ this->calculate_only_,
11913+ &this->calculated_value_);
1186211914 else if (rel_type == elfcpp::SHT_REL)
1186311915 reloc_status = Reloc_funcs::relhi16(view, object, psymval, r_addend,
1186411916 address, gp_disp, r_types[i],
@@ -11874,8 +11926,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1187411926 reloc_status = Reloc_funcs::rello16(target, view, object, psymval,
1187511927 r_addend, extract_addend, address,
1187611928 gp_disp, r_types[i], r_sym,
11877- rel_type, calculate_only,
11878- &calculated_value);
11929+ rel_type, this->calculate_only_,
11930+ &this->calculated_value_);
1187911931 break;
1188011932
1188111933 case elfcpp::R_MIPS_LITERAL:
@@ -11895,42 +11947,43 @@ Target_mips<size, big_endian>::Relocate::relocate(
1189511947 target->adjusted_gp_value(object),
1189611948 r_addend, extract_addend,
1189711949 gsym == NULL, r_types[i],
11898- calculate_only, &calculated_value);
11950+ this->calculate_only_,
11951+ &this->calculated_value_);
1189911952 break;
1190011953
1190111954 case elfcpp::R_MIPS_PC16:
1190211955 reloc_status = Reloc_funcs::relpc16(view, object, psymval, address,
1190311956 r_addend, extract_addend,
11904- calculate_only,
11905- &calculated_value);
11957+ this->calculate_only_,
11958+ &this->calculated_value_);
1190611959 break;
1190711960
1190811961 case elfcpp::R_MIPS_PC21_S2:
1190911962 reloc_status = Reloc_funcs::relpc21(view, object, psymval, address,
1191011963 r_addend, extract_addend,
11911- calculate_only,
11912- &calculated_value);
11964+ this->calculate_only_,
11965+ &this->calculated_value_);
1191311966 break;
1191411967
1191511968 case elfcpp::R_MIPS_PC26_S2:
1191611969 reloc_status = Reloc_funcs::relpc26(view, object, psymval, address,
1191711970 r_addend, extract_addend,
11918- calculate_only,
11919- &calculated_value);
11971+ this->calculate_only_,
11972+ &this->calculated_value_);
1192011973 break;
1192111974
1192211975 case elfcpp::R_MIPS_PC18_S3:
1192311976 reloc_status = Reloc_funcs::relpc18(view, object, psymval, address,
1192411977 r_addend, extract_addend,
11925- calculate_only,
11926- &calculated_value);
11978+ this->calculate_only_,
11979+ &this->calculated_value_);
1192711980 break;
1192811981
1192911982 case elfcpp::R_MIPS_PC19_S2:
1193011983 reloc_status = Reloc_funcs::relpc19(view, object, psymval, address,
1193111984 r_addend, extract_addend,
11932- calculate_only,
11933- &calculated_value);
11985+ this->calculate_only_,
11986+ &this->calculated_value_);
1193411987 break;
1193511988
1193611989 case elfcpp::R_MIPS_PCHI16:
@@ -11938,8 +11991,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1193811991 reloc_status = Reloc_funcs::do_relpchi16(view, object, psymval,
1193911992 r_addend, address,
1194011993 extract_addend, 0,
11941- calculate_only,
11942- &calculated_value);
11994+ this->calculate_only_,
11995+ &this->calculated_value_);
1194311996 else if (rel_type == elfcpp::SHT_REL)
1194411997 reloc_status = Reloc_funcs::relpchi16(view, object, psymval,
1194511998 r_addend, address, r_sym,
@@ -11951,36 +12004,36 @@ Target_mips<size, big_endian>::Relocate::relocate(
1195112004 case elfcpp::R_MIPS_PCLO16:
1195212005 reloc_status = Reloc_funcs::relpclo16(view, object, psymval, r_addend,
1195312006 extract_addend, address, r_sym,
11954- rel_type, calculate_only,
11955- &calculated_value);
12007+ rel_type, this->calculate_only_,
12008+ &this->calculated_value_);
1195612009 break;
1195712010 case elfcpp::R_MICROMIPS_PC7_S1:
1195812011 reloc_status = Reloc_funcs::relmicromips_pc7_s1(view, object, psymval,
11959- address, r_addend,
11960- extract_addend,
11961- calculate_only,
11962- &calculated_value);
12012+ address, r_addend,
12013+ extract_addend,
12014+ this->calculate_only_,
12015+ &this->calculated_value_);
1196312016 break;
1196412017 case elfcpp::R_MICROMIPS_PC10_S1:
1196512018 reloc_status = Reloc_funcs::relmicromips_pc10_s1(view, object,
11966- psymval, address,
11967- r_addend, extract_addend,
11968- calculate_only,
11969- &calculated_value);
12019+ psymval, address,
12020+ r_addend, extract_addend,
12021+ this->calculate_only_,
12022+ &this->calculated_value_);
1197012023 break;
1197112024 case elfcpp::R_MICROMIPS_PC16_S1:
1197212025 reloc_status = Reloc_funcs::relmicromips_pc16_s1(view, object,
11973- psymval, address,
11974- r_addend, extract_addend,
11975- calculate_only,
11976- &calculated_value);
12026+ psymval, address,
12027+ r_addend, extract_addend,
12028+ this->calculate_only_,
12029+ &this->calculated_value_);
1197712030 break;
1197812031 case elfcpp::R_MIPS_GPREL32:
1197912032 reloc_status = Reloc_funcs::relgprel32(view, object, psymval,
1198012033 target->adjusted_gp_value(object),
1198112034 r_addend, extract_addend,
11982- calculate_only,
11983- &calculated_value);
12035+ this->calculate_only_,
12036+ &this->calculated_value_);
1198412037 break;
1198512038 case elfcpp::R_MIPS_GOT_HI16:
1198612039 case elfcpp::R_MIPS_CALL_HI16:
@@ -11996,8 +12049,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1199612049 object, r_addend);
1199712050 gp_offset = target->got_section()->gp_offset(got_offset, object);
1199812051 reloc_status = Reloc_funcs::relgot_hi16(view, gp_offset,
11999- calculate_only,
12000- &calculated_value);
12052+ this->calculate_only_,
12053+ &this->calculated_value_);
1200112054 update_got_entry = changed_symbol_value;
1200212055 break;
1200312056
@@ -12015,8 +12068,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1201512068 object, r_addend);
1201612069 gp_offset = target->got_section()->gp_offset(got_offset, object);
1201712070 reloc_status = Reloc_funcs::relgot_lo16(view, gp_offset,
12018- calculate_only,
12019- &calculated_value);
12071+ this->calculate_only_,
12072+ &this->calculated_value_);
1202012073 update_got_entry = changed_symbol_value;
1202112074 break;
1202212075
@@ -12034,12 +12087,12 @@ Target_mips<size, big_endian>::Relocate::relocate(
1203412087 gp_offset = target->got_section()->gp_offset(got_offset, object);
1203512088 if (eh_reloc(r_types[i]))
1203612089 reloc_status = Reloc_funcs::releh(view, gp_offset,
12037- calculate_only,
12038- &calculated_value);
12090+ this->calculate_only_,
12091+ &this->calculated_value_);
1203912092 else
1204012093 reloc_status = Reloc_funcs::relgot(view, gp_offset,
12041- calculate_only,
12042- &calculated_value);
12094+ this->calculate_only_,
12095+ &this->calculated_value_);
1204312096 break;
1204412097 case elfcpp::R_MIPS_CALL16:
1204512098 case elfcpp::R_MIPS16_CALL16:
@@ -12050,7 +12103,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1205012103 object);
1205112104 gp_offset = target->got_section()->gp_offset(got_offset, object);
1205212105 reloc_status = Reloc_funcs::relgot(view, gp_offset,
12053- calculate_only, &calculated_value);
12106+ this->calculate_only_,
12107+ &this->calculated_value_);
1205412108 // TODO(sasa): We should also initialize update_got_entry
1205512109 // in other place swhere relgot is called.
1205612110 update_got_entry = changed_symbol_value;
@@ -12066,18 +12120,18 @@ Target_mips<size, big_endian>::Relocate::relocate(
1206612120 object);
1206712121 gp_offset = target->got_section()->gp_offset(got_offset, object);
1206812122 reloc_status = Reloc_funcs::relgot(view, gp_offset,
12069- calculate_only,
12070- &calculated_value);
12123+ this->calculate_only_,
12124+ &this->calculated_value_);
1207112125 }
1207212126 else
1207312127 {
1207412128 if (rel_type == elfcpp::SHT_RELA)
1207512129 reloc_status = Reloc_funcs::do_relgot16_local(view, object,
12076- psymval, r_addend,
12077- extract_addend, 0,
12078- target,
12079- calculate_only,
12080- &calculated_value);
12130+ psymval, r_addend,
12131+ extract_addend, 0,
12132+ target,
12133+ this->calculate_only_,
12134+ &this->calculated_value_);
1208112135 else if (rel_type == elfcpp::SHT_REL)
1208212136 reloc_status = Reloc_funcs::relgot16_local(view, object,
1208312137 psymval, r_addend,
@@ -12101,8 +12155,9 @@ Target_mips<size, big_endian>::Relocate::relocate(
1210112155 GOT_TYPE_TLS_PAIR,
1210212156 object, r_addend);
1210312157 gp_offset = target->got_section()->gp_offset(got_offset, object);
12104- reloc_status = Reloc_funcs::relgot(view, gp_offset, calculate_only,
12105- &calculated_value);
12158+ reloc_status = Reloc_funcs::relgot(view, gp_offset,
12159+ this->calculate_only_,
12160+ &this->calculated_value_);
1210612161 break;
1210712162
1210812163 case elfcpp::R_MIPS_TLS_GOTTPREL:
@@ -12117,8 +12172,9 @@ Target_mips<size, big_endian>::Relocate::relocate(
1211712172 GOT_TYPE_TLS_OFFSET,
1211812173 object, r_addend);
1211912174 gp_offset = target->got_section()->gp_offset(got_offset, object);
12120- reloc_status = Reloc_funcs::relgot(view, gp_offset, calculate_only,
12121- &calculated_value);
12175+ reloc_status = Reloc_funcs::relgot(view, gp_offset,
12176+ this->calculate_only_,
12177+ &this->calculated_value_);
1212212178 break;
1212312179
1212412180 case elfcpp::R_MIPS_TLS_LDM:
@@ -12128,24 +12184,25 @@ Target_mips<size, big_endian>::Relocate::relocate(
1212812184 // the module index.
1212912185 got_offset = target->got_section()->tls_ldm_offset(object);
1213012186 gp_offset = target->got_section()->gp_offset(got_offset, object);
12131- reloc_status = Reloc_funcs::relgot(view, gp_offset, calculate_only,
12132- &calculated_value);
12187+ reloc_status = Reloc_funcs::relgot(view, gp_offset,
12188+ this->calculate_only_,
12189+ &this->calculated_value_);
1213312190 break;
1213412191
1213512192 case elfcpp::R_MIPS_GOT_PAGE:
1213612193 case elfcpp::R_MICROMIPS_GOT_PAGE:
1213712194 reloc_status = Reloc_funcs::relgotpage(target, view, object, psymval,
1213812195 r_addend, extract_addend,
12139- calculate_only,
12140- &calculated_value);
12196+ this->calculate_only_,
12197+ &this->calculated_value_);
1214112198 break;
1214212199
1214312200 case elfcpp::R_MIPS_GOT_OFST:
1214412201 case elfcpp::R_MICROMIPS_GOT_OFST:
1214512202 reloc_status = Reloc_funcs::relgotofst(target, view, object, psymval,
1214612203 r_addend, extract_addend,
12147- local, calculate_only,
12148- &calculated_value);
12204+ local, this->calculate_only_,
12205+ &this->calculated_value_);
1214912206 break;
1215012207
1215112208 case elfcpp::R_MIPS_JALR:
@@ -12160,8 +12217,8 @@ Target_mips<size, big_endian>::Relocate::relocate(
1216012217 cross_mode_jump, r_types[i],
1216112218 target->jalr_to_bal(),
1216212219 target->jr_to_b(),
12163- calculate_only,
12164- &calculated_value);
12220+ this->calculate_only_,
12221+ &this->calculated_value_);
1216512222 break;
1216612223
1216712224 case elfcpp::R_MIPS_TLS_DTPREL_HI16:
@@ -12169,65 +12226,73 @@ Target_mips<size, big_endian>::Relocate::relocate(
1216912226 case elfcpp::R_MICROMIPS_TLS_DTPREL_HI16:
1217012227 reloc_status = Reloc_funcs::tlsrelhi16(view, object, psymval,
1217112228 elfcpp::DTP_OFFSET, r_addend,
12172- extract_addend, calculate_only,
12173- &calculated_value);
12229+ extract_addend,
12230+ this->calculate_only_,
12231+ &this->calculated_value_);
1217412232 break;
1217512233 case elfcpp::R_MIPS_TLS_DTPREL_LO16:
1217612234 case elfcpp::R_MIPS16_TLS_DTPREL_LO16:
1217712235 case elfcpp::R_MICROMIPS_TLS_DTPREL_LO16:
1217812236 reloc_status = Reloc_funcs::tlsrello16(view, object, psymval,
1217912237 elfcpp::DTP_OFFSET, r_addend,
12180- extract_addend, calculate_only,
12181- &calculated_value);
12238+ extract_addend,
12239+ this->calculate_only_,
12240+ &this->calculated_value_);
1218212241 break;
1218312242 case elfcpp::R_MIPS_TLS_DTPREL32:
1218412243 case elfcpp::R_MIPS_TLS_DTPREL64:
1218512244 reloc_status = Reloc_funcs::tlsrel32(view, object, psymval,
1218612245 elfcpp::DTP_OFFSET, r_addend,
12187- extract_addend, calculate_only,
12188- &calculated_value);
12246+ extract_addend,
12247+ this->calculate_only_,
12248+ &this->calculated_value_);
1218912249 break;
1219012250 case elfcpp::R_MIPS_TLS_TPREL_HI16:
1219112251 case elfcpp::R_MIPS16_TLS_TPREL_HI16:
1219212252 case elfcpp::R_MICROMIPS_TLS_TPREL_HI16:
1219312253 reloc_status = Reloc_funcs::tlsrelhi16(view, object, psymval,
1219412254 elfcpp::TP_OFFSET, r_addend,
12195- extract_addend, calculate_only,
12196- &calculated_value);
12255+ extract_addend,
12256+ this->calculate_only_,
12257+ &this->calculated_value_);
1219712258 break;
1219812259 case elfcpp::R_MIPS_TLS_TPREL_LO16:
1219912260 case elfcpp::R_MIPS16_TLS_TPREL_LO16:
1220012261 case elfcpp::R_MICROMIPS_TLS_TPREL_LO16:
1220112262 reloc_status = Reloc_funcs::tlsrello16(view, object, psymval,
1220212263 elfcpp::TP_OFFSET, r_addend,
12203- extract_addend, calculate_only,
12204- &calculated_value);
12264+ extract_addend,
12265+ this->calculate_only_,
12266+ &this->calculated_value_);
1220512267 break;
1220612268 case elfcpp::R_MIPS_TLS_TPREL32:
1220712269 case elfcpp::R_MIPS_TLS_TPREL64:
1220812270 reloc_status = Reloc_funcs::tlsrel32(view, object, psymval,
1220912271 elfcpp::TP_OFFSET, r_addend,
12210- extract_addend, calculate_only,
12211- &calculated_value);
12272+ extract_addend,
12273+ this->calculate_only_,
12274+ &this->calculated_value_);
1221212275 break;
1221312276 case elfcpp::R_MIPS_SUB:
1221412277 case elfcpp::R_MICROMIPS_SUB:
1221512278 reloc_status = Reloc_funcs::relsub(view, object, psymval, r_addend,
1221612279 extract_addend,
12217- calculate_only, &calculated_value);
12280+ this->calculate_only_,
12281+ &this->calculated_value_);
1221812282 break;
1221912283 case elfcpp::R_MIPS_HIGHER:
1222012284 case elfcpp::R_MICROMIPS_HIGHER:
1222112285 reloc_status = Reloc_funcs::relhigher(view, object, psymval, r_addend,
12222- extract_addend, calculate_only,
12223- &calculated_value);
12286+ extract_addend,
12287+ this->calculate_only_,
12288+ &this->calculated_value_);
1222412289 break;
1222512290 case elfcpp::R_MIPS_HIGHEST:
1222612291 case elfcpp::R_MICROMIPS_HIGHEST:
1222712292 reloc_status = Reloc_funcs::relhighest(view, object, psymval,
1222812293 r_addend, extract_addend,
12229- calculate_only,
12230- &calculated_value);
12294+ this->calculate_only_,
12295+ &this->calculated_value_);
1223112296 break;
1223212297 default:
1223312298 gold_error_at_location(relinfo, relnum, r_offset,
@@ -12244,8 +12309,6 @@ Target_mips<size, big_endian>::Relocate::relocate(
1224412309 else
1224512310 got->update_got_entry(got_offset, psymval->value(object, 0));
1224612311 }
12247-
12248- r_addend = calculated_value;
1224912312 }
1225012313
1225112314 bool jal_shuffle = jal_reloc(r_type);