Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC][patch] Work around for gold/10400 bug.
@ 2009-07-22  8:55 Paul Pluzhnikov
  2009-07-22 10:46 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov @ 2009-07-22  8:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: ppluzhnikov

Greetings,

Perhaps I am jumping the gun here, but I'd like some comments on this
patch as well.

The patch below is on top of my earlier 'speedup find_fde' patch:

  http://sourceware.org/ml/gdb-patches/2009-07/msg00528.html

and works around the gold/10400 issue:

  http://sourceware.org/bugzilla/show_bug.cgi?id=10400

by using the first FDE entry when there are incompatible FDEs "covering"
the same code region. The first entry exactly corresponds to the COMDAT
section gold actually selected, and is the right one to use.

[Gold issue has been fixed, but it will be quite a while before I can pick
up that fix, and it would be nice to have a GDB workaround.]

Tested on Linux/x86_64 with no new failures.

Comments?

Thanks,
--
Paul Pluzhnikov

2009-07-21  Paul Pluzhnikov  <ppluzhnikov@google.com>

	gold/10400
	* dwarf2-frame.c (qsort_fde_cmp): Use stable sort.


Index: src/gdb/dwarf2-frame.c
===================================================================
--- src.orig/gdb/dwarf2-frame.c	2009-07-21 16:33:41.000000000 -0700
+++ src/gdb/dwarf2-frame.c	2009-07-21 16:43:46.000000000 -0700
@@ -1955,8 +1955,16 @@
   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 (char *) a - (char *) b;
+      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;
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-30 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22  8:55 [RFC][patch] Work around for gold/10400 bug Paul Pluzhnikov
2009-07-22 10:46 ` Andreas Schwab
2009-07-22 23:16   ` Paul Pluzhnikov
2009-07-30  4:40     ` Paul Pluzhnikov
2009-07-30 23:09       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox