
Controlling the Linking Process
4-9
Linking C Code
Note: The _c_int0 Symbol
One important function contained in the run-time-support library is _c_int0.
The symbol _c_int0 is the starting point in boot.obj; if you use the
−
c or
−
cr
linker option, _c_int0 is automatically defined as the entry point for the
program. If your program begins running from reset, you should set up the
reset vector to branch to _c_int0 so that the processor executes boot.obj first.
The boot.obj module contains code and data for initializing the run-time envi-
ronment. The module performs the following tasks:
1) Sets up the stack
2) Processes the run-time initialization table and autoinitializes global
variables (when using the
−
c option)
3) Calls main
4) Calls exit when main returns
Chapter 7 describes additional run-time-support functions that are included in
the library. These functions include ANSI C standard run-time support.
4.5.2 Specifying the Type of Initialization
The C compiler produces data tables for initializing global variables. Section
6.8.3,
Initialization Tables
,
on page 6-33 discusses the format of these tables.
These tables are in a named section called
.cinit
. The initialization tables are
used in one of the following ways:
-
Global variables are initialized at
run time
. Use the
−
c linker option (see
Autoinitialization of Variables at Run Time
, on page 6-34).
-
Global variables are initialized at
load time
. Use the
−
cr linker option (see
Initialization of Variables at Load Time
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...