]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2009-08-06 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 6 Aug 2009 23:25:49 +0000 (23:25 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 6 Aug 2009 23:25:49 +0000 (23:25 +0000)
gold/10400
* dwarf2-frame.c (qsort_fde_cmp): Use stable sort.

gdb/ChangeLog
gdb/dwarf2-frame.c

index 4fa115975093b91af48774ac62701e70b605a692..d25bd48c916a9227df5548c15583025ef2174ea4 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-06  Paul Pluzhnikov  <ppluzhnikov@google.com>
+       
+       gold/10400
+       * dwarf2-frame.c (qsort_fde_cmp): Use stable sort.      
+       
 2009-08-06  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
        * dwarf2-frame.c (struct dwarf2_cie): Remove 'next'.
index 66176591b9a2e0f441354e72d1d61646c8a419dc..0f6da4052b47c23de035eb09fec5517c17c71ea5 100644 (file)
@@ -1958,9 +1958,18 @@ qsort_fde_cmp (const void *a, const void *b)
 {
   struct dwarf2_fde *aa = *(struct dwarf2_fde **)a;
   struct dwarf2_fde *bb = *(struct dwarf2_fde **)b;
+
   if (aa->initial_location == bb->initial_location)
-    /* Put eh_frame entries after debug_frame ones.  */
-    return aa->eh_frame_p - bb->eh_frame_p;
+    {
+      if (aa->address_range != bb->address_range
+          && aa->eh_frame_p == 0 && bb->eh_frame_p == 0)
+        /* Linker bug, e.g. gold/10400.
+           Work around it by keeping stable sort order.  */
+        return (a < b) ? -1 : 1;
+      else
+        /* Put eh_frame entries after debug_frame ones.  */
+        return aa->eh_frame_p - bb->eh_frame_p;
+    }
 
   return (aa->initial_location < bb->initial_location) ? -1 : 1;
 }