Make the sh_info field of .rel.plt point to .plt (MIPS).
authorVladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
Tue, 24 Jan 2017 01:18:00 +0000 (17:18 -0800)
committerCary Coutant <ccoutant@gmail.com>
Tue, 24 Jan 2017 01:18:00 +0000 (17:18 -0800)
gold/
* mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
type.
(Target_mips::make_plt_entry): Make the sh_info field of .rel.plt
point to .plt.

gold/ChangeLog
gold/mips.cc

index c074564e60fb18513576cc9179468e0c65aaab61..d98ff0ba654fed7417b24e4a3dc41f9b54405b78 100644 (file)
@@ -1,3 +1,10 @@
+2017-01-23  Vladimir Radosavljevic  <Vladimir.Radosavljevic@imgtec.com>
+
+       * mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
+       type.
+       (Target_mips::make_plt_entry): Make the sh_info field of .rel.plt
+       point to .plt.
+
 2017-01-23  Vladimir Radosavljevic  <Vladimir.Radosavljevic@imgtec.com>
 
        PR gold/21054
index ca3dd00545149f1625fe3223dee21bb02f0325bf..56af570651e6bb72123806656bbe928d2c3d9a47 100644 (file)
@@ -2475,7 +2475,7 @@ class Mips_output_data_plt : public Output_section_data
   add_entry(Mips_symbol<size>* gsym, unsigned int r_type);
 
   // Return the .rel.plt section data.
-  const Reloc_section*
+  Reloc_section*
   rel_plt() const
   { return this->rel_; }
 
@@ -8521,6 +8521,10 @@ Target_mips<size, big_endian>::make_plt_entry(Symbol_table* symtab,
                                       (elfcpp::SHF_ALLOC
                                        | elfcpp::SHF_EXECINSTR),
                                       this->plt_, ORDER_PLT, false);
+
+      // Make the sh_info field of .rel.plt point to .plt.
+      Output_section* rel_plt_os = this->plt_->rel_plt()->output_section();
+      rel_plt_os->set_info_section(this->plt_->output_section());
     }
 
   this->plt_->add_entry(gsym, r_type);