2.1.10. --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.
If you do not specify a ‑‑bss_threshold option, the compiler assumes ‑‑bss_threshold=8.
In the current version of RVCT, 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 this option 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.
Note
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 __attribute__((zero_init)).
int glob1, glob2; /* 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 and glob2 in a ZI data section.