This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Purpose of startup files for ARM


> Hi all,
> 
> Thanks for the response, just two more questions.
> 
> >
> >Almost.. You missed the following.
> >- run any library initialization routines
> >- run any constructors
> >
> 
> Can you give me an example of the library init routines that are required and
> which constructors would be required? I have used gcc with the -nostartfiles
> option and I haven't seen the need for either yet?
> 

Well, this is where it will depend on which library you are using.  Some 
libraries have to do some initialization, for example to bind the terminal 
onto the stdio FILE descriptors.  I can't remember for newlib, it maybe 
that all this is done by magic or when the relevant file is first used.  
The point is that crt0 and the library have to act in collusion here, you 
just have to know since there's no standard.

Constructors will also vary from target to target.  Some are done by 
iterating over the elf .init_array section, others are done by having 
main() call __main (sometimes __gccmain on ARM) which does it for you.  If 
you don't use C++, or if you do but don't have static constructors in your 
code, you probably don't have to worry about this.

R.



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


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