Subject: Re: C++ compiler wackyness. - hack
To: Michael L. Hitch <>
From: Simon Burge <>
List: port-pmax
Date: 08/17/1998 11:49:44
On Sat, 15 Aug 1998 20:37:48 -0600  "Michael L. Hitch" wrote:

>   There is a library routine someplace [I think it's __main.o in libgcc.a]
> that contains _do_global_ctors() and __do_global_dtors(), which is where
> the segment violation occurs.  A "simple" work-around that wouldn't be much
> worse than defining dummy CTOR and DTOR lists would be to replace that
> file with dummy routines that don't do anything.

I've had a poke around, and some stuff in libgcc2.c looks promising.
In the #ifdef L_ctors section, it defines some default constructors
and destructors only for the Next and AIX, and everything else gets an
external definition only.

I've had a bit of play with this and not gotten anywhere, but someone
might see something useful here.  I tried:

  a) changing the #ifdef to include NetBSD/pmax
  b) makeing a separate shared library with just the constructor and
     destructor stuff in it
  c) adding an extern reference to crt0.c to try to pull it in

Are there actually valid things that _do_global_ctors() and
__do_global_dtors() do in any real c++ code?