Mapping L-Names to S-Names

The output object module of the prelinker can be used as input to a system linkage editor.

Because system linkage editors accept only S-names, the Language Environment prelinker maps L-names to S-names on output. S-names are not changed. L-names can be up to 160 (COBOL for OS/390 & VM and COBOL for MVS & VM), 255 (z/OS XL C/C++), or 1024 (z/OS XL C++) characters in length; truncation of the L-names to the 8-character S-name limit is therefore not sufficient because collisions can occur.

The Language Environment prelinker maps a given L-name to a S-name according to the following hierarchy:

  1. C/C++ only: If any occurrence of the L-name is a reserved runtime name, or was caused by a #pragma map or #pragma CSECT directive, then that same name is chosen for all occurrences of the name. This name must not be changed, even if a RENAME control statement for the name exists. For information on the RENAME control statement, see RENAME control statement.
  2. If the L-name was found to have a corresponding S-name, the same name is chosen. For example, DOTOTALS is coded in both a C and assembler program. This name must not be changed, even if a RENAME statement for the name exists. This rule binds the L-name to its S-name.
  3. If a valid RENAME statement for the L-name is present, the S-name specified on the RENAME statement is chosen.
  4. If the name corresponds to a Language Environment function or library object for which you did not supply a replacement, the name chosen is the truncated, uppercased version of the L-name library name (with _ mapped to @).
    The S-name is not chosen, if either:
    • A valid RENAME statement renames another L-name to this S-name. For example, the RENAME statement RENAME mybigname PRINTF would make the library printf() function unavailable if mybigname is found in input.
    • Another L-name is found to have the same name as the S-name. For example, explicitly coding and referencing SPRINTF in the C source program would make the library sprintf() function unavailable.

    Avoid such practices to ensure that the appropriate Language Environment function is chosen.

  5. If the UPCASE option is specified, names that are 8 characters or fewer are changed to uppercase (with _ mapped to @). Names that begin with IBM or CEE will be changed to IB$, and CE$, respectively. Because of this rule, two different names can map to the same name. You should therefore use the UPCASE option carefully. A warning message is issued if a collision is found, but the names are still mapped.
  6. If none of the above rules apply, a default mapping is performed. This mapping is the same as the one the compiler option NOLONGNAME uses for external names, taking collisions into account. That is, the name is truncated to 8 characters and changed to uppercase (with _ mapped to @). Names that begin with IBM or CEE will be changed to IB$ and CE$, respectively. If this name is the same as the original name, it is always chosen. This name is also chosen if a name collision does not occur. A name collision occurs if either
    • The S-name has already been seen in any input, that is, the name is not new.
    • After applying this default mapping, the same name is generated for at least two, previously unmapped, names.

    If a collision occurs, a unique name is generated for the output name. For example, the name @ST00033 is manufactured.

z/OS XL C/C++: A program that is compiled with the NOLONGNAME compiler option and link-edited, except for collisions, library renames, and user renames, presents the linkage editor with the same names as when the program is compiled with the LONGNAME option and processed by the prelinker.