[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
| 6 | <sect1 id="ch-system-aboutdebug">
|
---|
[69993f4] | 7 | <title>About Debugging Symbols</title>
|
---|
[673b0d8] | 8 | <?dbhtml filename="aboutdebug.html"?>
|
---|
| 9 |
|
---|
[ef13657] | 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>
|
---|
[673b0d8] | 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 |
|
---|
[3c928f1] | 29 | <listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename>
|
---|
| 30 | and <filename class="directory">/usr/lib</filename>)
|
---|
[673b0d8] | 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 |
|
---|
[69993f4] | 38 | <para>Sizes may vary depending on which compiler and C
|
---|
| 39 | library were used, but when comparing programs with and without debugging
|
---|
[ef13657] | 40 | symbols, the difference will usually be a factor between two and
|
---|
| 41 | five.</para>
|
---|
[673b0d8] | 42 |
|
---|
[ef13657] | 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
|
---|
[38bb44a] | 46 | from the programs and libraries. Additional information on system
|
---|
[c5143c9] | 47 | optimization can be found at <ulink url="&hints-root;optimization.txt"><phrase
|
---|
[dff7de7] | 48 | condition="pdf">&hints-root; optimization.txt</phrase></ulink>.</para>
|
---|
[673b0d8] | 49 |
|
---|
| 50 | </sect1>
|
---|
[ef13657] | 51 |
|
---|