nld Manual

nld Utility
nld Manual528272-001
2-25
Linking Mixed-Language Programs
Overruling the Run-Time Consistency Check
The run-time consistency check can be overruled if you use the
-set float_lib_overrule on option. If you overrule the consistency check, the
operating system allows a floating-point inconsistency between the user library and the
program. If you do not set float_lib_overrule and there is an inconsistency
between the program file and user library, the operating system generates an error and
does not run the program.
If the float_lib_overrule is specified more than once by either the -set or
-change option, all occurrences except the last one are ignored. The
float_lib_overrule attribute can be changed only for loadfiles. An error occurs if
an attempt is made to change the value of this attribute for linkfiles.
Linking Mixed-Language Programs
When linking mixed-language programs that use IEEE floating-point format, specify the
-set floattype IEEE_FLOAT option.
For example, suppose that you have a mixed-language program composed of these
modules:
A C module that uses IEEE floating-point format
A COBOL module that does not use floating-point format but that is marked by the
COBOL compiler as TANDEM_FLOAT
When you link the modules together, you can do either of:
Use the -set floattype IEEE_FLOAT option to set the floating-point type of the
output object file to IEEE floating-point format.
Use the -change command to change the floating-point type of the COBOL object
file to NEUTRAL_FLOAT.
Example 2-11 links a mixed-language program that uses IEEE floating-point format.
The native C object file named COBJ uses IEEE floating-point format, and the pTAL
object file uses Tandem floating-point format. (pTAL supports only Tandem floating-
point format.) If this nld command did not include the option -set floattype
IEEE_FLOAT, nld would issue error messages because of the mismatch between
Tandem and IEEE floating-point formats. Because this nld command does include the
option -set floattype IEEE_FLOAT, nld issues a warning message about the
mismatch and builds the loadfile MYEXEC. CRTLMAIN (a linkfile) and the LIBCOBEY
file (an OBEY command file) are standard items required when linking C programs.
Example 2-11. Linking a Mixed-Language Program With IEEE Floating-Point
Format
nld $system.system.crtlmain cobj ptalobj -obey &
$system.system.licbobey -set floattype ieee_float -o myexec