Keil™, An ARM® Company

RealView Linker and Utilities Guide

Specifying an input file list

2.2.3. Specifying an input file list

The content of all input files must be unique. If symbols are multiply defined the linker produces an error message.

These options define the input files passed to the linker:

input-file-list

This is a space-separated list of objects, libraries, or symbol definitions (symdefs) files. The linker sorts through the input file list in order. If the linker is unable to resolve input file problems then a diagnostic message is produced.

The symdefs files can be included in the list to provide global symbol values for previously generated image files. See Accessing symbols in another image for more information.

You can use libraries in the input file list in the following ways:

  • Specify a library to be added to the list of libraries that is used to extract members if they resolve any non weak unresolved references. For example, specify mystring.lib in the input file list.

    Note

    Members from the libraries in this list are added to the image only when they resolve an unresolved non weak reference.

  • Specify particular members to be extracted from a library and added to the image as individual objects. For example, specify mystring.lib(strcmp.o) in the input file list.

The linker automatically searches the appropriate C and C++ libraries in order to select the best standard functions for your image. You can use --no_scanlib to prevent automatic searching of the standard libraries.

The linker processes the input file list in the following order:

  1. Objects are added to the image unconditionally.

  2. Members selected from libraries using patterns are added to the image unconditionally, as if they are objects. For example, the following command unconditionally adds all a*.o objects and stdio.o from mylib:

    armlink main.o mylib(stdio.o) mylib(a*.o)
    

    On UNIX platforms you might need to escape the parentheses, for example:

    armlink main.o mylib\(stdio.o\)
    
  3. The standard C or C++ libraries are added to the list of libraries that are later used to resolve any remaining references.

For more information see Library searching, selection, and scanning.

‑‑libpath pathlist

Specifies a list of paths that are used to search for the ARM standard C and C++ libraries.

The default path for the parent directory containing the ARM libraries is specified by the RVCT31LIB environment variable. Any paths specified here override the path specified by RVCT31LIB.

pathlist is a comma-separated list of paths that are only used to search for required ARM libraries. Do not include spaces between the comma and the path name when specifying multiple path names, for example, path1,path2,path3,...,pathn.

This list must end with the parent directory of the ARM library directories armlib and cpplib.

Note

This option does not affect searches for user libraries. Use ‑‑userlibpath instead.

See Library searching, selection, and scanning for more information on including libraries.

‑‑library_type=lib

Enables the relevant library selection to be used at link time.

Where lib can be one of:

standardlib

Specifies that the full RVCT runtime libraries are selected at link time. This is the default.

microlib

Specifies that the C micro-library (microlib) is selected at link time.

Note

This option can be used with the compiler, assembler or linker when use of the libraries require more specialized optimizations.

Use this option with the linker to override all other ‑‑library_type options.

For more information see:

--[no_]reduce_paths

Enables or disables the elimination of redundant pathname information in file paths. This option is valid for Windows systems only.

Windows systems impose a 260 character limit on file paths. Where relative pathnames exist whose absolute names expand to longer than 260 characters, you can use the --reduce_paths option to reduce absolute pathname length by matching up directories with corresponding instances of .. and eliminating the directory/.. sequences in pairs.

Note

It is recommended that you avoid using long and deeply nested file paths, in preference to minimizing path lengths using the --reduce_paths option.

See --[no_]reduce_paths in the Compiler Reference Guide for more information.

‑‑[no_]scanlib

Enables or disables scanning of default libraries (the standard ARM C and C++ libraries) to resolve references. ‑‑scanlib is the default.

‑‑userlibpath pathlist

Specifies a list of paths that are used to search for user libraries.

pathlist is a comma-separated list of paths that are used to search for the required libraries. Do not include spaces between the comma and the path name when specifying multiple path names, for example, path1,path2,path3,...,pathn.

See Library searching, selection, and scanning for more information on including user libraries.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0377A