5.1.61. Link options (pcomp_LinkOptions)

Specify or append linker options when building a model.

5.1.61.1. Supported targets

All targets

5.1.61.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.61.3. Description

After RTW has generated code for a model, a compiler converts the code into a binary image suitable for the ECU to execute. Which compiler to use is chosen through the RTW Compiler Selection option.

The compiler's linker combines each of the compiled source code files into a binary image using various transformations, some of which can be modified via command line options to the compiler. The pcomp_LinkOptions block selects whether to use the default linker options supplied with OpenECU, to add additional options to the default options, or to replace the default options altogether.

Warning

Alteration of the linker options may lead to a model which will not build, or a model which will not run on the target ECU or which may run initially but fail later on. When reporting a failure through technical support, please specify any changed linker options as this may help resolve the issue more quickly.

All Diab compilers

The default linker options for all WindRiver Diab compilers are:

OptionUse
-f65535 fill unused memory regions with set bits — this mirrors the functionality of some post-processing build scripts
-lc ask the linker to include part of the standard C library
-lm ask the linker to include the math part of the standard C library
-m2 ask the linker to produce a map file with a particular layout — essential for some post-processing of the build files
-t... set to -tPPCE200Z3VEF for the M220, M221, M250, M460 and M461 or set to -tPPCE200Z7VEF for the M670 — selects the processor for the target ECU
-Xcheck-overlapping ask the linker to check that memory regions and data within those regions, do not overlap
-Xelf ask the linker to generate an ELF object file format — essential for some post-processing of the build files
GCC 4.7.3 Compiler

The default linker options for the GCC compiler are:

OptionUse
-M print a link map to the standard output
-lgcc ask the linker to try and link against libgcc.a
-lc ask the linker to include part of the standard C library
-lm ask the linker to include the math part of the standard C library
--check-sections ask the linker to check section addresses after they have been assigned to see if there are any overlaps
--emit-stub-syms label linker stubs with a local symbol that encodes the stub type and destination
-cref output a cross reference table. If a linker map file is being generated, the cross reference table is printed to the map file. Otherwise, it is printed on the standard output
-m elf32ppc emulate the elf32ppc linker

Note

Its outside the scope of this User Guide to explain all the different linker options in detail and their resulting affect on the ECU binary image. Please refer to appropriate compiler User Guide for more information.

Note

Alteration of the linker options may remove options which work around known bugs in the compiler. For a list of known bugs which affect OpenECU, see Section 1.5.9.2, “Known defects”, Section 1.5.10.2, “Known defects”, Section 1.5.11.2, “Known defects” and Section 1.5.12.2, “Known defects”.

5.1.61.4. Inports

None.

5.1.61.5. Outports

None.

5.1.61.6. Mask parameters

  • Mode

    Whether to use the default linker options, whether to add linker options to the default options, or whether to replace the default options altogether.

    Value type:List
    Calibratable:No
  • Linker options

    The options to add to the default linker options, or to replace the default options, as selected by parameter Mode.

    Value type:String
    Calibratable:No

5.1.61.7. Notes

None.