This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4] gold: Fix non-deterministic behaviour of Mips gold.


+    size_t addend = (sizeof(size_t) == 8
+                     ? (this->addend_ & 0xffffffffffff) << 16
+                     : (this->addend_ & 0xffff) << 16);
+    return name_hash_value ^ this->symndx_ ^ addend;

Mips_got_entry::addend_ is of type Mips_address, which is
Elf_types<size>::Elf_addr, So if you're building on a 64-bit host for
a 32-bit target, you'll have a 32-bit this->addend_, but a 64-bit
size_t. It's not clear to me why you want to mask the addend in either
case, though, and you're not taking advantage of a larger size_t by
shifting it further left. How about just this:

    size_t addend = this->addend_;
    return name_hash_value ^ this->symndx_ ^ (addend << 16);

If that's OK with you, I'll commit it with that change.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]