The _c_int00 Function

The function _c_int00 is the startup routine (also called the boot routine) for C/C++ programs. It performs all the steps necessary for a C/C++ program to initialize itself.

The name _c_int00 means that it is the interrupt handler for interrupt number 0, RESET, and that it sets up the C environment. Its name need not be exactly _c_int00, but the linker sets _c_int00 as the entry point for C programs by default. The compiler's run-time-support library provides a default implementation of _c_int00.

The startup routine is responsible for performing the following actions:

  1. Set up status and configuration registers
  2. Set up the stack
  3. Process the .cinit run-time initialization table to autoinitialize global variables (when using the --rom_model option)
  4. Call all global object constructors in .init_array (for EABI) .pinit (for COFF)
  5. Call the function main
  6. Call exit when main returns