10.11.1. Run-Time Initialization

All C/C++ programs must be linked with code to initialize and execute the program, called a bootstrap routine, also known as the boot.c.o object module. The symbol _c_int00 is defined as the program entry point and is the start of the C boot routine in boot.c.o; referencing _c_int00 ensures that boot.c.o is automatically linked in from the run-time-support library. When a program begins running, it executes boot.c.o first. The boot.c.o symbol contains code and data for initializing the run-time environment and performs the following tasks:

  • Changes from system mode to user mode

  • Sets up the user mode stack

  • Processes the run-time .cinit initialization table and autoinitializes global variables (when the linker is invoked with the --rom_model option)

  • Calls main

The run-time-support object libraries contain boot.c.o. You can:

  • Use the archiver to extract boot.c.o from the library and then link the module in directly.

  • Include the appropriate run-time-support library as an input file (the linker automatically extracts boot.c.o when you use the --ram_model or --rom_model option).