Path: utzoo!attcan!telly!eci386!jmm From: jmm@eci386.uucp (John Macdonald) Newsgroups: comp.unix.i386 Subject: Re: What is "__fltused" symbol? Message-ID: <1990Feb21.192534.22925@eci386.uucp> Date: 21 Feb 90 19:25:34 GMT References: <204@ncrday.Dayton.NCR.COM> <25da2b6b:900.1comp.unix.i386;1@vpnet.UUCP> Reply-To: jmm@eci386.UUCP (John Macdonald) Organization: Elegant Communications Inc., Toronto, Canada Lines: 39 In article <25da2b6b:900.1comp.unix.i386;1@vpnet.UUCP> hb@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@eci386