Which programs need to be prelinked

The prelink step is required when an executable program is to reside in a PDS, or if it utilizes the system programming facilities of C. When the executable is to reside in a PDSE or HFS, the prelink step may be eliminated since the binder can handle the output of the C, C++, COBOL, and Enterprise PL/I for z/OS compilers. If the link-edit process is performed by the linkage editor then the prelink step is required.

You should not use the pre-linker with XPLINK programs because XPLINK programs require the GOFF binder format and GOFF is not supported by the pre-linker. Also, the z/OS® XL C/C++ compiler creates GOFF object code when the XPLINK compiler option is specified. When bound, the objects must reside in PDSEs or the HFS.

The following list identifies programs which may need to be prelinked before the link-edit step of creating an executable program.
  • Modules which must be processed with the linkage editor rather than the binder
  • Modules which must be stored in a PDS rather than in a PDSE
  • Programs which utilize the system programming facilities of C.
  • Non-XPLINK C programs compiled with any of the following compiler options:
    • RENT
    • LONGNAME
    • DLL
  • Non-XPLINK C++ programs
  • COBOL programs compiled with any of the following compiler options:
    • DLL
    • PGMNAME(LONGMIXED)
    • PGMNAME(LONGUPPER)
  • COBOL programs that use object-oriented extensions
  • COBOL programs containing class definitions or the INVOKE statement
  • Enterprise PL/I for z/OS programs
  • Programs compiled to run under z/OS UNIX

Only C object modules that do not refer to writable static, do not contain the LONGNAME option, and do not contain DLL code can be processed by the linkage editor. You do not need to prelink naturally reentrant programs. For more information, see Making your C/C++ program reentrant.

If you need to link-edit together object modules and load modules, prelink the object modules through the prelinker in a single step, and then link-edit with the load modules in a separate link-edit step. This is because the prelinking process can only process object modules.