[comp.unix.sysv386] Shrinking the size of your executables

karl@sugar.hackercorp.com (Karl Lehenbauer) (10/30/90)

The "mcs" command, used to manipulate the object file comment section in
System V, does not appear to be a very well-known command, in that I
have never seen it mentioned on the net.

Anyone who has done a "what" on an executable after stripping the symbol
table has been dismayed to see countless "Unix System V/386 Release 3.2 
lib/libc.a" messages and so forth.

mcs, a poorly named command IMO, can get rid of those guys.  "mcs -d" on
one of my tasks reduced the size from 98K to 89K bytes.  I recommend putting
a "mcs -d" in your makefiles right after the "strip", where relevant...
-- 
-- uunet!sugar!karl
-- Usenet access: (713) 438-5018

shwake@raysnec.UUCP (Ray Shwake) (10/31/90)

karl@sugar.hackercorp.com (Karl Lehenbauer) writes:

>mcs, a poorly named command IMO, can get rid of those guys.  "mcs -d" on
>one of my tasks reduced the size from 98K to 89K bytes.  I recommend putting
>a "mcs -d" in your makefiles right after the "strip", where relevant...

	One of our binaries benefited even more. That curses-based program
shrank from ~195k to ~150k. I came upon this gem while rummaging through
Interactive's software integration routines. Size-wise, I've seen no
difference between running "mcs -d" first then stripping, or the reverse.

glenn@suphys.physics.su.OZ.AU (Glenn Geers) (10/31/90)

From article <6924@sugar.hackercorp.com>, by karl@sugar.hackercorp.com (Karl Lehenbauer):
> The "mcs" command, used to manipulate the object file comment section in
> System V, does not appear to be a very well-known command, in that I
> have never seen it mentioned on the net.
> 
> Anyone who has done a "what" on an executable after stripping the symbol
> table has been dismayed to see countless "Unix System V/386 Release 3.2 
> lib/libc.a" messages and so forth.
> 
> mcs, a poorly named command IMO, can get rid of those guys.  "mcs -d" on
> one of my tasks reduced the size from 98K to 89K bytes.  I recommend putting
> a "mcs -d" in your makefiles right after the "strip", where relevant...
> -- 
> -- uunet!sugar!karl
> -- Usenet access: (713) 438-5018

Hey, before you strip it use cprs(1) to remove duplicate structure and union 
references.

cprs oldbin newbin

					Enjoy,
						Glenn

glenn@qed.physics.su.oz.au


--
Glenn Geers                       | "So when it's over, we're back to people.
Department of Theoretical Physics |  Just to prove that human touch can have
The University of Sydney          |  no equal."
Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'

tim@delluk.uucp (Tim Wright) (11/03/90)

On using 'mcs -d', that's right. I believe Rick Richardson posted about this
a few months ago. If you don't want to kill all the ident lines, but
merely make sure there's only one copy of each (still get's good compression),
use 'mcs -c' instead.

Tim
--
Tim Wright, Dell Computer Corp. (UK) | Email address
Dell Computer Corp. (UK), Bracknell  | Domain: tim@dell.co.uk
Tel: +44-344-860456                  | Uucp: ...!ukc!delluk!tim
"What's the problem? You've got an IQ of six thousand, haven't you?"