This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][gold] Mips: Make the sh_info field of .rel.plt point to .plt
- From: Vladimir Radosavljevic <Vladimir dot Radosavljevic at imgtec dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: "ccoutant at gmail dot com" <ccoutant at gmail dot com>, Petar Jovanovic <Petar dot Jovanovic at imgtec dot com>
- Date: Wed, 18 Jan 2017 18:24:30 +0000
- Subject: [PATCH][gold] Mips: Make the sh_info field of .rel.plt point to .plt
- Authentication-results: sourceware.org; auth=none
This patch fixes the sh_info field of .rel.plt.
Regards,
Vladimir
ChangeLog -
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.
diff --git a/gold/mips.cc b/gold/mips.cc
index 4f50574..d682f7f 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -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);