aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-mmix.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-06-16 20:48:46 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-06-16 20:48:46 +0000
commitdfbbae4ca321070f0cce7bc3b619c953e1f72eb2 (patch)
tree24c4d6e5614981d0d2adf6576ab7cdc0288773d3 /bfd/elf64-mmix.c
parentc8cca39f988d5670cbef3d40cf7b9fa26877aee4 (diff)
downloadgdb-dfbbae4ca321070f0cce7bc3b619c953e1f72eb2.zip
gdb-dfbbae4ca321070f0cce7bc3b619c953e1f72eb2.tar.gz
gdb-dfbbae4ca321070f0cce7bc3b619c953e1f72eb2.tar.bz2
* elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
bpo_reloc_no to break sort order ties, not address of items.
Diffstat (limited to 'bfd/elf64-mmix.c')
-rw-r--r--bfd/elf64-mmix.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 55ef061..0dc6655 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -2226,8 +2226,12 @@ bpo_reloc_request_sort_fn (p1, p2)
if (r1->value != r2->value)
return r1->value > r2->value ? 1 : -1;
- /* As a last re-sort, use the address so we get a stable sort. */
- return r1 > r2 ? 1 : (r1 < r2 ? -1 : 0);
+ /* As a last re-sort, use the relocation number, so we get a stable
+ sort. The *addresses* aren't stable since items are swapped during
+ sorting. It depends on the qsort implementation if this actually
+ happens. */
+ return r1->bpo_reloc_no > r2->bpo_reloc_no
+ ? 1 : (r1->bpo_reloc_no < r2->bpo_reloc_no ? -1 : 0);
}
/* For debug use only. Dumps the global register allocations resulting