What is "__fltused" symbol?

John Macdonald jmm at eci386.uucp
Thu Feb 22 06:25:34 AEST 1990


In article <25da2b6b:900.1comp.unix.i386;1 at vpnet.UUCP>
    hb at vpnet.UUCP (hank barta) writes:
| Could it mean "floating point used?" 
| 
| Some compilers generate these symbols to cause portions
| of libraries to be loaded when they are otherwise not referenced.
| For example, the compiler could use a floating point emulator
| (software) and then compile instructions for the 80387. Then
| when the code runs on a machine w/o the 80387, the instructions
| cause a trap. The trap handler passes control to the floating point
| emulator which then does the computation in software. But the
| trap operation does not require an address the way a subroutine call
| would, so the compiler puts an unresolved (an otherwise do nothing)
| reference in the object which is resolved by the particular
| library module.
| 
| Disclaimer: The above is an educated guess. Perhaps there is another
| reason for this symbol.
| 
| 						Hank

You are basically right, although the usage that I have seen has been
slightly different.  What ends up being loaded by the __fltused
reference is a version of the low-level printf routines that has full
support for floating point.  If the reference is not present, then
after loading printf, a different low-level set of routines will be
used that only support integer.  This dates back to the days when the
size of the code to support floating point input and output was significant
compared to the size of programs and computer memories of the day.

It is possible that the same sort of trick is being used to load a
floating point emulator (but generally I have seen emulators loaded
into the kernel, or compiler-generated invokations of software
subroutines as the "normal" method of handling the abscence of
floating point hardware.
-- 
Algol 60 was an improvment on most           | John Macdonald
of its successors - C.A.R. Hoare             |   jmm at eci386



More information about the Comp.unix.i386 mailing list