SPNU151W January 1998 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
This is the general syntax for linking C/C++ programs as a separate step:
armcl --run_linker {--rom_model | --ram_model} filenames | |
[options] [--output_file=name.out] --library=library [lnk.cmd] |
armcl --run_linker | The command that invokes the linker. |
--rom_model | --ram_model | Options that tell the linker to use special
conventions defined by the C/C++ environment. When you use
armcl --run_linker without listing any C/C++
files to be compiled on the command line, you must
use --rom_model or --ram_model on the command
line or in the linker command file. The --rom_model option
uses automatic variable initialization at run time; the
--ram_model option uses variable initialization at load
time. See Section 4.3.5 for details about using the --rom_model and --ram_model
options. If you fail to specify the ROM or RAM model, you
will see a linker warning that says:
|
filenames | Names of object files, linker command files, or archive libraries. The default extensions for input files are .c.obj (for C source files) and .cpp.obj (for C++ source files). 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. |
options | Options affect how the linker handles your object files. Linker options can only appear after the --run_linker option on the command line, but otherwise may be in any order. (Options are discussed in detail in the ARM Assembly Language Tools User's Guide.) |
--output_file= name.out | Names the output file. |
--library= library | Identifies the appropriate archive library containing C/C++ run-time-support and floating-point math functions, or linker command files. If you are linking C/C++ code, you must use a run-time-support library. You can use the libraries included with the compiler, or you can create your own run-time-support library. If you have specified a run-time-support library in a linker command file, you do not need this parameter. The --library option's short form is -l. |
lnk.cmd | Contains options, filenames, directives, or commands for the linker. |
The default file extensions for object files created by the compiler have been changed. Object files generated from C source files have the .c.obj extension. Object files generated from C++ source files have the .cpp.obj extension.
When you specify a library as linker input, the linker includes and links only those library members that resolve undefined references. The linker uses a default allocation algorithm to allocate your program into memory. You can use the MEMORY and SECTIONS directives in the linker command file to customize the allocation process. For information, see the ARM Assembly Language Tools User's Guide.
You can link a C/C++ program consisting of object files prog1.c.obj, prog2.c.obj, and prog3.cpp.obj, with an executable object file filename of prog.out with the command:
armcl --run_linker --rom_model prog1 prog2 prog3 --output_file=prog.out
--library=rtsv4_A_be_eabi.lib