aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-11-30 04:47:08 +0000
committerAlan Modra <amodra@gmail.com>2012-11-30 04:47:08 +0000
commitbb66a627d0b84ec3ec30849691d5ed16ffe91f5b (patch)
treec16e307eb0c5e83f3a765ec5dfa6a9e078ff652b /gold
parent69e601f38c6d3effef398e4224c3f8db788b0a9f (diff)
downloadgdb-bb66a627d0b84ec3ec30849691d5ed16ffe91f5b.zip
gdb-bb66a627d0b84ec3ec30849691d5ed16ffe91f5b.tar.gz
gdb-bb66a627d0b84ec3ec30849691d5ed16ffe91f5b.tar.bz2
* 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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/powerpc.cc27
2 files changed, 24 insertions, 10 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 9a2868e..8b44555 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index fd79312..e4aef13 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -1391,8 +1391,8 @@ Powerpc_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
{
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);
@@ -1407,7 +1407,7 @@ Powerpc_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
Symbol_table::PREDEFINED,
got, 0, 0,
elfcpp::STT_OBJECT,
- elfcpp::STB_WEAK,
+ elfcpp::STB_LOCAL,
elfcpp::STV_HIDDEN, 0,
false, false);
}
@@ -1574,13 +1574,20 @@ private:
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);