Controlling the Linking Process
4-10
When you link a C program, you must use either the
−
c or
−
cr linker option.
These options tell the linker to select initialization at run time or load time.
When you compile and link programs, the
−
c linker option is the default. If
used, the
−
c linker option must follow the
−
Invoking
the Linker With the Compiler Shell
, on page 4-4. The following list outlines the
linking conventions used with
−
c or
−
cr:
-
The symbol _c_int0 is defined as the program entry point; it identifies the
beginning of the C boot routine in boot.obj. When you use
−
c or
−
cr, _c_int0
is automatically referenced, ensuring that boot.obj is automatically linked
in from the run-time-support library.
-
The
.cinit
output section is padded with a termination record so that the
loader (load time initialization) or the boot routine (run time initialization)
knows when to stop reading the initialization tables.
-
When using initializing at load time (the
−
cr linker option), the following
occur:
J
The linker sets the symbol cinit to
−
1. This indicates that the initializa-
tion tables are not in memory, so no initialization is performed at run
time.
J
The STYP_COPY flag (010h) is set in the .cinit section header.
STYP_COPY is the special attribute that tells the loader to perform
autoinitialization directly and not to load the .cinit section into memory.
The linker does not allocate space in memory for the .cinit section.
-
When autoinitializing at run time (
−
c linker option), the linker defines the
symbol cinit as the starting address of the .cinit section. The boot routine
uses this symbol as the starting point for autoinitialization.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...