This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Grouping object files and Linking

Hi,

I'm in the process of writing makefiles for the test case build. I'm compiling many source files in different paths using TI compiler version v6.0.2. At the end of compilation, assume I have 10 object files in different paths. Is it possible to combine 5 objects files into one object file say 'combined1.obj' and another 5 object files into one object file say  'combined2.obj' and then creating the out file using 'combined1.obj' and 'combined2.obj'?

Thanks,

Anand

  • Hi Anand!

    You can combine your set of obj-file at one lib-file through the creation of the library project. Thereafter you can include your lib-file to any your project.

    Regards,

    Igor

  • Yes you can Anand.

    9.3. Invoking the Linker

    The general syntax for invoking the linker is:

    cl55 --run_linker [options] filename1 .... filenamen
    cl55 --run_linker is the command that invokes the linker. The --run_linker option's short form is -z.
    options can appear anywhere on the command line or in a link command file. (Options are discussed in Section 9.4.)
    filename1, filenamen can be object files, link command files, or archive libraries. The default extension for all input files is .obj; any other extension must be explicitly specified. The linker can determine whether the input file is an object or ASCII file that contains linker commands. The default output filename is a.out, unless you use the --output_file option to name the output file.

    There are two methods for invoking the linker:

    • Specify options and filenames on the command line. This example links two files, file1.obj and file2.obj, and creates an output module named link.out.

    •  cl55 --run_linker file1.obj file2.obj --output_file=link.out
    • Put filenames and options in a link command file. Filenames that are specified inside a link command file must begin with a letter. For example, assume the file linker.cmd contains the following lines:

    •  --output_file=link.out file1.obj file2.obj
    • Now you can invoke the linker from the command line; specify the command filename as an input file:

    •  cl55 --run_linker linker.cmd
    • When you use a command file, you can also specify other options and files on the command line. For example, you could enter:

    •  cl55 --run_linker --map_file=link.map linker.cmd file3.obj
    • The linker reads and processes a command file as soon as it encounters the filename on the command line, so it links the files in this order: file1.obj, file2.obj, and file3.obj. This example creates an output file called link.out and a map file called link.map.

    For information on invoking the linker for C/C++ files, see Section 9.11.

    Regards,

    Gautam