10.4.9. Miscellaneous Options

The options listed in the subsections below control how the linker handles other behaviors. On the tiarmclang command-line they should be passed to the linker using the -Wl or -Xlinker option as described in Passing Options to the Linker.

10.4.9.1. Option Summary

--linker_help (-help)

Displays information about syntax and available options.

--preferred_order

Prioritizes placement of functions. See Prioritizing Function Placement (--preferred_order Option).

--zero_init

Controls preinitialization of uninitialized variables. Default is on. Always off if --ram_model is used. See Zero Initialization (--zero_init Option).

10.4.9.2. Prioritizing Function Placement (--preferred_order Option)

The compiler prioritizes the placement of a function relative to others based on the order in which --preferred_order options are encountered during the linker invocation. The syntax is:

--preferred_order=function specification

10.4.9.3. Zero Initialization (--zero_init Option)

The C and C++ standards require that global and static variables that are not explicitly initialized must be set to 0 before program execution. The C/C++ compiler supports preinitialization of uninitialized variables by default. To turn this off, specify the linker option --zero_init=off.

The syntax for the --zero_init option is:

--zero_init[={on|off}]

Zero initialization takes place only if the --rom_model linker option, which causes autoinitialization to occur, is used. If you use the --ram_model option for linking, the linker does not generate initialization records, and the loader must handle both data and zero initialization.

Note

Disabling Zero Initialization Not Recommended In general, disabling zero initialization is not recommended. If you turn off zero initialization, automatic initialization of uninitialized global and static objects to zero will not occur. You are then expected to initialize these variables to zero in some other manner.