| |||
| Home > Compiler Command-line Options > --bss_threshold=num | |||
This option controls the placement of small global ZI data items in sections. A small global ZI data item is an uninitialized data item that is eight bytes or less in size.
--bss_threshold=num
Where:
numis either:
0place small global ZI data items in ZI data sections
8place small global ZI data items in RW data sections.
In ARM Compiler 4.1 and later, the compiler might place small global ZI data items in RW data sections as an optimization. In RVCT 2.0.1 and earlier, small global ZI data items were placed in ZI data sections by default.
Use --bss_threshold=0 to emulate the behavior
of RVCT 2.0.1 and earlier with respect to the placement of small
global ZI data items in ZI data sections.
Selecting the option --bss_threshold=0 instructs
the compiler to place all small global ZI data items
in the current compilation module in a ZI data section. To place
specific variables in:
a ZI data section,
use __attribute__((zero_init))
a specific ZI data section, use a combination of __attribute__((section(" and name")))__attribute__((zero_init)).
If you do not specify a --bss_threshold option,
the compiler assumes --bss_threshold=8.
If you specify an ARM Linux configuration file on the command
line and you use --translate_gcc or --translate_g++,
the compiler assumes --bss_threshold=0.
int glob1; /* ZI (.bss) in RVCT 2.0.1 and earlier */ /* RW (.data) in RVCT 2.1 and later */
Compiling this code with --bss_threshold=0 places glob1 in
a ZI data section.