Figure 4-5 shows HP Link Editor/XL executable program ￿le commands along with the ￿les that they use.

Figure 4-5. Executable Program File Commands

Comparison of Executable and Relocatable Libraries

Relocatable libraries (RLs) and executable libraries (XLs) share important c haracteristics. Both are:

Created by programmers using HP Link Editor/XL commands.

Contain routines necessary for program execution.

Permit programs to share routines. Their major di￿erences are:

An RL stores routines in relocatable form, and an XL stores them in executable form.

An RL contains relocatable object code, whic h HP Link Editor/XL explicitly merges in to an object module for eac h program that calls the routine. An XL con tains sharable code, and each program refers to the same v ersion of the code. When a program calls an XL routine, the loader reads it from disc in to computer memory prior to execution.

When HP Link Editor/XL merges object modules from an RL in to a program ￿le, all the modules become part of one executable object module. An RL routine can share global data with a program. An XL routine can ha ve its own global data area, but executable object modules cannot share global data with the program or other executable modules.

HP Link Editor/XL merges RL routines in to a program ￿le at link time. Ho wever, it only reserves space for poin ters to XL routines in the External Reference T able at link time, and the loader resolv es the references at run time.

HP Link Editor/XL can searc h a series of RLs during the linking phase. The loader can search a series of XLs during the execution phase if y ou provide it with an XL list.

HP Link Editor/XL 4-11