Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.241

Linker

The Linker page contains options specific to the linker. All settings on this page have global scope.

 

To open Linker page click Project menu / Settings / Linker.

 

ProjectSettingsLinkertab

 

 

Linker Path - Specifies the path to the linker's EXE file. If the linker path is left blank, then the first argument in the Options setting should be the translator path. This allows per file configuration of the used linker (since, for example, some older ARM linkers provide a separate linker for ARM and Thumb mode).

 

Options - Enter command line options the linker will be called with (a path to the Indirection File with perhaps some additional options).

 

Link Order - Change the order in which object files are passed to the linker.

 

Skip object file existence check - When checked, winIDEA will not check whether all linker input files (object, library) exist. By default, this option is off.

 

Indirection File - Due to the large number of options that a linker must handle, most linkers can retrieve linkage options from an indirection file (also called command file, link file etc.).

 

Build Manager uses the indirection file to tell the linker which object and library files should be linked. It will search the indirection file for occurrence of translation characters, and replace them with a list of object files generated from the project files list.

The following features and rules apply to creating indirection files that can be used by winIDEA:

oAll occurrences of %1 are replaced with options specified in the Options field.

oAll occurrences of % 2 are replaced with the name of the final output file (see Executable File).

oOccurrences of translated characters are replaced with the names of object files.

All these conversions do not have any influence on the original indirection file. From it a new file is generated and the linker is given this file as the indirection file. When the linker finishes, this file is erased. The location, where this file is generated, is specified in the Generate Replacement in option.

 

Generate replacement in - The replacement file for the Linker Indirection file will be generated in the location, specified here. The available locations are:

the same directory: creates the replacement indirection file in the same directory as the original indirection file. This option is the default and recommended as it allows the indirection file to contain references to other files in relative form.

Project Root directory - Creates the replacement indirection file in the Project Root directory.

Target Exec directory - Creates the replacement indirection file in the current target's Exec directory.

 

Edit button - Indirection file can be simply accessed via Edit button.

 

Translation Character - When the translation character ('&' default) is encountered in the indirection file the Build Manager replaces it with the names of object files derived from the project files list. There must always be at least two translation characters. The string of characters that they embed is used as the delimiter between object files. See example below.

 

Path separator - Character is used in the indirection file to construct a full path to an object file. Most linkers understand the backslash '\', but others expect a forward slash '/'.

 

CR-LF After File Name - Every object/library file name will be written in a new line.

 

 

Example for Translation Character

If project files are TST1.C, TST2.C, TST3.C and LIBRARY.LIB, then &,& expands to TST1.OBJ,TST2.OBJ,TST3.OBJ,LIBRARY.LIB

If you check the CR-LF After File Name option, then every object/library file name will be written in a new line:

 

TST1.OBJ,
TST2.OBJ,
TST3.OBJ,
LIBRARY.LIB

 

If more than two translation characters occur, the following syntax applies: &<prefix>&<delimiter>&<postfix>&<group>&

For each project file <prefix> will be put before the file name, and <postfix> behind the name. Project files will be delimited with <delimiter>. If a group is specified, then only project files that belong to the specified group are inserted at that position.

 

If in the previous example LIBRARY.LIB and TST1.C belong to group COMMON and TST2 and TST3 to group BANK1 then following code:

 

BASE 0
&load &&&COMMON&
BASE 8192
&load &&&BANK1&
generates:
BASE 0
load LIBRARY.LIB
load TST1.OBJ
BASE 8192
load TST2.OBJ
load TST3.OBJ

 

The Build Manager will keep a record of which groups have already been written, so if a translation character sequence without group specification is found, the object files of all remaining groups are written in that place.

 

Here is a summary of how fields between translation characters will be interpreted for different numbers of translation characters:

 

&<delimiter>&
&<prefix>&<delimiter>&
&<prefix>&<delimiter>&<postfix>&
&<prefix>&<delimiter>&<postfix>&<group>&

 

Note: The placement of tags in the indirection file takes precedence over link order settings.

 

Copyright © 2024 TASKING Germany GmbH