ld Manual

Introduction to ld
ld Manual529650.001
1-17
Run-Time Consistency Checking
Run-Time Consistency Checking
If a program tries to use a processor that does not support IEEE floating-point format,
then process creation error code 64 occurs (IEEE floating-point support not
available on this processor). To determine whether a processor can run IEEE
floating-point instructions, use the PROCESSOR_GETINFOLIST_ procedure. For more
information, see the Guardian Procedure Calls Reference Manual.
Run-time consistency checking includes a check for floattype consistency between
the program file and the user library file, if one is used. IEEE and Tandem floating-point
formats use different data formats and calling conventions. IEEE floating-point values
are typically passed in IEEE floating-point registers, while Tandem floating-point values
are passed in general purpose registers. Problems can occur if a function using one
floating-point format calls a function using the other format. Checks are performed at
process creation to ensure that the user library (if there is one) has a floattype
compatible with that of the program file. If not, the program is not allowed to run.
If the floattype attribute of the program file is IEEE and the floattype attribute of
the user library file is Neutral, the program is allowed to run, and the C/C++ run-time
libraries operate in IEEE mode.
Even if the user library is marked with a floattype attribute that conflicts with the
program file, the program can use the library if the program does not call anything in
the user library that uses floating point. In this case, you must mark the program file
with the -set float_lib_overrule on command to disregard the floattype
attribute of the user library file (see Overruling the Run-Time Consistency Check).
Note. If source code manipulates floating-point data, either the TANDEM_FLOAT or the
IEEE_FLOAT machine instruction is placed into the object code, depending on the compiler
directive (pragma) floattype. The
ld option -set floattype cannot change the
instruction set. To change the instruction set, you must recompile the source code with the
correct directive (pragma). The two cases where you use the ld option -set floattype
are:
The floattype in a module has been set to either TANDEM_FLOAT or IEEE_FLOAT, but
the module does no floating-point operations. You want to link the module to another
module that does floating-point operations, but the other module has a different floattype
value.
A program deliberately uses both types of floating-point instructions.
Table 1-3. Incompatible Program File and User Library floattypes (TNS)
floattype in Program File floattype in User Library File
IEEE Tandem
Tandem IEEE
Neutral IEEE