ld Manual

Introduction to ld
ld Manual529650.001
1-18
Linking Mixed-Language Programs
TNS/R Native User Libraries
If you are using a TNS/R native user library, the library file must use the same floating-
point format as the program, and the library must be marked accordingly. If the user
library does not use floating point at all, you can mark the library NEUTRAL_FLOAT
using the -set floattype or -change floattype option. Then the user library
can be used by any type of program.
Overruling the Run-Time Consistency Check
You can override the run-time consistency check with the option
-set float_lib_overrule selected. If you do so, 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 code 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. You can change the
float_lib_overrule attribute 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:
A C module that uses IEEE floating-point format
A COBOL module that does not use floating-point format but is marked by the
COBOL compiler as TANDEM_FLOAT
When you link the modules together, you can do either of these:
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 1-10 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 ld command did not include the option -set floattype
IEEE_FLOAT, ld would issue error messages because of the mismatch between
Tandem and IEEE floating-point formats. Because this ld command does include the
option -set floattype IEEE_FLOAT, ld issues a warning message about the
mismatch and builds the loadfile MYEXEC. CCPPMAIN (a linkfile) and the LIBCOBEY
file (an OBEY command file) are required when linking C programs.