[Coco] C libs under Nitros9

tim lindner tlindner at macmess.org
Sun Aug 5 13:34:11 EDT 2007


Bob Devries <devries.bob at gmail.com> wrote:

> Paul Fitch asked:
> > does the entire library get added to you program, or only the actual
> > library
> > components called?
> 
> I'm not absolutely about this, but I think only the required module, 
> otherwise, why would the C compiler need the pffinit() and pflinit() calls
> to force the addition of code for longs and floats, which are in the clib.l
> file?

The OS9 linker (rlink) will not link in the entire library (.l) file. 
But the linker can not break apart an ROF file. Remember that a library
file is just a bunch of ROF files merged together.

The reason for pffinit() and pflinit() is quite simple. The clib.l
library file contains two different printf() ROF files. One contains the
code for longs and floats, and one doesn't. The one that doesn't is
quite a bit smaller than the one that does.

So if the linker has an unresloved symbol for pffinit it will find it in
the ROF that does include the code to handle floats.

If your program uses floats or longs in printf() functions without
calling pffinit() or pflinit(), printf() will ignore thoes parameters.

-- 
tim lindner
tlindner at macmess.org                                              Bright



More information about the Coco mailing list