User`s guide

LIBRARY
Description
The default operation, if you do not specify an option, is /INSERT.
The LIBRARY command:
Creates, updates, modifies, lists, and maintains object library files.
Creates macro library files for use with the MACRO–11 assembler.
Library File Description
A library file is a direct-access file (a file that has a directory) that contains one or
more modules of the same type. RT–11 organizes library files so the linker and the
MACRO–11 assembler can access them rapidly.
Each object library is a file that contains a library header, library directory, and one
or more object modules. The object modules in a library file can be routines that are
repeatedly used in a program, routines that are used by more than one program, or
routines that are related and simply gathered together for convenience.
An example of a typical object library file is the default system library, SYSLIB.OBJ,
used by the linker. An example of a macro library file is SYSMAC.SML.
Each MACRO library file is a file that contains a library header, a library directory,
and macro definitions.
Inserting Input Files Into a Library
Each input file for an object library consists of one or more object modules, and is
stored on a device under a specific file name and file type. However, once you insert
an object module into a library file, you refer to the module by the module name, not
by the name of the file of which it was a part. For example, the input file FORT.OBJ
may exist on DU1: and can contain an object module called ABC. Once you insert
the module into a library, only refer to ABC and the library, and not to FORT.OBJ.
The input files normally do not contain main programs but only subprograms,
functions, and subroutines. The library file must never contain a FORTRAN BLOCK
DATA subprogram because there is no undefined global symbol to cause the linker
to load it automatically.
Accessing Library Files
You access object modules in a library file by making calls or references to their
global symbols; you link the object modules with the program that uses them by
using the LINK command to produce a single executable module.
See the Librarian (LIBR) utility chapter in the RT–11 System Utilities Manual for
further information on object and macro libraries.
Combining LIBRARY Options
You can combine the LIBRARY options with the exceptions of /EXTRACT and
/MACRO, which you cannot combine with most of the other functions.
156 RT–11 Command Descriptions