Keil Logo

Command Prompt

To invoke the BL51 Linker/Locator, enter BL51 at the command prompt. You must include object modules and directives on the command line or specify a command-response file. The format for the BL51 Linker command line is:

BL51 <[>inputlist<]> <[>TO outputfile<]> <[>directives<]>
BL51 @commandfile

Where

inputlist is a comma-separated list of object files (absolute or relocatable) for the linker to include in the absolute object module. You may force include object modules from library files by specifying the names in parentheses immediately after the library filename.

The inputlist uses the following general formats:
filename <[>(modulename <[>, ...<]>)<]> <[>, ...<]>
common {filename <[>(modulename <[>, ...<]>)<]>} <[>, ...<]>
bankx {filename <[>(modulename <[>, ...<]>)<]>} <[>, ...<]>

where

filename is the name of an OMF51 object file (created by the assembler or compiler) or a library file (created by the Library Manager). The filename must be specified with a file extension—OBJ for object files and LIB for library files.
modulename is the name of an object module stored in the specified library file. A modulename may only be specified in parentheses after the name of a library file. Multiple modulenames are separated by commas.
common specifies modules that are located in the common area (in a code banking program only).
bankx specifies modules that are located in code bank x (in a code banking program only).

Note

  • The common and bankx keywords that specify object modules are distinct from the common and bankx directives that specify program segments.
outputfile is the name of the absolute object file the linker creates. The filename of the outputfile is used as the base for the linker MAP file. If no outputfile is specified the linker uses the filename of the first object file in the inputlist.
directives are commands and parameters that control the operation of the linker.
commandfile is the name of a command file that can contain an inputlist, outputfile, and directives.

The following command line example invokes BL51, specifies the object file C:\MYDIR\PROG.OBJ, and specifies the absolute object file C:\MYDIR\PROG.ABS which the linker creates.

BL51 C:\MYDIR\PROG.OBJ TO C:\MYDIR\PROG.ABS

The following example specifies three input files (SAMPLE1.OBJ, SAMPLE2.OBJ, and SAMPLE3.OBJ) which are linked. The specified absolute object module (SAMPLE.ABS) is created.

BL51 SAMPLE1.OBJ, SAMPLE2.OBJ, SAMPLE3.OBJ TO SAMPLE.ABS

The following example specifies two object files (PROG1.OBJ, PROG2.OBJ) and a library file (UTILITY.LIB). The absolute object module (PROG1) is created. Externals that are not resolved from the specified object files are resolved with the public symbols of the library file. The required modules from the library are linked automatically.

BL51 PROG1.OBJ, PROG2.OBJ, UTILITY.LIB

The following example shows how to force inclusion of the IN and OUT modules from the UTILITY.LIB library.

BL51 PROG1.OBJ, PROG2.OBJ, UTILITY.LIB (IN, OUT)

Note

  • The BL51 Linker command-line can be very long because of the number of input files and directives specified. To enter long command-lines enter an ampersand character ('&') at the end of a line to indicate that input continues on the next line. The BL51 Linker prompts you with two greater-than signs ('>>') to indicate more arguments may be entered.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.