SLAU132Y September 2004 – June 2021
These options are specific to the MSP430 toolset. See the referenced sections for more information. MSP430-specific assembler options are listed in Section 3.4.11.
The MSP430 compiler now supports only the Embedded Application Binary Interface (EABI) ABI, which uses the ELF object format and the DWARF debug format. If you want support for the legacy COFF ABI, please use the MSP430 v4.4 Code Generation Tools and refer to SLAU132J and SLAU131J for documentation.
--common={on|off} | When on (the default ), uninitialized file scope variables are emitted as common symbols. When off, common symbols are not created. The benefit of allowing common symbols to be created is that generated code can remove unused variables that would otherwise increase the size of the .bss section. (Uninitialized variables of a size larger than 32 bytes are separately optimized through placement in separate subsections that can be omitted from a link.) Variables cannot be common symbols if they are assigned to a section other than .bss . | |
--code_model={large|small} | Specifies the code memory model: small (16-bit function pointers and low 64K memory) or large (20-bit function pointers and 1MB address space). See Section 7.2.1 for details. | |
--data_model={restricted|large| small} |
Specifies the data memory model: small (16-bit data pointers and low 64K memory), restricted (32-bit data pointers, objects restricted to 64K, and 1MB memory), and large (32-bit data pointers and 1MB memory). See Section 7.2.2 for details. | |
--disable_interrupts_around_hw_mpy=off | Setting this option to off leaves interrupts enabled during inlined
hardware multiplication. (Inlined hardware multiplication is
controlled by the --use_hw_mpy and --opt_for_speed options.) This option should only be used if all ISRs in the application do not use multiplication and do not call other functions. By default, if hardware multiplication is inlined, interrupts are disabled during hardware multiplication, because such operations are not re-entrant. If this option is set to off and an ISR uses multiplication, the linker issues a warning that multiplication within the ISR will use the RTS software multiply routine instead of the RTS hardware multiply routine. If this option is set to off and an ISR calls other functions, the linker generates a non-fatal error diagnostic indicating that the option --disable_interrupts_around_hw_mpy=off cannot be used if the application includes ISRs with calls to other functions. The reason for this is that if an ISR calls a routine that does multiplication using the hardware multiplier, then the inlined hardware multipliers with interrupts left enabled are no longer safe. |
|
--enum_type={packed|unpacked} | By default, the compiler uses --enum_type=unpacked,
which means the compiler uses an integer type no smaller than 16
bits (int, long, or long long) to store enumerated type variables.
The --enum_type=packed option causes the compiler to use an 8-bit
integer type if the enumeration constant values can fit into that
8-bit type. For details about enumerated type sizes, see Section 6.6.1. Do not link object files compiled with the --enum_type=packed option with object files that have been compiled without it. If you are using the --enum_type=packed option, you must use it consistently to compile all of your C/C++ files; otherwise, you will encounter errors that cannot be detected until run-time. |
|
--large_memory_model | This option is deprecated. Use --data_model=large. | |
--near_data={globals|none} | Specifies that global read/write data must be located in the first 64K of memory. See Section 7.2.3 for details. | |
--pending_instantiations=# | Specify the number of template instantiations that may be in progress at any given time. Use 0 to specify an unlimited number. | |
--plain_char={unsigned|signed} | Specifies how to treat C/C++ plain char variables. Default is unsigned. | |
--ramfunc={on|off} | If set to on, specifies that all functions should be
placed in the .TI.ramfunc section, which is placed in RAM. If set to
off, only functions with the ramfunc function attribute are treated
this way. See Section 6.17.2. Newer TI linker command files support the --ramfunc option automatically by placing functions in the .TI.ramfunc section. If you have a linker command file that does not include a section specification for the .TI.ramfunc section, you can modify the linker command file to place this section in RAM. See the MSP430 Assembly Language Tools User's Guide for details on section placement. |
|
--silicon_version | Selects the instruction set version. Using
--silicon_version=mspx generates code for MSP430X devices (20-bit
code addressing). Using --silicon_version=msp generates code for
16-bit MSP430 devices. Modules assembled/compiled for 16-bit MSP430 devices are not compatible with modules that are assembled/compiled for 20-bit MSPx devices. The linker generates errors if an attempt is made to combine incompatible object files. |
|
--use_hw_mpy[= 16,32,F5,none] | This option is a compiler option. It should be placed
on the command line before the -z option. MSP430 devices do not have a multiply instruction, and some devices have no hardware multiply at all. Multiplication is performed by a library function that either uses the hardware multiply capability or simulates it in software. By default, the compiler generates references to the version that does not use the hardware multiplier peripheral that is available on some versions of the MSP430 device. If your MSP430 device has multiply hardware, you can choose to use the library routine matching your hardware for best performance. When compiling for a device where the hardware multiplier is available, use the --use_hw_mpy compiler option. At compile time, using this option causes hardware multiply calls to be inlined during code generation if --opt_for_speed is set to 4 or 5 and --opt_level is set to any value other than "off". See the --disable_interrupts_around_hw_mpy=off option if you want to control whether interrupts are enabled during inlined hardware multiplication. If inlining is not enabled but other optimization is enabled (--opt_for_speed is set to 1, 2, or 3), using this option causes the linker to replace all references to the default multiply routine with the version of the multiply routine that uses the hardware multiplier support. The optional argument indicates which version of the hardware multiply is being used and must be one of the following:
For more information regarding the hardware multiplier, see the Family User’s Guide for the MSP430x1xx, MSP430x3xx, MSP430x4xx, and MSP430x5xx. |