Article View: gnu.g++.help
Article #257_CTOR_LIST and _DTOR_LIST on DS3100
From: John Juer
Date: Thu, 11 Oct 1990 10:31
Date: Thu, 11 Oct 1990 10:31
60 lines
2149 bytes
2149 bytes
> I have built g++ 1.37.1 and libg++ 1.37.0 on the DecStation 3100 but
> run into problems whenever I try to make one of the test programs:
>
> g++ test.hello.o -L/other/X.V11R4.mips/pdsoft/libg++-1.37.0/src -lg++ -lm -
o test0
> ld:
> Undefined:
> __DTOR_LIST__
> __CTOR_LIST__
> *** Error code 1
We run g++ 1.37.1 on Dec 3100
You have to use collect. In your makefile put
COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF
If you run g++ with the -v it should do something like
g++ -O -o myprog -v main.o lib/pr.a lib/ut.a lib/sy.a lib/co.a lib/lx.a \
lib/sy.a cft/cftout.o
g++ version 1.37.1 (based on GCC 1.37)
ld -r -o /usr/tmp/cca27472.R -G 8 /lib/crt0.o main.o lib/pr.a lib/ut.a lib/sy
.a lib/co.a lib/lx.a lib/sy.a cft/cftout.o -L/usr/local/lib -lg++ /usr/local/lib
/gcc-gnulib -lc
collect -o /usr/tmp/cca27472.S /usr/tmp/cca27472.R
as /usr/tmp/cca27472.S -o /usr/tmp/cca27472.O
ld -o myprog /usr/tmp/cca27472.R /usr/tmp/cca27472.O
You also need a couple of routines to actually use the lists
of constructors/destructors set up by collect. We have
void
__do_global_init ()
{
extern void (*__CTOR_LIST__)();
register void (**ppf)() = &__CTOR_LIST__;
register int *pi = (int *)ppf;
register int nc = *pi;
ppf++;
while (nc)
{
(*ppf)();
nc--;
ppf++;
}
}
__main() { /* g++ calls this directly after entry into main */
__do_global_init();
}
in the g++ library , and a similar hack for exit.
Janet: jj00@uk.co.eurotherm | Eurotherm Limited, Faraday Close,
Internet: jj00@eurotherm.co.uk | Durrington, Worthing, W.Sussex, England.
UUCP: {ukc,uunet}!etherm!jj00 | Phone: +44 903 68500 x2229 Fax: +44 903 65982
Technical Details
Message-ID:
<28402.9010111031@pine.eurotherm.co.uk>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!eurotherm.co.uk!jj00Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!eurotherm.co.uk!jj00 From: jj00@eurotherm.co.uk (John Juer) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: _CTOR_LIST and _DTOR_LIST on DS3100 Message-ID: <28402.9010111031@pine.eurotherm.co.uk> Date: 11 Oct 90 10:31:13 GMT Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.g++.help Distribution: gnu Organization: GNUs Not Usenet Lines: 60