Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!ctnews!pyramid!batcomputer!itsgw!csmbox!rpics!guilford From: guilford@rpics.UUCP Newsgroups: comp.sys.amiga Subject: Re: Getting smaller binaries Message-ID: <1108@rpics.RPI.EDU> Date: Tue, 14-Apr-87 22:04:43 EST Article-I.D.: rpics.1108 Posted: Tue Apr 14 22:04:43 1987 Date-Received: Fri, 17-Apr-87 00:39:10 EST Lines: 30 Summary: Is it reasonable to make stdio a library? I have had an idea that I've been kicking around for a while, and before I do any serious work on it, I was wondering if its been done before, or if there are reasons why it wouldn't be a good idea. I was thinking that a large part of binaries tends to be large chunks of library code such as printf and its associated luggage. I was thinking that it may not be too bad of idea to make most of these large "add-ons" into a real amiga-style library, and then have all programs share it. I can see very little reason for the simple "hello" program from K&R to take up lots and lots of space, specially when most of the code in the binary is in every other binary on the disk. I can see four possible problems with this idea. One is that some of these routines are non-re-entrant and so can't be made into a standard C library. If this is so, then the whole idea is down the tube. A second problem would be that it would be a non-standard deviation. If one tried to port this code to a system which did not have the "extra" library installed, it would not run. There is also the problem that the startup code would have to link into the library and possibly load it from disk. This might slow things down (although it shouldn't after the first one). Then there is also that calls to these subroutines would be indirect and thus a little slower. The advantages to this is that object code size would be reduced, as would link time. Instead of linking with printf and then linking all of the routines printf needs, all one would have to do is link with a stub for printf. So, I am left with three basic questions. Has this been done before? Are there problems that I have not thought of? Is the general opinion that the disadvantages outweight the advantanges? --Jim Guilford (guilford@csv.rpi.edu)