3.5 Reducing the size of your program

When you created your program, it is possible to reduce its size. This is possible, because the compiler leaves a lot of information in the program which, strictly speaking, isn't required for the execution of it. The surplus of information can be removed with a small program called strip.The usage is simple. Just type
strip prog

On the command line, and the strip program will remove all unnecessary information from your program. This can lead to size reductions of up to 30 %.

Remark: In the Win32 version, strip is called stripw.

You can use the -Xs switch to let the compiler do this stripping automatically at program compile time (the switch has no eect when compiling units).

Another technique to reduce the size of a program is to use smartlinking. Normally, units (including the system unit) are linked in as a whole. It is however possible to compile units such that the can be smartlinked. This means that only the functions and procedures are linked in your program, leaving out any unnecessary code. The compiler will turn on smartlinking with the -XX (see page 5.1.4) switch. This technique is described in full in the programmers guide.