Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ppluzhnikov@google.com (Paul Pluzhnikov)
To: gdb-patches@sourceware.org
Cc: ppluzhnikov@google.com
Subject: [RFC][patch] Work around for gold/10400 bug.
Date: Wed, 22 Jul 2009 08:55:00 -0000	[thread overview]
Message-ID: <20090722001233.C049876BC0@localhost> (raw)

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;
 }


             reply	other threads:[~2009-07-22  0:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22  8:55 Paul Pluzhnikov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090722001233.C049876BC0@localhost \
    --to=ppluzhnikov@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox