The compiler produces relocatable blocks of code
and data called sections, which are allocated in memory in a variety of ways
to conform to a various system configurations. For information about sections and
allocating them, see the introductory object file information in the TMS320C6000
Assembly Language Tools User's
Guide.
There are two basic types of
sections:
- Initialized sections
contain data or executable code. Initialized sections are usually read-only;
exceptions are noted below. The C/C++ compiler creates the following initialized
sections:
- The .args section contains the
command argument for a host-based loader. See the --arg_size
option.
- The .binit section
contains boot time copy tables. For details on BINIT, see the TMS320C6000
Assembly Language
Tools User's Guide.
- The .cinit section is created only
if you are using the --rom_model option. It contains tables for
explicitly initialized global and static variables.
- The .init_array section contains
the table for calling global constructors.
- The .ovly section contains copy tables for unions
in which different sections have the same run address.
- The .c6xabi.exidx section contains
the index table for exception handling. The .c6xabi.extab section
contains stack unwinding instructions for exception handling. See the
--exceptions option for details.
- The .name.load
section contains the compressed image of section name.See
the TMS320C6000 Assembly Language Tools User's Guide for
information on copy tables.
- The .ppdata section contains data
tables for compiler-based profiling. See the --gen_profile_info option
for details. This section is writable.
- The .ppinfo section contains
correlation tables for compiler-based profiling. See the
--gen_profile_info option for details.
- The .const section contains string
literals, floating-point constants, and data defined with the C/C++
qualifiers far and const (provided the constant is not
also defined as volatile or one of the exceptions described in
Section 7.5.2). String literals are placed in the .const:.string subsection to
enable greater link-time placement control.
- The .fardata section reserves space
for non-const, initialized far global and static variables. This section
is writable.
- The .neardata section reserves
space for non-const, initialized near global and static variables. This
section is writable.
- The .rodata section reserves space
for const near global and static variables.
- The .switch section contains jump
tables for large switch statements.
- The .text section contains all the executable code and
compiler-generated constants. This section is usually read-only.
- The .TI.crctab
section contains CRC checking tables.
- Uninitialized sections
reserve space in memory (usually RAM). A program can use this space at run time
to create and store variables. The compiler creates the following uninitialized
sections:
- The .bss section
reserves space for uninitialized global and static variables.
Uninitialized variables that are also unused are usually created as
common symbols (unless you specify --common=off) instead of being placed
in .bss so that they can be excluded from the resulting
application.
- The .far section
reserves space for global and static variables that are declared
far.
- The .stack section
reserves memory for the system
stack.
- The .sysmem
section reserves space for dynamic memory allocation. This space
is used by dynamic memory allocation routines, such as malloc(),
calloc(), realloc(), or new(). If a C/C++ program does not use these
functions, the compiler does not create the .sysmem section.
Note:
Use Only Code in Program MemoryWith the exception of code
sections, the initialized and uninitialized sections cannot be allocated into
internal program memory.
The
assembler creates the default sections .text, .bss, and .data. You can instruct the compiler to create additional
sections by using the CODE_SECTION and DATA_SECTION pragmas (see Section 7.9.3 and Section 7.9.6).