Xref: utzoo comp.unix.i386:5612 comp.lang.c:29361 comp.windows.x:22722 Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!jarthur!elroy.jpl.nasa.gov!peregrine!ccicpg!hobbit!ndjc From: ndjc@hobbit.UUCP (Nick Crossley) Newsgroups: comp.unix.i386,comp.lang.c,comp.windows.x Subject: Re: Tip Concerning Massive COFF Comment Sections Summary: mcs -c is most useful Keywords: COFF mcs X Message-ID: <74746@hobbit.UUCP> Date: 4 Jun 90 20:08:56 GMT References: <1990Jun1.134459.4296@pcrat.uucp> Reply-To: ndjc@ccicpg.UUCP (Nick Crossley) Followup-To: comp.unix.questions Organization: ICL North America, Irvine, CA 92718 Lines: 31 In article <1990Jun1.134459.4296@pcrat.uucp> rick@pcrat.uucp (Rick_Richardson) writes much about COFF .comment sections, and how to reduce their size. I don't think this is particularly relevant to this newsgroup, as .comment sections are nothing to do with C, but are part of both the COFF and ELF (V.4) object formats (perhaps further discussion should be in comp.unix.questions?). However, he did miss out perhaps the most important and simple way to limit the size of .comment sections; use of mcs -c. Rather than just delete the comment sections (which the software developers and OS suppliers might make good use of for support), just insure that each comment is included only once. If a header file contains a #ident, that string will appear in the binary as many times as that header file was included (plus or minus a few depending on whether or not the header was included in the same source more than once and whether or not the #ident was inside or outside any #ifndef __XXX_H_ ... #endif stuff). For common header files such as , this can mean the same strings will appear many times in a fully linked binary. Use of mcs -c will condense the .comment section so that each unique string appears only once. Makefiles intended for systems with .comment sections (such as V.3 and V.4) should have mcs -c added after final linking. -- <<< standard disclaimers >>> Nick Crossley, ICL NA, 9801 Muirlands, Irvine, CA 92718-2521, USA 714-458-7282 uunet!ccicpg!ndjc / ndjc@ccicpg.UUCP