src: make sort order deterministic

This commit is contained in:
Markus F.X.J. Oberhumer
2023-08-28 02:08:34 +02:00
parent d65fea1147
commit f4e5b29708
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -98,7 +98,8 @@ PackVmlinuxBase<T>::compare_Phdr(void const *aa, void const *bb)
if (xa > xb) return 1;
if (a->p_paddr < b->p_paddr) return -1; // ascending by .p_paddr
if (a->p_paddr > b->p_paddr) return 1;
return 0;
// What could remain?
return aa < bb ? -1 : 1; // make sort order deterministic/stable
}
template <class T>