[ELF] Don't compare an atom with itself in compareByPosition().
authorDavide Italiano <davide@freebsd.org>
Sun, 1 Feb 2015 05:06:45 +0000 (05:06 +0000)
committerDavide Italiano <davide@freebsd.org>
Sun, 1 Feb 2015 05:06:45 +0000 (05:06 +0000)
commitcd84ed35bdfdab784e4de37d8e0c86fb05f4e7f4
tree1a9903b4c7ecdcb43d866e1e03294371fd780e52
parent1ecdf4ad3023f6ff5a5e6bebbe501c7cfabbcc98
[ELF] Don't compare an atom with itself in compareByPosition().

This caused some tests to fail on FreeBSD, and Mac OS X.
Some std::sort() implementations will check for strict-weak-ordering
by comparing with the same element, or will compare an element to
itself for 1-element sequence. Take care of this case. Thanks to
chandlerc for explaning that to me.

Reviewed by: ruiu

llvm-svn: 227709
lld/lib/Core/DefinedAtom.cpp