Steps for generating a reentrant load module in C

Perform the following steps to generate a reentrant load module in C:

  1. Determine whether or not your program contains writable static. If you are unsure about whether your program contains writable static, compile it with the RENT option. Invoking the prelinker with the MAP option and the object module as input produces a Prelinker Map. Any writable static data in the object module appears in the writable static section of the map. Unresolved writable static references may also appear in the map as errors.

    If you see the symbol @STATIC defined in the writable static section, your code contains unnamed writable static such as modifiable literal strings, or variables with the static qualifier. To make literal strings stay in the code area, recompile with #pragma strings(readonly), and prelink again.

    _______________________________________________________________

  2. If your program contains no writable static, compile your program as you would normally (without any special compiler options), and then go directly to step 4.

    _______________________________________________________________

  3. If your program contains writable static, you must compile your C source files with the RENT compiler option.

    _______________________________________________________________

  4. Use the Language Environment® prelinker to combine all input object modules into a single output object module.
    Notes:
    1. The prelinker can handle compiled programs in languages other than C or C++. However, only C, C++, OO COBOL, or assembler code using the macros EDCDXD and EDCLA may refer to writable static.
    2. You cannot use the output object module as further input to the Language Environment prelinker.

    _______________________________________________________________

  5. Optionally, you can use the output object module to link the program in the LPA or ELPA area of the system.

    _______________________________________________________________

  6. Under the z/OS® shell, you can run the installed program by invoking it from z/OS UNIX System Services. To do so you must install the program in z/OS UNIX, and, from a superuser ID, enter a chmod Shell command to turn on the sticky bit for the program. See z/OS UNIX System Services Planning for more information.

    _______________________________________________________________