diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-05-17 18:51:33 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-05-17 18:51:33 +0000 |
commit | 125b4fde3b3a12817b5b423045fa69de53a27e7f (patch) | |
tree | 10e773f7f1c64af51c97511e1e5260afef94c67b /include | |
parent | ed3c685148deaf4f7b1cd9e3b4e2c90744b0445d (diff) |
Merging r181864:
------------------------------------------------------------------------
r181864 | chapuni | 2013-05-14 19:16:23 -0700 (Tue, 14 May 2013) | 10 lines
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.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_33@182149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCELFObjectWriter.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/MC/MCELFObjectWriter.h b/include/llvm/MC/MCELFObjectWriter.h index a59776d5cd..65dd1e8998 100644 --- a/include/llvm/MC/MCELFObjectWriter.h +++ b/include/llvm/MC/MCELFObjectWriter.h @@ -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; } }; |