+2012-11-30 Alan Modra <amodra@gmail.com>
+
+ * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
+ _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
+ (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
+ value if it already exists.
+
2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
PR gold/14858
{
if (size == 32)
{
- // Define a weak hidden _GLOBAL_OFFSET_TABLE_ to ensure it isn't
- // seen as undefined when scanning relocs (and thus requires
+ // Define _GLOBAL_OFFSET_TABLE_ to ensure it isn't seen as
+ // undefined when scanning relocs (and thus requires
// non-relative dynamic relocs). The proper value will be
// updated later.
Symbol *gotsym = symtab->lookup("_GLOBAL_OFFSET_TABLE_", NULL);
Symbol_table::PREDEFINED,
got, 0, 0,
elfcpp::STT_OBJECT,
- elfcpp::STB_WEAK,
+ elfcpp::STB_LOCAL,
elfcpp::STV_HIDDEN, 0,
false, false);
}
Output_data_got<size, big_endian>::add_constant(0);
// Define _GLOBAL_OFFSET_TABLE_ at the header
- this->symtab_->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
- Symbol_table::PREDEFINED,
- this, this->g_o_t(), 0,
- elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN,
- 0, false, false);
+ Symbol *gotsym = this->symtab_->lookup("_GLOBAL_OFFSET_TABLE_", NULL);
+ if (gotsym != NULL)
+ {
+ Sized_symbol<size>* sym = static_cast<Sized_symbol<size>*>(gotsym);
+ sym->set_value(this->g_o_t());
+ }
+ else
+ this->symtab_->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
+ Symbol_table::PREDEFINED,
+ this, this->g_o_t(), 0,
+ elfcpp::STT_OBJECT,
+ elfcpp::STB_LOCAL,
+ elfcpp::STV_HIDDEN, 0,
+ false, false);
}
else
Output_data_got<size, big_endian>::add_constant(0);