Subject: Re: Shrinking NetBSD - deep final distribution re-linker
To: None <,>
From: Jared Momose <>
List: tech-embed
Date: 10/19/2004 14:47:02
>>>Sorry for quite confusing subject, just i don't know how exactly express 
>>>ideas :) Not sure where exactly should i post this message..
>>tech-embed is definitely the place for this type of discussion.
>>it sounds like you are describing crunchgen. man crunchgen, and take a 
>>look at src/distrib/i386/floppies/ramdisk-big/list for an example. 
>>crunchgen does have limitations and caveats (which i can enumerate upon 
>>request) but all can be worked around in one way or another. and there is 
>>an advantage of sharing all common code pages w/o ld glue. :^)
>>best regards,
>Does crunchgen remove unused portions of the code, though? I thought it 
>simply linked all the programs into one file. In which case all of libc's 
>extra baggage would come along with it.

crunchgen does not remove unused code, but the linker does. :^)

bash-2.05b$ gcc -static -o hello hello.c
bash-2.05b$ ls -l hello
-rwxr-xr-x  1 jmomose  users  63403 Oct 19 06:42 hello
bash-2.05b$ cp /usr/lib/libc.a .
bash-2.05b$ strip -s libc.a
bash-2.05b$ ls -l libc.a
-r--r--r--  1 jmomose  users  1009520 Oct 19 06:42 libc.a

best regards,