SLAU131Y October 2004 – June 2021
Linker options control linking operations. They can be placed on the command line or in a command file. Linker options must be preceded by a hyphen (-). Options can be separated from arguments (if they have them) by an optional space.
| Option | Alias | Description | Section |
|---|---|---|---|
| --run_linker | -z | Enables linking | Section 9.4 |
| --output_file | -o | Names the executable output module. The default filename is a.out. | Section 9.5.22 |
| --map_file | -m | Produces a map or listing of the input and output sections, including holes, and places the listing in filename | Section 9.5.17 |
| --stack_size | -stack | Sets C system stack size to size bytes and defines a global symbol that specifies the stack size. Default = 128 bytes | Section 9.5.28 |
| --heap_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 | Section 9.5.13 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --library | -l | Names an archive library or link command filename as linker input | Section 9.5.15 |
| --disable_auto_rts | Disables the automatic selection of a run-time-support library | Section 9.5.7 | |
| --priority | -priority | Satisfies unresolved references by the first library that contains a definition for that symbol | Section 9.5.15.3 |
| --reread_libs | -x | Forces rereading of libraries, which resolves back references | Section 9.5.15.3 |
| --search_path | -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. | Section 9.5.15.1 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --define | Predefines name as a preprocessor macro. | Section 9.5.9 | |
| --undefine | Removes the preprocessor macro name. | Section 9.5.9 | |
| --disable_pp | Disables preprocessing for command files | Section 9.5.9 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --diag_error | Categorizes the diagnostic identified by num as an error | Section 9.5.6 | |
| --diag_remark | Categorizes the diagnostic identified by num as a remark | Section 9.5.6 | |
| --diag_suppress | Suppresses the diagnostic identified by num | Section 9.5.6 | |
| --diag_warning | Categorizes the diagnostic identified by num as a warning | Section 9.5.6 | |
| --display_error_number | Displays a diagnostic's identifiers along with its text | Section 9.5.6 | |
| --emit_references:file[=file] | Emits a file containing section information. The information includes section size, symbols defined, and references to symbols. | Section 9.5.6 | |
| --emit_warnings_as_errors | -pdew | Treats warnings as errors | Section 9.5.6 |
| --issue_remarks | Issues remarks (nonserious warnings) | Section 9.5.6 | |
| --no_demangle | Disables demangling of symbol names in diagnostics | Section 9.5.19 | |
| --no_warnings | Suppresses warning diagnostics (errors are still issued) | Section 9.5.6 | |
| --set_error_limit | Sets the error limit to num. The linker abandons linking after this number of errors. (The default is 100.) | Section 9.5.6 | |
| --verbose_diagnostics | Provides verbose diagnostics that display the original source with line-wrap | Section 9.5.6 | |
| --warn_sections | -w | Displays a message when an undefined output section is created | Section 9.5.33 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --absolute_exe | -a | Produces an absolute, executable module. This is the default; if neither --absolute_exe nor --relocatable is specified, the linker acts as if --absolute_exe were specified. | Section 9.5.3.1 |
| --ecc={ on | off } | Enable linker-generated Error Correcting Codes (ECC). The default is off. | Section 9.5.10 Section 9.6.9 |
|
| --ecc:data_error | Inject the specified errors into the output file for testing | Section 9.5.10 Section 9.6.9 |
|
| --ecc:ecc_error | Inject the specified errors into the Error Correcting Code (ECC) for testing | Section 9.5.10 Section 9.6.9 |
|
| --mapfile_contents | Controls the information that appears in the map file. | Section 9.5.18 | |
| --relocatable | -r | Produces a nonexecutable, relocatable output module | Section 9.5.3.2 |
| --run_abs | -abs | Produces an absolute listing file | Section 9.5.26 |
| --xml_link_info | Generates a well-formed XML file containing detailed information about the result of a link | Section 9.5.34 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --entry_point | -e | Defines a global symbol that specifies the primary entry point for the output module | Section 9.5.11 |
| --globalize | Changes the symbol linkage to global for symbols that match pattern | Section 9.5.16 | |
| --hide | Hides global symbols that match pattern | Section 9.5.14 | |
| --localize | Changes the symbol linkage to local for symbols that match pattern | Section 9.5.16 | |
| --make_global | -g | Makes symbol global (overrides -h) | Section 9.5.16.1 |
| --make_static | -h | Makes all global symbols static | Section 9.5.16.1 |
| --no_symtable | -s | Strips symbol table information and line number entries from the output module | Section 9.5.21 |
| --retain | Retains a list of sections that otherwise would be discarded | Section 9.5.25 | |
| --scan_libraries | -scanlibs | Scans all libraries for duplicate symbol definitions | Section 9.5.27 |
| --symbol_map | Maps symbol references to a symbol definition of a different name | Section 9.5.30 | |
| --undef_sym | -u | Places an unresolved external symbol into the output module's symbol table | Section 9.5.31 |
| --unhide | Reveals (un-hides) global symbols that match pattern | Section 9.5.14 |
| Option | Alias | Description | Section |
|---|---|---|---|
| --arg_size | --args | Allocates memory to be used by the loader to pass arguments | Section 9.5.4 |
| --cinit_hold_wdt={on|off} | Hold (on) or do not hold (off) watchdog timer during cinit auto-initialization. | Section 9.12.5 | |
| --fill_value | -f | Sets default fill values for holes within output sections; fill_value is a 32-bit constant | Section 9.5.12 |
| --ram_model | -cr | Initializes variables at load time | Section 9.5.24 |
| --rom_model | -c | Autoinitializes variables at run time | Section 9.5.24 |
| --use_hw_mpy[={16|32|F5|none}] | This option is now a compiler option. It should be placed on the command line before the --run_linker or -z option. See the MSP430 Optimizing C/C++ Compiler User's Guide for details. | -- | |
| Option | Alias | Description | Section |
|---|---|---|---|
| --cinit_compression [=compression_kind] | Specifies the type of compression to apply to the C auto initialization data. The default if this option is used with no kind specified is lzss for Lempel-Ziv-Storer-Szymanski compression. Alternately, specify --cinit_compression=rle to use Run Length Encoded compression, which generally provides less efficient compression. | Section 9.5.5 | |
| --copy_compression [=compression_kind] | Compresses data copied by linker copy tables | Section 9.5.5 | |
| --unused_section_elimination | Eliminates sections that are not needed in the executable module; on by default | Section 9.5.8 | |
| Option | Alias | Description | Section |
|---|---|---|---|
| --linker_help | -help | Displays information about syntax and available options | – |
| --preferred_order | Prioritizes placement of functions | Section 9.5.23 | |
| --strict_compatibility | Performs more conservative and rigorous compatibility checking of input object files | Section 9.5.29 |