* [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
* Re: [RFC][patch] Work around for gold/10400 bug.
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
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2009-07-22 10:46 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
ppluzhnikov@google.com (Paul Pluzhnikov) writes:
> + 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;
This can overflow.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][patch] Work around for gold/10400 bug.
2009-07-22 10:46 ` Andreas Schwab
@ 2009-07-22 23:16 ` Paul Pluzhnikov
2009-07-30 4:40 ` Paul Pluzhnikov
0 siblings, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov @ 2009-07-22 23:16 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
[-- 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;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][patch] Work around for gold/10400 bug.
2009-07-22 23:16 ` Paul Pluzhnikov
@ 2009-07-30 4:40 ` Paul Pluzhnikov
2009-07-30 23:09 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov @ 2009-07-30 4:40 UTC (permalink / raw)
To: gdb-patches
On Wed, Jul 22, 2009 at 1:32 PM, Paul Pluzhnikov<ppluzhnikov@google.com> wrote:
> Fixed in the updated patch.
http://sourceware.org/ml/gdb-patches/2009-07/msg00569.html
Ping?
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][patch] Work around for gold/10400 bug.
2009-07-30 4:40 ` Paul Pluzhnikov
@ 2009-07-30 23:09 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2009-07-30 23:09 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
On Wed, Jul 29, 2009 at 05:42:44PM -0700, Paul Pluzhnikov wrote:
> On Wed, Jul 22, 2009 at 1:32 PM, Paul Pluzhnikov<ppluzhnikov@google.com> wrote:
>
> > Fixed in the updated patch.
>
> http://sourceware.org/ml/gdb-patches/2009-07/msg00569.html
>
> Ping?
I guess this is OK. It's a bit shorter-lived than most things we have
added workarounds for, but it at least has an explanatory comment :-)
--
Daniel Jacobowitz
CodeSourcery
^ 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