diff options
author | Karl Millar <kmillar@google.com> | 2017-12-07 20:51:01 (GMT) |
---|---|---|
committer | Karl Millar <kmillar@google.com> | 2017-12-07 20:51:01 (GMT) |
commit | a1eab1c9de4d93ac639c0e2305a1505fc28a3b1c (patch) | |
tree | 0aec8010c754767e0bd5e05570e119cc7de1126e /src/patchelf.cc | |
parent | 29c085fd9d3fc972f75b3961905d6b4ecce7eb2b (diff) | |
download | patchelf-a1eab1c9de4d93ac639c0e2305a1505fc28a3b1c.zip patchelf-a1eab1c9de4d93ac639c0e2305a1505fc28a3b1c.tar.gz patchelf-a1eab1c9de4d93ac639c0e2305a1505fc28a3b1c.tar.bz2 |
Modified CompPhdr::operator() so that it provides a strict
weak ordering as required by std::sort.
Diffstat (limited to 'src/patchelf.cc')
-rw-r--r-- | src/patchelf.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc index 55b38e3..a9696e4 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -135,7 +135,10 @@ private: ElfFile * elfFile; bool operator ()(const Elf_Phdr & x, const Elf_Phdr & y) { - if (x.p_type == PT_PHDR) return true; + if (x.p_type == PT_PHDR) { + if (y.p_type == PT_PHDR) return false; + return true; + } if (y.p_type == PT_PHDR) return false; return elfFile->rdi(x.p_paddr) < elfFile->rdi(y.p_paddr); } |