SLAU132Y September 2004 – June 2021
The following tables list the linker options. See Chapter 5 of this document and the MSP430 Assembly Language Tools User's Guide for details on these options.
Option | Alias | Description |
---|---|---|
--run_linker | -z | Enables linking. |
--output_file=file | -o | Names the executable output file. The default filename is a .out file. |
--map_file=file | -m | Produces a map or listing of the input and output sections, including holes, and places the listing in file. |
--stack_size=size | [-]-stack | Sets C system stack size to size bytes and defines a global symbol that specifies the stack size. Default = 128 bytes. |
--heap_size=size | [-]-heap | Sets heap size (for the dynamic memory allocation in C) to sizebytes and defines a global symbol that specifies the heap size. Default = 128 bytes. |
Option | Alias | Description |
---|---|---|
--library=file | -l | Names an archive library or link command file as linker input. |
--disable_auto_rts | Disables the automatic selection of a run-time-support library. See Section 5.4.1.1. | |
--priority | -priority | Satisfies unresolved references by the first library that contains a definition for that symbol. |
--reread_libs | -x | Forces rereading of libraries, which resolves back references. |
--search_path=pathname | -I |
Alters library-search algorithms to look in a directory named with pathname before looking in the default location. This option must appear before the --library option. |
Option | Alias | Description |
---|---|---|
--define=name=value | Predefines name as a preprocessor macro. | |
--undefine=name | Removes the preprocessor macro name. | |
--disable_pp | Disables preprocessing for command files. |
Option | Alias | Description |
---|---|---|
--diag_error=num | Categorizes the diagnostic identified by num as an error. | |
--diag_remark=num | Categorizes the diagnostic identified by num as a remark. | |
--diag_suppress=num | Suppresses the diagnostic identified by num. | |
--diag_warning=num | Categorizes the diagnostic identified by num as a warning. | |
--display_error_number | Displays a diagnostic's identifiers along with its text. | |
--emit_references:file[=file] | Emits a file containing section information. The information includes section size, symbols defined, and references to symbols. | |
--emit_warnings_as_errors | -pdew | Treat warnings as errors. |
--issue_remarks | Issues remarks (non-serious warnings). | |
--no_demangle | Disables demangling of symbol names in diagnostic messages. | |
--no_warnings | Suppresses diagnostic warnings (errors are still issued). | |
--set_error_limit=count | Sets the error limit to count. The linker abandons linking after this number of errors. (The default is 100.) | |
--verbose_diagnostics | Provides verbose diagnostic messages that display the original source with line-wrap. | |
--warn_sections | -w | Displays a message when an undefined output section is created. |
Option | Alias | Description |
---|---|---|
--absolute_exe | -a | Produces an absolute, executable object file. This is the default; if neither --absolute_exe nor --relocatable is specified, the linker acts as if --absolute_exe were specified. |
--ecc={ on | off } | Enable linker-generated Error Correcting Codes (ECC). The default is off. | |
--ecc:data_error | Inject specified errors into the output file for testing. | |
--ecc:ecc_error | Inject specified errors into the Error Correcting Code (ECC) for testing. | |
--mapfile_contents=attribute | Controls the information that appears in the map file. | |
--relocatable | -r | Produces a nonexecutable, relocatable output object file. |
--run_abs | -abs | Produces an absolute listing file. |
--xml_link_info=file | Generates a well-formed XML file containing detailed information about the result of a link. |
Option | Alias | Description |
---|---|---|
--entry_point=symbol | -e | Defines a global symbol that specifies the primary entry point for the executable object file. |
--globalize=pattern | Changes the symbol linkage to global for symbols that match pattern. | |
--hide=pattern | Hides symbols that match the specified pattern. | |
--localize=pattern | Make the symbols that match the specified pattern local. | |
--make_global=symbol | -g | Makes symbol global (overrides -h). |
--make_static | -h | Makes all global symbols static. |
--no_symtable | -s | Strips symbol table information and line number entries from the executable object file. |
--retain | Retains a list of sections that otherwise would be discarded. | |
--scan_libraries | -scanlibs | Scans all libraries for duplicate symbol definitions. |
--symbol_map=refname=defname | Specifies a symbol mapping; references to the refname symbol are replaced with references to the defname symbol. The --symbol_map option is supported when used with --opt_level=4. | |
--undef_sym=symbol | -u | Adds symbol to the symbol table as an unresolved symbol. |
--unhide=pattern | Excludes symbols that match the specified pattern from being hidden. |
Option | Alias | Description |
---|---|---|
--arg_size=size | --args | Reserve size bytes for the argc/argv memory area. |
--cinit_hold_wdt={on|off} | Link in an RTS auto-initialization routine that either holds (on) or does not hold (off) the watchdog timer during cinit auto-initialization. See Section 5.4.5. | |
--cinit_compression[=type] | Specifies the type of compression to apply to the C auto initialization data. The default if this option is specified with no type is lzss for Lempel-Ziv-Storer-Szymanski compression. | |
--copy_compression[=type] | Compresses data copied by linker copy tables. The default if this option is specified with no type is lzss for Lempel-Ziv-Storer-Szymanski compression. | |
--fill_value=value | -f | Sets default fill value for holes within output sections |
--ram_model | -cr | Initializes variables at load time. See Section 5.4.7 for details. |
--rom_model | -c | Autoinitializes variables at run time. See Section 5.4.7 for details. |
--use_hw_mpy | This option is a compiler option. It should be placed on the command line before the --run_linker or -z option. See Section 3.4.4. |
Option | Alias | Description |
---|---|---|
--linker_help | [-]-help | Displays information about syntax and available options. |
--preferred_order=function | Prioritizes placement of functions. | |
--strict_compatibility[=off|on] | Performs more conservative and rigorous compatibility checking of input object files. Default is on. | |
--unused_section_elimination[=off|on] | Eliminates sections that are not needed in the executable module. Default is on. |