7.16 --bss_threshold=num

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.

Syntax

--bss_threshold=num
Where:
num
is either:
0
place small global ZI data items in ZI data sections
8
place small global ZI data items in RW data sections.

Usage

In RVCT 2.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.

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("name"))) and __attribute__((zero_init)).

Default

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.

Example

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.
Related reference
9.75 #pragma arm section [section_type_list]
9.65 __attribute__((section("name"))) variable attribute
9.71 __attribute__((zero_init)) variable attribute
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.