SPRUIG8J January 2018 – March 2024
This is the general syntax for linking C/C++ programs as part of the compile step:
cl7xfilenames [options] --run_linker [--rom_model | --ram_model] filenames | |
[options] [--output_file=name.out] --library=library [lnk.cmd] |
The --run_linker option divides the command line into the compiler options (the options before --run_linker) and the linker options (the options following --run_linker). The --run_linker option must follow all source files and compiler options on the command line.
All arguments that follow --run_linker on the command line are passed to the linker. These arguments can be linker command files, additional object files, linker options, or libraries. These arguments are the same as described in Section 11.1.1.
All arguments that precede --run_linker on the command line are compiler arguments. These arguments can be C/C++ source files or compiler options. These arguments are described in Section 3.2.
You can compile and link a C/C++ program consisting of object files prog1.c, prog2.c, and prog3.c, with an executable object file filename of prog.out with the command:
cl7x prog1.c prog2.c prog3.c --run_linker --ram_model --output_file=prog.out --library=rts7100_le.lib
When you use cl7x --run_linker after listing at least one C/C++ file to be compiled on the same command line, by default the --rom_model is used for automatic variable initialization at run time. See Section 11.3.4 for details about using the --rom_model and --ram_model options.
Order of Processing Arguments in the Linker: The order in which the linker processes arguments is important. The compiler passes arguments to the linker in the following order: