Skip to main content

This article explains how to relink the RTS, or runtime system.

Problem:

Is it possible to rebuild the default runtime? When I used 'rebuild' or 'RTS' in the Product Documentation Index, I could not find the relevant topic.

Resolution:

The topic can be found in the User Guide Chapter 8 Linking to System Executables. This contains the following information, under the heading Creating an Executable RTS:

"An executable RTS is a system executable file that requires the first entry point to be specified at run-time. In Object COBOL V4.1 and earlier, an executable RTS was required when you needed to link C and C programs into your application. However, C and C programs can now exist within callable shared objects; therefore it is no longer necessary to create an executable RTS for this. See the chapter Callable Shared Objects for more details.

If required, you can create an executable RTS using cob. For example:

cob -xo rts.new subprogs.c -e ""

This creates an executable RTS that contains the same level of functionality as the default runtime system ($COBDIR/bin/rts32 or $COBDIR/bin/rts32_t) that also includes the C subroutines held in the file subprogs.c. At runtime the dynamically loadable program myapp could then be run with the command line:

./rts.new myapp

Specifying the cob option -e "" causes the system executable to be built so that the executable file's entry point must be specified at runtime.

Full details of the cob -e flag can be found in the chapter Descriptions of cob Flags."

Old KB# 14136