aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorVladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>2017-03-15 16:49:16 -0700
committerCary Coutant <ccoutant@gmail.com>2017-03-15 16:51:35 -0700
commitaab2c17756ee5bef0ea5783a460a0990450b3bd5 (patch)
tree827793526ffd34381d729e240000d2740528404a /gold
parent4d78db49e6eee097365e31f9b5b47e5391243979 (diff)
downloadfsf-binutils-gdb-aab2c17756ee5bef0ea5783a460a0990450b3bd5.zip
fsf-binutils-gdb-aab2c17756ee5bef0ea5783a460a0990450b3bd5.tar.gz
fsf-binutils-gdb-aab2c17756ee5bef0ea5783a460a0990450b3bd5.tar.bz2
Mips: Fix TLS LDM GOT entry.
gold/ * mips.cc (Mips_got_entry::hash()): Shift addend to reduce possibility of collisions. (Mips_got_entry::equals): Fix case for GOT_TLS_LDM entries.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/mips.cc16
2 files changed, 16 insertions, 7 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index d490468..d8d67e1 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,12 @@
2017-03-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
+ * mips.cc (Mips_got_entry::hash()): Shift addend to reduce
+ possibility of collisions.
+ (Mips_got_entry::equals): Fix case for GOT_TLS_LDM
+ entries.
+
+2017-03-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
+
* mips.cc (Mips_relobj::merge_processor_specific_data_): New data
member.
(Mips_relobj::merge_processor_specific_data): New method.
diff --git a/gold/mips.cc b/gold/mips.cc
index 4cf3364..4fc160b 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -474,22 +474,24 @@ class Mips_got_entry
? this->d.object->name().c_str()
: this->d.sym->name());
size_t addend = this->addend_;
- return name_hash_value ^ this->symndx_ ^ addend;
+ return name_hash_value ^ this->symndx_ ^ (addend << 16);
}
// Return whether this entry is equal to OTHER.
bool
equals(Mips_got_entry<size, big_endian>* other) const
{
+ if (this->symndx_ != other->symndx_
+ || this->tls_type_ != other->tls_type_)
+ return false;
+
if (this->tls_type_ == GOT_TLS_LDM)
return true;
- return ((this->tls_type_ == other->tls_type_)
- && (this->symndx_ == other->symndx_)
- && ((this->symndx_ != -1U)
- ? (this->d.object == other->d.object)
- : (this->d.sym == other->d.sym))
- && (this->addend_ == other->addend_));
+ return (((this->symndx_ != -1U)
+ ? (this->d.object == other->d.object)
+ : (this->d.sym == other->d.sym))
+ && (this->addend_ == other->addend_));
}
// Return input object that needs this GOT entry.