From a1eab1c9de4d93ac639c0e2305a1505fc28a3b1c Mon Sep 17 00:00:00 2001 From: Karl Millar Date: Thu, 7 Dec 2017 12:51:01 -0800 Subject: Modified CompPhdr::operator() so that it provides a strict weak ordering as required by std::sort. --- src/patchelf.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- cgit v0.12