+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'.
{
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;
}