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.
This commit is contained in:
parent
4d78db49e6
commit
aab2c17756
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2017-03-15 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
|
||||||
|
|
||||||
* mips.cc (Mips_relobj::merge_processor_specific_data_): New data
|
* mips.cc (Mips_relobj::merge_processor_specific_data_): New data
|
||||||
|
|
16
gold/mips.cc
16
gold/mips.cc
|
@ -474,22 +474,24 @@ class Mips_got_entry
|
||||||
? this->d.object->name().c_str()
|
? this->d.object->name().c_str()
|
||||||
: this->d.sym->name());
|
: this->d.sym->name());
|
||||||
size_t addend = this->addend_;
|
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.
|
// Return whether this entry is equal to OTHER.
|
||||||
bool
|
bool
|
||||||
equals(Mips_got_entry<size, big_endian>* other) const
|
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)
|
if (this->tls_type_ == GOT_TLS_LDM)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return ((this->tls_type_ == other->tls_type_)
|
return (((this->symndx_ != -1U)
|
||||||
&& (this->symndx_ == other->symndx_)
|
? (this->d.object == other->d.object)
|
||||||
&& ((this->symndx_ != -1U)
|
: (this->d.sym == other->d.sym))
|
||||||
? (this->d.object == other->d.object)
|
&& (this->addend_ == other->addend_));
|
||||||
: (this->d.sym == other->d.sym))
|
|
||||||
&& (this->addend_ == other->addend_));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return input object that needs this GOT entry.
|
// Return input object that needs this GOT entry.
|
||||||
|
|
Loading…
Reference in New Issue