Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"call ___main" ???

229 views
Skip to first unread message

Christian Reitz (MODOS)

unread,
Jul 15, 1994, 6:24:01 AM7/15/94
to
When I recently examined assembler code that was produced by gcc (2.5.8) I
found a subroutine call for ___main. This call was always done before the "
real" programm.
I found a label ___main in __main.o (libgcc.a) but no source code.

So, can anybody post me the source code of ___main or info about where I can
get it or, at least, tell me what is going on there ?

As an aside, any information about gcrt0.o and stuff like that would be
appreciated as well.

Thanks in advance

Clark Bremer

unread,
Jul 18, 1994, 6:11:38 AM7/18/94
to
In article <REITZ.7....@rog1.rog.rwth-aachen.de> RE...@rog1.rog.rwth-aachen.de (Christian Reitz (MODOS)) writes:
>From: RE...@rog1.rog.rwth-aachen.de (Christian Reitz (MODOS))
>Subject: "call ___main" ???
>Date: Fri, 15 Jul 1994 10:24:01 GMT

>When I recently examined assembler code that was produced by gcc (2.5.8) I
>found a subroutine call for ___main. This call was always done before the "
>real" programm.
>I found a label ___main in __main.o (libgcc.a) but no source code.

>So, can anybody post me the source code of ___main or info about where I can
>get it or, at least, tell me what is going on there ?

__main() preforms C++ initialization. If you have no C++ code in your
program, the call will have no effect. If you do have C++ code in your
program, your static constructors will be called. CB.

===========================================================================
_ _ Clark Bremer cla...@netstar.com
/ /_) Software Engineer, NetStar Inc.
\_/__) 10250 Valley View Road MPLS, MN 55344

0 new messages