From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Andreas Schwab <schwab@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][patch] Work around for gold/10400 bug.
Date: Wed, 22 Jul 2009 23:16:00 -0000 [thread overview]
Message-ID: <8ac60eac0907221332n70b19febj539b5c866f7fd2f4@mail.gmail.com> (raw)
In-Reply-To: <m3fxcpgkqo.fsf@hase.home>
[-- Attachment #1: Type: text/plain, Size: 330 bytes --]
On Wed, Jul 22, 2009 at 1:55 AM, Andreas Schwab<schwab@redhat.com> wrote:
>> + return (char *) a - (char *) b;
>
> This can overflow.
Fixed in the updated patch.
Thanks,
--
Paul Pluzhnikov
009-07-21 Paul Pluzhnikov <ppluzhnikov@google.com>
gold/10400
* dwarf2-frame.c (qsort_fde_cmp): Use stable sort.
[-- Attachment #2: gdb-gold-workaround-20090722.txt --]
[-- Type: text/plain, Size: 969 bytes --]
Index: src/gdb/dwarf2-frame.c
===================================================================
--- src.orig/gdb/dwarf2-frame.c 2009-07-22 13:26:17.000000000 -0700
+++ src/gdb/dwarf2-frame.c 2009-07-22 13:29:46.000000000 -0700
@@ -1958,9 +1958,18 @@
{
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;
}
next prev parent reply other threads:[~2009-07-22 20:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 8:55 Paul Pluzhnikov
2009-07-22 10:46 ` Andreas Schwab
2009-07-22 23:16 ` Paul Pluzhnikov [this message]
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=8ac60eac0907221332n70b19febj539b5c866f7fd2f4@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=gdb-patches@sourceware.org \
--cc=schwab@redhat.com \
/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