lib
mchawi
arnold2 at violet.berkeley.edu
Sun Jun 5 14:07:03 AEST 1988
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 at violet.berkeley
:-
More information about the Comp.lang.c
mailing list