Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mit-eddie!ll-xn!ames!pasteur!agate!violet.berkeley.edu!arnold2 From: arnold2@violet.berkeley.edu (mchawi) Newsgroups: comp.lang.c Subject: lib Message-ID: <10566@agate.BERKELEY.EDU> Date: 5 Jun 88 04:07:03 GMT Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 23 intro: linking together lots of utility-type files along with the main driver produces a fairly large (500K+) program, e.g., "cc main.c stringsubs.o sort.o timesubs.o ttystuff.o" each 'utility' file has many functions (e.g., 'stringsubs.c' has 50 functions). however, the program might use only a few of those. wanted: find a way to link into the program only those functions that are used, in order to minimize program size (another case of VAX->ibm-pc porting). vision: have a linker that can extract the code (probably would have to include all the data space for each file) into the executable file. perhaps you can link from a library you create first? alternatives: 1) break up the utility files. the most obvious solution. disadvantages: lots of little files, e.g. "cc main.c string1.o string2.o string3.o sort.o ..."; you have to remember what functions are where. not elegant. if i were to use only the functions i needed, i could make a 1 meg program down to probably 250K. any ideas, system software engineers? gregory, arnold2@violet.berkeley :-