This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: mips g++ and __main?
- From: "Mile Davidovic" <mile dot davidovic at micronasnit dot com>
- To: "'James E Wilson'" <wilson at specifixinc dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Thu, 10 Feb 2005 08:20:27 +0100
- Subject: RE: mips g++ and __main?
- Organization: MicronasNIT
- Reply-to: <mile dot davidovic at micronasnit dot com>
Thanks a lot for Your answers.
Best regards Mile.
-----Original Message-----
From: James E Wilson [mailto:wilson@specifixinc.com]
Sent: Thursday, February 10, 2005 4:12 AM
To: mile.davidovic@micronasnit.com
Cc: gcc@gcc.gnu.org
Subject: Re: mips g++ and __main?
Mile Davidovic wrote:
> I am using mips g++ compiler. I am wondering is it enaugh to call
> _init in crt0.S before jumping to main or I should call some __main
> function?
This initialization is very target dependent. Since you didn't specify the
target, I can't give a definite answer. Generally, you only need to call
one of them, which ever one is used by the target. Generally, ELF targets
use _init, and old targets used __main, but there are exceptions. You
probably should look at the libgloss directory of the newlib project on
sources.redhat.com which contains example working crt0.S files for a number
of embedded targets.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com