8.20 --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.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.