* elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
authorHans-Peter Nilsson <hp@axis.com>
Sun, 16 Jun 2002 20:48:46 +0000 (20:48 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Sun, 16 Jun 2002 20:48:46 +0000 (20:48 +0000)
bpo_reloc_no to break sort order ties, not address of items.

bfd/ChangeLog
bfd/elf64-mmix.c

index f732014ffd36e3109964c655ed742ba2727c13ec..3636adb012bc7a326d475640d1200e84dede6a5b 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
+       bpo_reloc_no to break sort order ties, not address of items.
+
 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
index 55ef061d645c2cfbcb5044000b07d423105b8cd5..0dc6655f38d7c9769131a727b8cf122c0100b478 100644 (file)
@@ -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
This page took 0.02924 seconds and 4 git commands to generate.