Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Linking the CRTE runtime libraries

&pagelevel(5)&pagelevel

The link editor resolves the unresolved external references to the C and C++ runtime systems via autolink (RESOLVE-BY-AUTOLINK) from the CRTE PLAM libraries.

C runtime system

When code is generated, the C runtime system modules can be linked or loaded with the ccc11, c89 and CC commands as follows:

  1. Loading the C runtime system dynamically (partial bind). There are two variants of the partial bind linkage method:

    • Standard partial bind (-d y)

      Linking is carried out by default from the SYSLNK.CRTE.PARTIAL-BIND library if no special linker options are specified. This library contains link modules that resolve all unresolved external references to the C and COBOL runtime systems. Only the connection modules required are linked. If a module loaded by the application to be linked requires entries of the runtime system, this can result in unresolved external references because the link modules to the runtime system’s entries need not necessarily already be linked. In this case the complete partial bind method should be used for linking (see also CRTE-BHB).

      The C and COBOL runtime systems themselves are loaded dynamically at runtime, either from class 4 memory, if it has been preloaded, or from the SYSLNK.CRTE library.

      The linked program requires considerably less disk storage space than if the C runtime system is linked statically from the SYSLNK.CRTE library (see 2.). The load time is also faster. The appropriate CRTE must be available when the program is called.

    • Complete partial bind (-d compl)

      In this case, linking is done from the SYSLNK.CRTE.COMPL library. Basically, the procedure for the complete partial bind is the same as that for the standard partial bind method. With complete partial bind, the link modules provided in
      SYSLNK.CRTE.COMPL contain all the entries and the external data of the complete C and COBOL runtime systems. This means that the unresolved external references which may occur when modules of an application which was linked in a standard partial bind are loaded cannot occur in complete partial bind.
      When you use shared libraries in POSIX, successful linking is only guaranteed with a complete partial bind.

    For more information on the partial bind linking method, see the manual “CRTE" [5)].

  2. Linking the complete C runtime system statically (

    -d n)

    If the -d n link option is specified (see "Link editor options"), all required C runtime system modules are linked in from the SYSLNK.CRTE library.

  3. Leaving the external references to the C runtime system unresolved (-z nodefs)

    If the -z nodefs link option is specified (see "Link editor options)"), the program is linked without a RESOLVE to the C runtime library. The unresolved external references are then resolved at runtime from the C runtime system preloaded in class 4 memory. -z nodefs is not supported when linking C++ programs (CC command).

C++ library for the Cfront C++ language mode C++ V2

The modules of the Cfront C++ library (SYSLNK.CRTE.CPP) and of the Cfront C++ runtime system (SYSLNK.CRTE.CFCPP) can only be linked in statically. If the Cfront C++ mode(-X v2-compatible option) is specified in the CC command, these libraries are linked in automatically in addition to the C runtime system.

See also the -l link option in section "Link editor options".

C++ library for the Cfront C++ language mode C++ V3

The modules of the standard C++ V3 library (SYSLNK.CRTE.STDCPP) and of the C++ runtime system (SYSLNK.CRTE.RTSCPP) can only be linked in statically. These libraries are linked in automatically in addition to the C runtime system if the C++ V3 mode is specified in the CC command ( -X v3-compatible).

See also the -l link option in section "Link editor options".

C++ V3 library Tools.h+

The modules of the Tools.h++ library (SYSLNK.CRTE.TOOLS) can only be linked in statically. The library is only available in the C++ V3 mode (-X v3-compatible option) and is only linked in if the -l RWtools link option is also specified.

See also the -l link option in section "Link editor options".

modern C++ library for the C++ language modes C++ 2017 and C++ 2020

The modules of the modern C++ library can only be linked in statically. This library is linked in automatically in addition to the C runtime system if the C++ 2017 mode (option -X 2017) or C++ 2020 mode (default or option -X 2020) is specified in the CC command. The file being used depends on the library version: for library version 1 it is SYSLNK.CRTE.CXX01, for library version 2 it is SYSLNK.CRTE.CXX02.

See also the -l link option in section "Link editor options".

POSIX link switch

The link switches posix.o and postime.o available with CRTE (correspond to the CRTE SYSLNK.CRTE.POSIX library in the BS2000 environment) are linked in automatically. The time, signal handling and clock functions, which are duplicated in the C runtime system, are therefore generally executed with POSIX semantics. Mixed processing of POSIX and BS2000 is generally possible. Please refer to the manual “C Library Functions for POSIX Applications” [2 ] for further details.