Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!ukma!s.ms.uky.edu!kherron From: kherron@ms.uky.edu (Kenneth Herron) Newsgroups: comp.unix.sysv386 Subject: Re: Strings in Standard Library Message-ID: Date: 31 Mar 91 13:33:30 GMT References: <1991Mar28.033357.1439@toolz.uucp> <569@bigfoot.first.gmd.de> <1991Mar31.031543.17469@hawkmoon.MN.ORG> Distribution: na Organization: University Of Kentucky, Dept. of Math Sciences Lines: 91 det@hawkmoon.MN.ORG (Derek E. Terveer) writes: >In article <1991Mar28.033357.1439@toolz.uucp>, todd@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@ms.uky.edu University of Kentucky (606) 257-2975 Department of Mathematics "Never trust gimmicky gadgets" -- the Doctor