This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: __main undefined symbol


Jeffrey A Law wrote:
> 
>  In message <38A07318.EA467014@haulpak.com>you write:
> 
>   > > You have to remember that GCC supports M different cpus and several file
>   > > formats, ALL of which have their own way of doing things and ALL of which
>   >  GCC
>   > > has to do correctly for their respective environments.
>   >
>   > Which is why ELF (from what little I know about it) will save us all--- exc
>   > ept in
>   > my world, where SREC and other binary-oriented formats are king.
>   >
>   > This is also why GCC shouldn't even *try* to do startup-specific stuff like
>   > calling _main.  That's crt0's job.
> But for a significant number of the platforms GCC supports we do not have
> control over what happens in crt0.

You don't need crt.o or any other gcc libs.  Furthermore, you don't need
a _main or a __main function. You can specify the entry point in your
linker script file.  I understand that board support packages make life
easier, but for a custom embedded system you're better off writing your
own library.  You can then tell the compiler not to link against the
standard libs, write your own linker script, and not worry about
_main or crt.o.  Then you'll know exactly what's going on under the
hood, and personally, I feel a lot better that way.


Pete

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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