public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: DWARF2_UNWIND_INFO without crtstuff?
       [not found] <Pine.LNX.3.95.971001154605.396A-100000.cygnus.egcs@penguin.home>
@ 1997-10-07 12:03 ` Jason Merrill
  1997-10-17  7:08   ` Kamil Iskra
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Merrill @ 1997-10-07 12:03 UTC (permalink / raw)
  To: Kamil Iskra, egcs

>>>>> Kamil Iskra <kamil@dwd.interkom.pl> writes:

> According to a comment in except.c:

>    On targets that support crtstuff.c, the unwind information
>    is stored in a section named .eh_frame and the information for the
>    entire shared object or program is registered with a call to
>    __register_frame.  On other targets, the information for each
>    translation unit is registered separately with a static constructor.

> My question is: how do I turn these static constructors on?

The collect2 program notices the unwind tables and registers them.

Jason

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

* Re: DWARF2_UNWIND_INFO without crtstuff?
  1997-10-07 12:03 ` DWARF2_UNWIND_INFO without crtstuff? Jason Merrill
@ 1997-10-17  7:08   ` Kamil Iskra
  1997-10-17 14:36     ` Jason Merrill
  0 siblings, 1 reply; 4+ messages in thread
From: Kamil Iskra @ 1997-10-17  7:08 UTC (permalink / raw)
  To: Jason Merrill; +Cc: egcs

On 7 Oct 1997, Jason Merrill wrote:

> > According to a comment in except.c:
> >    On targets that support crtstuff.c, the unwind information
> >    is stored in a section named .eh_frame and the information for the
> >    entire shared object or program is registered with a call to
> >    __register_frame.  On other targets, the information for each
> >    translation unit is registered separately with a static constructor.
> > My question is: how do I turn these static constructors on?
> The collect2 program notices the unwind tables and registers them.

I had a look at the code and it seems that not all the possible cases are
covered.

collect2 will only notice the unwind tables when do_collecting is !0,
which is only the case when not using GNU ld. This means, that for example
all the a.out targets that use GNU ld should be affected (it is a mistery
for me why nobody else complained so far?).

I think I'll try to add code emitting a per-file static constructor, which
will register the unwind info. When using collect2 with do_collecting==0,
or not using collect2 at all (like in gcc2), the static constructors will
register the unwind info; otherwise, the constructor stubs will be ignored
and collect2 will take care of things. Or am I missing something?

/ Kamil Iskra - AMIGA 1200, 68030 50MHz, HDD 1.6 GB, 18 MB RAM \
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
| http://student.uci.agh.edu.pl/~iskra                         |
\ PGP public key available via Finger or WWW                   /


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

* Re: DWARF2_UNWIND_INFO without crtstuff?
  1997-10-17  7:08   ` Kamil Iskra
@ 1997-10-17 14:36     ` Jason Merrill
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 1997-10-17 14:36 UTC (permalink / raw)
  To: Kamil Iskra; +Cc: egcs

>>>>> Kamil Iskra <kiskra@ernie.icslab.agh.edu.pl> writes:

> collect2 will only notice the unwind tables when do_collecting is !0,
> which is only the case when not using GNU ld. This means, that for example
> all the a.out targets that use GNU ld should be affected (it is a mistery
> for me why nobody else complained so far?).

True.

> I think I'll try to add code emitting a per-file static constructor, which
> will register the unwind info.

This will be a lot slower.  I would suggest just using collect2.

Jason

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

* DWARF2_UNWIND_INFO without crtstuff?
@ 1997-10-01  7:00 Kamil Iskra
  0 siblings, 0 replies; 4+ messages in thread
From: Kamil Iskra @ 1997-10-01  7:00 UTC (permalink / raw)
  To: egcs

I've got a problem on m68k-amigaos. Thanks to Andreas Schwab, dwarf2
unwind info is now supported on m68k, so GCC uses -fno-sjlj-exceptions by
default, with DWARF2 unwind info instead of inline unwinders.

The problem is, that it just doesn't seem to work for me. I get "Abort
trap" every time an exception is throw.

According to a comment in except.c:

   On targets that support crtstuff.c, the unwind information
   is stored in a section named .eh_frame and the information for the
   entire shared object or program is registered with a call to
   __register_frame.  On other targets, the information for each
   translation unit is registered separately with a static constructor.

My target does not use crtstuff.c, neither does it use ELF, init sections
and all this nice stuff. It's a plain old a.out-based target.

By checking the assembler code produced by the compiler I can see the
unwind info there, but it doesn't seem to be referenced anywhere. Contrary
to the comment above, no static constructor is emitted, so the unwind info
is not registered and the program abort()s when an exception is thrown
(that's at least my current theory).

My question is: how do I turn these static constructors on?

And another question: how can I turn the DWARF2_UNWIND_INFO off, so that
-fsjlj-exceptions (which seems to work) is the default, as it used to be?
When DWARF2_UNWIND_INFO is undefined the cc1 linking stage fails, since
m68k.c calls dwarf2 unwind support functions, which are not compiled into
dwarf2out.c. Defining DWARF2_UNWIND_INFO to 0 doesn't seem to be the right
approach either, since most often the support code is enabled with #ifdef
DWARF2_UNWIND_INFO, not with a #if.

/ Kamil Iskra - AMIGA 1200, 68030 50MHz, HDD 1.6 GB, 18 MB RAM \
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
| http://student.uci.agh.edu.pl/~iskra                         |
\ PGP public key available via Finger or WWW                   /


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

end of thread, other threads:[~1997-10-17 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.3.95.971001154605.396A-100000.cygnus.egcs@penguin.home>
1997-10-07 12:03 ` DWARF2_UNWIND_INFO without crtstuff? Jason Merrill
1997-10-17  7:08   ` Kamil Iskra
1997-10-17 14:36     ` Jason Merrill
1997-10-01  7:00 Kamil Iskra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).