Next: , Up: Reducing the Size of Ada Executables with gnatelim

21.1 About gnatelim

When a program shares a set of Ada packages with other programs, it may happen that this program uses only a fraction of the subprograms defined in these packages. The code created for these unused subprograms increases the size of the executable.

gnatelim tracks unused subprograms in an Ada program and outputs a list of GNAT-specific Eliminate pragmas (see next section) marking all the subprograms that are declared but never called. By placing the list of Eliminate pragmas in the GNAT configuration file gnat.adc and recompiling your program, you may decrease the size of its executable, because the compiler will not generate the code for 'eliminated' subprograms.

gnatelim needs as its input data a set of tree files (see Tree Files) representing all the components of a program to process and a bind file for a main subprogram (see Preparing Tree and Bind Files for gnatelim).