<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 14, 2016 at 12:33 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>> +static int cmpRel(const ELFRelocationEntry *AP, const ELFRelocationEntry<br>
>> *BP) {<br>
>> +  const ELFRelocationEntry &A = *AP;<br>
>> +  const ELFRelocationEntry &B = *BP;<br>
>> +  if (A.Offset != B.Offset)<br>
>> +    return B.Offset - A.Offset;<br>
>> +  if (B.Type != A.Type)<br>
>> +    return A.Type - B.Type;<br>
>> +  return 0;<br>
><br>
><br>
> This dropped the unreachable present in the prior version (which I just<br>
> commented on as well) - intentionally?<br>
><br>
<br>
</span>It was, sorry for taking so long to reply, I missed this before going<br>
on vacations.<br>
<br>
The story of that function is<br>
<br>
* We use to have some non determinism on the order relocations were<br>
created (walking a map/set of pointer?)<br>
* We started sorting to make it deterministic.<br>
* We got a target hook to implement mips craziness.<br>
* At some point the non determinism was fixed.<br>
* With this patch the function is now just part of the mips implementation.<br>
<br>
My thinking was that it was then OK for two relocations to compare<br>
equal, since they were created in a deterministic order. I now see<br>
that that thinking is bogus since different qsort implementations<br>
would produce different results. r257796 uses the assert you<br>
suggested.<br></blockquote><div><br></div><div>Dandy - thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Rafael<br>
</blockquote></div><br></div></div>