This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Use stable sort for ld -r relocs
- From: Alan Modra <amodra at gmail dot com>
- To: Paul_Koning at Dell dot com
- Cc: binutils at sourceware dot org
- Date: Thu, 27 Aug 2015 00:58:18 +0930
- Subject: Re: Use stable sort for ld -r relocs
- Authentication-results: sourceware.org; auth=none
- References: <20150826140258 dot GB24814 at bubble dot grove dot modra dot org> <EA81B1F8-1CF5-4044-A78E-E9C858329AF5 at dell dot com>
On Wed, Aug 26, 2015 at 02:15:06PM +0000, Paul_Koning@Dell.com wrote:
>
> > On Aug 26, 2015, at 10:02 AM, Alan Modra <amodra@gmail.com> wrote:
> >
> > A number of targets emit multiple relocs at a given r_offset, and
> > depend on those relocs staying in their original order. qsort doesn't
> > satisfy this requirement, although it appears from my non-rigorous
> > testing that glibc's msort.c implementation may in fact be stable.
>
> Stability is (or isn't) a property of the algorithm.
Agreed.
> It is not necessary to do "non-rigorous testing" and such testing is not conclusive.
I was merely giving a reason for why the problem hadn't come to light
sooner, not justifying my code. Using qsort as I did, was stupid.
--
Alan Modra
Australia Development Lab, IBM