Crt0

From Wikipedia, the free encyclopedia

crt0 (also known as c0) is a set of execution startup routines compiled into a program which perform any initialization work required before calling the program's main function – it is a basic runtime library/run-time system. The work performed by crt0 depends on the program's language, compiler, operating system and C standard library implementation.[1]

"crt" stands for "C runtime" (the zero stands for "the very beginning"). However, when compiling using GCC, it is also included for other languages than C. More formally, crt0 is an object file called crt0.o, which is generally written in assembly language, and then linked by the linker to the object file compiled from the (C or other language) source code.

Alternative versions of crt0 are available for special situations. For example, the profiler gprof requires its programs to be compiled with gcrt0.[2]

References

  1. "The C Runtime Initialization, crt0.o". embecosm.com. 2010. Retrieved 2013-12-30. 
  2. "Compiling a Program for Profiling". GNU gprof. sourceware.org. Retrieved 2013-12-30. 

External links


This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.