mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-24 03:12:49 +08:00
Modified CompPhdr::operator() so that it provides a strict
weak ordering as required by std::sort.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user