Strings in Standard Library
Kenneth Herron
kherron at ms.uky.edu
Sun Mar 31 23:33:30 AEST 1991
det at hawkmoon.MN.ORG (Derek E. Terveer) writes:
>In article <1991Mar28.033357.1439 at toolz.uucp>, todd at toolz.uucp (Todd Merriman) writes:
>|> I noticed that the last release of the Unix development software
>|> from Interactive included object libraries with many strings [...]
>|> Is it too much to ask of Interactive to just leave all that static data out?
>But how much extra data is really loaded?...doing a "mcs -p
>/lib/lib*a /usr/lib/lib*a|wc" revealed a total of 450K of strings
>in all of the /lib and /usr/lib libraries, total.
Actually, it's worse than that: Every time the compiler compiles
a source file which includes standard header files, the comment
line from each include file is included in the resulting object
file. When all the object files are linked, every comment line
is preserved, including the ones from the libraries. So if your
source code is in ten separate .c files, and they each include
stdio.h, then you'll get ten or more copies of the comment line
from stdio.h.
These lines all end up in the comment section; the size command
will show you how large this section is. Mcs can either remove
the entire comment section or just the duplicate lines.
These comment lines are *not* loaded into memory at runtime; they
only take up disk space.
--
Kenneth Herron kherron at ms.uky.edu
University of Kentucky (606) 257-2975
Department of Mathematics
"Never trust gimmicky gadgets" -- the Doctor
More information about the Comp.unix.sysv386
mailing list