LINK [ HP Link Editor/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Link Editor/XL Reference Manual
LINK
This command creates an executable program file. It does this by merging
the relocatable object modules from all the files in the FROM= parameter.
(These files can be relocatable object files, relocatable library files,
or a combination of both.) The link editor also searches the relocatable
libraries specified by the RL= parameter and includes the modules in
those libraries containing definitions that resolve external references.
Syntax
LINK [FROM= source_file [, source_file...]
[;TO= dest_file]
[;RL= rl_file [, rl_file]...]
[;XL= xl_file [, xl_file]...]
[;CAP= cap_list]
[;NMSTACK= max_stack_size]
[;NMHEAP= max_heap_size]
[;UNSAT= unsat_name]
[;PARMCHECK= check_level]
[;PRIVLEV= priv_level]
[;PRI= priority_level]
[;MAXPRI= max_priority_level]
[;ENTRY= entry_name]
[;NODEBUG]
[;MAP]
[;SHOW]
Parameters
source_file Names a relocatable object file or a relocatable
library file. The file must be a binary file of type
NMOBJ or NMRL. The link editor merges all the
relocatable object modules in the FROM= files to form
the executable program file named by the TO=
parameter. You can use an indirect file name for
this parameter. Default: merge the relocatable
object modules in the system file $OLDPASS.
dest_file Names the file where the resulting executable module
is placed. If you include the TO= parameter and the
link editor finds no file with that name, it creates
a new executable program file for you. If the file
already exists, it replaces the current contents of
the file with the executable module. When dest_file
is an existing file, it must have filecode NMPRG.
Default: place the executable module in the system
file $NEWPASS.
rl_file Names a relocatable library file that resolves
external reference(s) contained in the source_file or
in another rl_file. The file must have a filecode of
NMRL. The link editor searches the relocatable
libraries in the RL list according to the order in
which you list them. Therefore, if a module from one
library calls a routine in another library and that
routine refers to a module in the first library, you
must name the first library a second time to resolve
this circular reference. You can enter an indirect
file for this parameter.
xl_file Names an executable library that resolves external
references remaining in the executable program file.
The file must have filecode NMXL. You can override
the XL= list by using the XL= parameter of the :RUN
command. You can enter an indirect file for this
parameter.
Since xl_file is passed to the system, if xl_file is
not fully qualified, it will be qualified with a name
that is consistent with the program file being
loaded. For further information, refer to the :RUN
command in the MPE XL Commands Reference Manual.
cap_list The capability attribute that the link editor assigns
to the executable program file. Enter one or more of
the following attributes separated by commas:
PH - Process Handling
DS - Extra Data Segments
MR - Multiple Resources
PS - Programmatic Creation of Session
PM - Privileged Mode
IA - Interactive Access
BA - Local Batch Access
Default: If no capabilities are specified, the
executable file's capability set will default to BA
and IA.
max_stack_size Sets the maximum stack size, in bytes, for the
resulting executable program. The program uses the
stack to store a procedure's local variables and for
control purposes. You can override this value using
the NMSTACK parameter of the :RUN command. Default:
the system-configured value.
max_heap_size Sets the maximum heap size, in bytes, for the
resulting executable program. The program uses the
heap for dynamic storage allocation. You can
override this value using the NMHEAP parameter of the
:RUN command. Default: the system-configured value.
unsat_name Names the procedure which the loader uses to satisfy
unresolved externals. This procedure must reside in
an executable library that is specified at run time.
Refer to the MPE XL Commands Reference Manual for
further information.
Since unsat_name is a procedure, it is case
sensitive. You can override the parameter by using
the UNSAT parameter of the :RUN command. Default:
when the loader cannot resolve external references,
it reports an error.
check_level Determines the type checking error level that the
link editor uses while binding external references to
procedures and global variables. All relocatable
object modules indicate a checking level for each
reference and each definition of a procedure or a
global variable. When binding an external reference
to a definition, the link editor compares the type
information at the lower of the two checking levels
specified by the reference and the definition. If a
type mismatch is found, it is either a warning or an
error. This option determines which type mismatches
are warnings and which are errors. The check_level
entries are:
0 - All type mismatches are warnings.
1 - Mismatches of the procedure,
function or variable type are
errors. All other mismatches are
warnings.
2 - Mismatches of the procedure,
function or variable type and
mismatches of the number of
arguments for procedures or
functions are errors. All other
mismatches (parameter types, for
example) are warnings.
3 - All type mismatches are errors.
Default: 3.
priv_level Determines the privilege level used by the executable
program file. This parameter changes the privilege
level of all procedures in the symbol and export
tables (of the relocatable object file) that were set
during compilation.
The priv_level entries are:
0 - System level access
1 - Unused
2 - Privileged level access
3 - User level access
Default: the privilege levels set during compilation
by compiler directives.
priority_level Specifies the execution priority that the program
will have at run time. The priority_level has to be
either BS, CS, DS, ES, or a number between 100 and
255 inclusive. This value can be overridden by the
PRI= keyword on the :RUN command.
max_priority_level Specifies the maximum execution priority that the
program can have at run time. The priority_level has
to be either BS, CS, DS, ES, or a number between 100
and 255 inclusive. See the PRI= keyword of the :RUN
command for more information.
entry_name Names the point within a program where execution
begins. ENTRY= lets you override the primary program
entry point. If the symbol that matches entry_name
is not found, an error occurs. Entry_name is case
sensitive. You can override this parameter using the
ENTRYPOINT parameter of the :RUN command. Default:
starts execution from the primary program entry point
(corresponding to a program's main procedure or outer
block). Entry_names must be primary or secondary
entry types.
NODEBUG Strips all symbolic debugging information from the
resulting executable program file. Debugging
information is generated when you use the compiler
debug option. Default: debugging information is not
stripped from the executable program file.
MAP Prints a symbol map to the list file, LINKLIST. The
symbol map is identical to that produced by the
LISTPROG command. Default: do not print a symbol
map.
SHOW Displays on $STDLIST the name of each relocatable
object module as it is being merged into the
executable program file. You can use this parameter
to verify the order in which the link editor
processes each module. Default: do not display the
names of relocatable object modules.
Examples
LinkEd> LINK FROM=OBJCODE;TO=EXECPROG;NMSTACK=30000;MAP;SHOW
This command merges the relocatable object module(s) from the file
OBJCODE and places them into the executable program file EXECPROG. It
assigns a program stack size of 30000 bytes and generates a map of the
resulting executable program file. The name of each relocatable object
module is also displayed as the executable program file is being built.
LinkEd> LINK FROM=^OBJCDE;TO=EXECPROG;RL=LINEDRAW,ARCDRAW;CAP=BA
This command merges the relocatable object modules named in the indirect
file, OBJCDE, into the executable program file EXECPROG. It searches the
relocatable libraries LINEDRAW and ARCDRAW to resolve external
references. The resulting executable program file can be executed only
in batch mode.
MPE/iX 5.0 Documentation