Binder Functions

The function of the binder is similar to, but somewhat different from, the function provided by a linkage editor. The binder processes import requests for procedure names and data item names from specified modules. The binder then tries to find matching exports in the specified modules, service programs, and binding directories.

In creating an ILE program or service program, the binder performs the following types of binding:
  • Bind by copy
    To create the ILE program or service program, the following are copied:
    • The modules specified on the module parameter
    • Any modules selected from the binding directory that provide an export for an unresolved import
    Physical addresses of the needed procedures and data items used within the copied modules are established when the ILE program or service program is created.

    For example, in Figure 1, procedure P3 in module M3 calls procedure P2 in module M2. The physical address of procedure P2 in module M2 is made known to procedure P3 so that address can be directly accessed.

  • Bind by reference

    Symbolic links to the service programs that provide exports for unresolved import requests are saved in the created program or service program. The symbolic links refer to the service programs providing the exports. The links are converted to physical addresses when the program object to which the service program is bound is activated.

    Figure 1 shows an example of a symbolic link to SIN in service program *MATHLIB/MATHFUNC. The symbolic link to SIN is converted to a physical address when the program object to which service program SPGMEXAMP is bound is activated.

At runtime, with physical links established to the procedures and data items being used, there is little performance difference between the following:
  • Accessing a local procedure or data item
  • Accessing a procedure or data item in a different module or service program bound to the same program

Figure 1 and Figure 2 show conceptual views of how the ILE program PGMEXAMP and service program SPGMEXAMP were created. The binder uses modules M1, M2, M3, and M4 and service programs PRINTS and MATHFUNC to create ILE program PGMEXAMP and service program SPGMEXAMP.

Figure 1. Creation of an ILE Program. The broken line indicates that the service programs are bound by reference instead of being bound by copy.
Figure 2. Creation of a Service Program. The broken line indicates that the service programs are bound by reference instead of being bound by copy.

For additional information on creating an ILE program or service program, see Program Creation Concepts.