qsort: ldctor.c CONSTRUCTORS
authorAlan Modra <amodra@gmail.com>
Mon, 14 Oct 2019 03:27:01 +0000 (13:57 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 14 Oct 2019 06:17:13 +0000 (16:47 +1030)
commit3d9ee7d24be691e8b89cb5ebf0db744be279d8db
tree147e7737f9ad5aece81d86128dd57becec88730d
parent08dec09d8a26c115921b17110da1e07cb233c494
qsort: ldctor.c CONSTRUCTORS

ctor_cmp had an ineffective comparison of addresses in an attempt to
ensure sort stability.  Comparing the addresses passed to the
comparison function can't work since those addresses may be from an
array that is already perturbed by qsort.

* ldctor.h (struct set_element): Make next field a union, adding
idx field.
* ldctor.c (ctor_cmp): Dereference pointer and lose unnecessary
const.  Replace final sort on pointer value with final sort on idx.
(ldctor_add_set_entry): Adjust next field access.
(ldctor_build_sets): Likewise.  Set u.idx field for sort.
ld/ChangeLog
ld/ldctor.c
ld/ldctor.h
This page took 0.024773 seconds and 4 git commands to generate.