Alter the Library Search Algorithm (--library Option, --search_path Option, and C6X_C_DIR Environment Variable)

Usually, when you want to specify a file as linker input, you simply enter the filename; the linker looks for the file in the current directory. For example, suppose the current directory contains the library object.lib. If this library defines symbols that are referenced in the file file1.obj, this is how you link the files:

cl6x --run_linker file1.obj object.lib

If you want to use a file that is not in the current directory, use the --library linker option. The --library option's short form is -l. The syntax for this option is:

--library=[pathname] filename

The filename is the name of an archive, an object file, or linker command file. You can specify up to 128 search paths.

The --library option is not required when one or more members of an object library are specified for input to an output section. For more information about allocating archive members, see Section 8.5.5.5.

You can augment the linker's directory search algorithm by using the --search_path linker option or the C6X_C_DIR environment variable. The linker searches for object libraries and command files in the following order:

  1. It searches directories named with the --search_path linker option. The --search_path option must appear before the --Iibrary option on the command line or in a command file.
  2. It searches directories named with C6X_C_DIR.
  3. If C6X_C_DIR is not set, it searches directories named with the assembler's C6X_A_DIR environment variable.
  4. It searches the current directory.