Modified CompPhdr::operator() so that it provides a strict

weak ordering as required by std::sort.
This commit is contained in:
Karl Millar
2017-12-07 12:51:01 -08:00
parent 29c085fd9d
commit a1eab1c9de

View File

@@ -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);
}