src: make sort order deterministic, next try
We cannot compare pointers as they may point to qsort-local objects. And we must make sure that cmp(a,b) always agrees with cmp(b,a).
This commit is contained in:
@@ -329,6 +329,7 @@ ElfLinker::Section *ElfLinker::addSection(const char *sname, const void *sdata,
|
||||
assert(sname[strlen(sname) - 1] != ':');
|
||||
assert(findSection(sname, false) == nullptr);
|
||||
Section *sec = new Section(sname, sdata, slen, p2align);
|
||||
sec->sort_id = nsections;
|
||||
sections[nsections++] = sec;
|
||||
return sec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user