Linking Large Uninitialized or Zero-initialized Variables
Linking Large Uninitialized or
Zero-initialized Variables
When linking an executable file that contains large uninitialized variables,
use the
NO_INIT
section qualifier to reduce the file size.
A variable defined in a source file normally takes up space in an object and
executable file even if that variable is not explicitly initialized when
defined. For large buffers, this action can result in large executables filled
mostly with zeros. Such files take up excess disk space and can incur long
download times when used with an emulator. This situation also may
occur when you boot from a loader file (because of the increased file size).
Listing C-2
shows an example of assembly source code.
the use of the
NO_INIT
segment.
The LDF can omit an output section from the output file. The
qualifier directs the linker to omit data for that section from the output
file.
Refer to
the
NO_INIT
The
NO_INIT
in previous (
NO_INIT
the
.LDR
nel to zero out the variable. This action reduces the loader's output
file size, but still requires execution time for the processor to ini-
tialize the memory with zeros.
C-4
(equivalent to
SHT_NOBITS
and
ZERO_INIT
"SECTIONS{}" on page 3-42
and
ZERO_INIT
qualifier corresponds to the
) development tools. Even if you do not use
.ACH
, the boot loader removes variables initialized to zeros from
file and replaces them with instructions for the loader ker-
VisualDSP++ 3.5 Linker and Utilities Manual
legacy qualifier) or
sections to avoid initialization of a
for more information on
section qualifiers.
/UNINIT
ZERO_INIT
Listing C-3
shows
NO_INIT
segment qualifier
for 16-Bit Processors
Need help?
Do you have a question about the VisualDSP++ 3.5 and is the answer not in the manual?
Questions and answers