This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: More on entry point option for ld

On Sat, Jun 30, 2001 at 01:26:51AM +1000, Fergus Henderson wrote:
> > I've tried using the '-e <entry point>' option for 'ld'
> That won't work, since the entry point is a procedure in the C runtime
> start-up code (often named `_start'), not `main'.  The procedure _start
> initializes the C runtime, sets up the values of argc and argv, and then
> calls main().
> Rather than using `-e', you should use `--wrap main'.
> See the documentation for `--wrap' in the GNU ld manual.

And what if you want to do initialization of a shared library
*after* initialization of libc and libstdc++ but *before*
any constructor of global objects of other libraries (or the
main program) are called?

What I need is:

0) zero-ing all static variables (including of shared libs)
1) initialization of the malloc library
2) calling my initialization routine
3) initialization of libstdc++ (cout, cerr etc, global objects if any)
4) initialization of everything else (constructors of global objects etc)

My initialization routine must be called prior to ANY call to malloc().
I already reported a problem with the intialization of cout, cerr etc
(ios::Init), I wonder what happened to this PR?  I claimed that it is
not conforming the standard, but I can't remember anyone replying.
and a correction in
I'd really like it when someone would reply to that :).

Carlo Wood <>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]