:
<>-'.
·i'-
-.,.-a.-
.""
Runtime
Environment
-
System
Initialization
5.8.2.3
RAM
Autoinitialization
Model
5-26
The
RAM
model, specified
with
the
-cr
linker option, allows variables
to
be
initialized at load time instead
of
at run time. This enhances system perform-
ance
by
reducing
boot
time and by saving the memory
that
would
ordinarily
be used
by
the initialization tables.
When you use the
-cr
linker option,
the
linker sets the
STYP-COPY
bit
in the
.cinit section's header; this
tells the loader
not
to
load the .cinit section into
memory. (The
.cinit
section occupies no space in the memory map.) The
linker also sets the
cinit
symbol
to
-1
(normally,
cinit
would
point
to
the
beginning
of
the initialization tables). This indicates to the
boot
routine
that
the initialization tables
are
not
present in memory; accordingly, no runtime
in-
itialization
is
performed at
boot
time.
Note that you must use a smart
loader
to
take advantage
of
the
RAM
model.
When the program
is
loaded, the loader must be able to:
• Detect the presence
of
the
.cinit
section in the object file.
•
Find
out
that
STYP-COPY
is
set in the .cinit section header, so that
it
knows
not
to
copy the .cinit section
into
memory.
• Understand the format
of
the initialization tables.
The loader then uses the initialization tables directly from
the
object file
to
in-
itialize variables in .bss.··-
Figure
5-7
illustrates the
RAM
model
of
autoinitialization.
Object
File
Memory
Figure 5-7.
RAM
Model
of
Autoinitialization