1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <sect1 id="ch-system-aboutdebug">
|
---|
7 | <title>About Debugging Symbols</title>
|
---|
8 | <?dbhtml filename="aboutdebug.html"?>
|
---|
9 |
|
---|
10 | <para>Most programs and libraries are, by default, compiled with
|
---|
11 | debugging symbols included (with <command>gcc</command>'s
|
---|
12 | <parameter>-g</parameter> option). This means that when debugging a
|
---|
13 | program or library that was compiled with debugging information
|
---|
14 | included, the debugger can provide not only memory addresses, but also
|
---|
15 | the names of the routines and variables.</para>
|
---|
16 |
|
---|
17 | <para>However, the inclusion of these debugging symbols enlarges a
|
---|
18 | program or library significantly. The following is an example of the
|
---|
19 | amount of space these symbols occupy:</para>
|
---|
20 |
|
---|
21 | <itemizedlist>
|
---|
22 |
|
---|
23 | <listitem><para>a bash binary
|
---|
24 | with debugging symbols: 1200 KB</para></listitem>
|
---|
25 |
|
---|
26 | <listitem><para>a bash binary
|
---|
27 | without debugging symbols: 480 KB</para></listitem>
|
---|
28 |
|
---|
29 | <listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename>
|
---|
30 | and <filename class="directory">/usr/lib</filename>)
|
---|
31 | with debugging symbols: 87 MB</para></listitem>
|
---|
32 |
|
---|
33 | <listitem><para>Glibc and GCC files
|
---|
34 | without debugging symbols: 16 MB</para></listitem>
|
---|
35 |
|
---|
36 | </itemizedlist>
|
---|
37 |
|
---|
38 | <para>Sizes may vary depending on which compiler and C
|
---|
39 | library were used, but when comparing programs with and without debugging
|
---|
40 | symbols, the difference will usually be a factor between two and
|
---|
41 | five.</para>
|
---|
42 |
|
---|
43 | <para>Because most users will never use a debugger on their system
|
---|
44 | software, a lot of disk space can be regained by removing these
|
---|
45 | symbols. The next section shows how to strip all debugging symbols
|
---|
46 | from the programs and libraries. Additional information on system
|
---|
47 | optimization can be found at <ulink url="&hints-root;optimization.txt"/>.</para>
|
---|
48 |
|
---|
49 | </sect1>
|
---|
50 |
|
---|