About debugging symbols
Prev | Chapter 6. Installing basic system software | Next

## About debugging symbols

Most programs and libraries are, by default, compiled with debugging symbols included (with gcc's -g option). This means that, when debugging a program or library that was compiled with debugging information included, the debugger can give you not only memory addresses but also the names of the routines and variables.

The inclusion of these debugging symbols, however, enlarges a program or library significantly. To get an idea of the amount of space these symbols occupy, have a look at the following:

- a bash binary with debugging symbols: 1200 KB

- a bash binary without debugging symbols: 480 KB

- Glibc and GCC files (/lib and /usr/lib) with debugging symbols: 87 MB

- Glibc and GCC files without debugging symbols: 16 MB

Sizes may vary somewhat, depending on which compiler was used and which C library, but when comparing programs with and without debugging symbols the difference will generally be a factor between 2 and 5.

As most people will probably never use a debugger on their system software, a lot of disk space can be regained by removing these symbols. For your convenience, the next section shows how to strip all debugging symbols from all programs and libraries. Information on other ways of optimizing your system can be found in the hint at http://www.linuxfromscratch.org/hints/downloads/files/optimization.txt.

Prev | Up | Next
GCC-2.95.3 | Home | Stripping again