This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: what are the crt files.
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Wed, 10 Mar 2010 10:55:31 +0100
- Subject: Re: what are the crt files.
- References: <935879.51655.qm@web95609.mail.in.yahoo.com>
- Reply-to: newlib at sourceware dot org
On Mar 10 09:55, Sanjeev Mk wrote:
> hi,
> On compiling a C program, i see it gets linked to crt* files. I
> understand these are the c runtime files.
>
> What functions do these files carry out and how do they work?
The crt files contain the code which is called when the binary gets
executed. Their job is initialization of libc datastructures and
eventually to call the executable's main() function.
> In several of my programs,i have not used string operations or print
> operations.But still many of them get loaded into memory,as confirmed
> by the .map file. How to prevent this from happening? Does this have
> anything to do with the c runtime files?
That's possible but not necessarily. Any of the C functions you
called could use string functions under the hood. If it's actually
the crt file, you have to figure out what it does. If it's one of
the newlib crt files, you can find the sources in libc/sys.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat