Standard S32DS C/C++ Linker

The Standard S32DS C/C++ Linker page displays the build configuration settings that apply to the C/C++ linker tool.

Table 1. Application Project Properties: Standard S32DS C/C++ Linker
Setting Description
Command The command pattern for the ${COMMAND} variable. This variable is used in the Command line pattern field (below). Default patterns:
  • C linker: ${cross_prefix}${cross_c}${cross_suffix}
  • C++ linker: ${cross_prefix}${cross_cpp}${cross_suffix}

The pattern uses the build variables specified on the Cross Settings page.

All options This read-only field shows all flags specified on all pages of the C/C++ linker tool settings. The C/C++ linker will be called with these flags at build time.
Command line pattern The command line pattern to call the C/C++ linker tool.

Default:

${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

General

The General page specifies the general properties of the Standard S32DS C/C++ Linker tool.

Table 2. Application Project Properties: Standard S32DS C/C++ Linker > General
Setting Description

Do not use standard start files

(-nostartfiles)

This option configures the linker to not use the standard system startup files when linking.

Do not use default libraries

(-nodefaultlibs)

This option configures the linker to not use the standard system libraries (such as newlib) when linking. Only the customer-specified libraries can be passed to the linker.

No startup or default libs

(-nostdlib)

This option configures the linker to not use the standard system startup files and libraries when linking. Only the customer-specified libraries can be passed to the linker.

Omit all symbols information (-s)

This option configures the linker to remove all symbol table and relocation table information from the executable.

No shared libraries (-static)

This option prevents linking with the shared libraries. This option makes sense on systems that support dynamic linking.
Note: The current version of S32 Design Studio supports linking with the shared libraries for the Cortex-A53 Linux processors only. For all other processors only the static libraries linking is supported.
Script files (-T) The linker script.

Libraries

The Libraries page specifies custom libraries and their locations to be used by the Standard S32DS C/C++ Linker tool during compilation.

Table 3. Application Project Properties: Standard S32DS C/C++ Linker > Libraries
Setting Description
Libraries (-l) The custom libraries to be linked to the application. The libraries will be linked in the top-down order they follow in the list.
Library search path (-L) The file paths where the linker looks for custom libraries specified in the Libraries (-l) field. The linker searches the paths in the order they follow in the list.

Miscellaneous

The Miscellaneous page specifies additional linker-specific flags and options not directly related to linking.

Table 4. Application Project Properties: Standard S32DS C/C++ Linker > Miscellaneous
Settings Description
Linker flags Additional command line options (flags). You can specify any required options supported by the GNU linker and not otherwise available on this page. Consult the documentation at the GNU Binutils site.
Other options

(-Xlinker [option])

System-specific linker options that GCC does not recognize. You can specify any options supported by the GNU linker and not otherwise available on this page.

To specify options that take their arguments after the equal sign, specify the option and its argument as a single item. For example, to compress the debug section, add --compress-debug-sections=zlib.

To specify options that take arguments after the space, add the option first, and then add the argument as an item that follows the option in the list. For example, to specify that armelfd emulation mode to be used, add -m as a single item, and then add armelfd as the item that follows.

Other objects The prioritized list of object file paths to be used when linking. The added paths are stores in the {application}.args file located in the Debug folder of the project.

If you add a relative path that starts with a period, put the path string in quotes.

Generate map The name of the MAP file to be generated by the linker. The generated MAP file lists the resource data in the ELF file. The MAP file is located in the Debug folder of the project structure.

To instruct the linker to not generate the MAP file but print the resource information to the console, leave this setting blank.

Default: $ {BuildArtifactFileBaseName}.map

Cross reference

(-Xlinker --cref)

This option instructs the linker to print the cross reference table. If the Generate map setting (above) specifies the file name, the table is printed to the specified MAP file. Otherwise, the table is printed to the console.

This cross reference table includes the “symbol - files” pairs. The symbols are sorted in alphabetical order, each followed by the file paths where this symbol is defined.

Print link map

(-Xlinker --printf-map)

This option instructs the linker to print the resource map to the console if the Generate map setting (above) is blank.

If the Generate map setting specifies the MAP file name, the linker ignores this option and prints the resource information to the MAP file.

Remove unused sections

(-Xlinker --gc-sections)

This option removes unused sections of code and data from the binary artifact.
Print removed sections

(-Xlinker --print-gc-sections)

This option instructs the linker to print the removed sections to the Console view.

This option makes sense if the Remove unused sections option (above) is enabled.

Support print float format for newlib_nano library

(-u_printf_float)

This option enables printing of floating-point formatted numbers to the console. This option assumes that semihosting is enabled and the system write function is provided by the debugger.

This option is grayed out by default. To make it available, set Library support to newlib_nano Debugger Console on the Target processor page.

When enabled, this option increases the heap and stack size.
Support scan float format for newlib_nano library

(-u_scanf_float)

This option enables scanning of floating-point formatted numbers from the console. This option assumes that semihosting is enabled and the system read function is provided by the debugger.

This option is grayed out by default. To make it available, set Library support to newlib_nano Debugger Console on the Target processor page.

When enabled, this option increases the heap and stack size.
Turn off page alignment of sections (-n) This option disables page alignment for sections of code.

Default: enabled.

EWL print formats Not used in the current version of the product.

This option specifies the print format for numbers. Options: none, int, int_FP, int_LL_FP.

Default: none.

This option is grayed out by default. To make it available, set Library support to ewl_nano_c Debugger Console/newlib_nano_c++ Debugger Console on the Target processor page.

EWL scan formats Not used in the current version of the product.

This option specifies the scan format for numbers. Options: none, int, int_FP, int_LL_FP.

Default: none.

This option is grayed out by default. To make it available, set Library support to ewl_nano_c Debugger Console/newlib_nano_c++ Debugger Console on the Target processor page.

Shared Library Settings

The Shared Library Settings page specifies shared libraries and their locations to be used by the Standard S32DS C/C++ Linker tool during compilation.
Note: The properties on the Shared Library Settings page are supported for the Cortex-A53 Linux processors Library projects only.
Table 5. Application Project Properties: Standard S32DS C/C++ Linker > Shared Library Settings
Setting Description
Shared (-shared) This option enables linking with the shared libraries. Compiler produces a shared object which can then be linked with other objects to form an executable.
Note: Option should be used for the Shared Library Artifact Type only, not the Executable Artifact Type.
Shared object name

(-Wl,-soname=)

This option instructs the linker to use the following internal name for shared object. It is used at compilation time by linker to determine the compatibility.
Import Library name

(-Wl,--out-implib=)

This option instructs the linker to also create the corresponding import library with the following name. After compilation the created import library can be linked instead of the dll.
DEF file name

(-Wl,--output-def=)

This option instructs the linker to generate a .DEF file with the following name for the built dll.
Note: In the current version of S32 Design Studio option is not supported.