1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

ELFRelocationEntry::operator<(): Try to stabilize the order. r_offset was insufficient to sort Relocs.

It should fix llvm/test/CodeGen/ARM/ehabi-mc-compact-pr*.ll on some hosts.

  RELOCATION RECORDS FOR [.ARM.exidx]:
  0 R_ARM_PREL31 .text
  0 R_ARM_NONE __aeabi_unwind_cpp_pr0

FIXME: I am not sure of the directions of extra comparators, in Type and Index.
For now, they are different from the direction in r_offset.

llvm-svn: 181864
This commit is contained in:
NAKAMURA Takumi 2013-05-15 02:16:23 +00:00
parent f8c04c27fc
commit 11831ffe02

View File

@ -45,7 +45,14 @@ struct ELFRelocationEntry {
// Support lexicographic sorting.
bool operator<(const ELFRelocationEntry &RE) const {
return RE.r_offset < r_offset;
if (RE.r_offset != r_offset)
return RE.r_offset < r_offset;
if (Type != RE.Type)
return Type < RE.Type;
if (Index != RE.Index)
return Index < RE.Index;
llvm_unreachable("ELFRelocs might be unstable!");
return 0;
}
};