Language Implementation
7-19
7
Object Module Section Use
The compiler generates assembly language that uses the following object
file format sections to allocate storage for code and data:
.text The compiler places all assembly language
instructions and constant data in the
.text
section. Constant data includes initialized
variables with the
const type qualifier, as well
as string and floating-point literals.
.data The compiler places any initialized data in the
.data section. Initialized data includes any
statically allocated variables that you declare
with an initialization list.
.bss The compiler locates uninitialized data in the
.bss section as follows:
Uninitialized static variables go directly into
.bss.
Uninitialized external variables are defined with
the
.comm directive. If the command line
specifies the relaxed ref-def linkage (gcc960’s
mno-strict-ref-def option or ic960’s Gdc
option), the linker places these variables in
.data if an initializing definition exists in
another module. Otherwise, the linker places
these variables in
.bss. If the command line
specifies strict ref-def linkage (gcc960’s
mstrict-ref-def option or ic960’s Gds
option), all uninitialized static variables are
placed directly in the
.bss section.