what are the crt files.

Corinna Vinschen vinschen@redhat.com
Wed Mar 10 09:55:00 GMT 2010

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 Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list