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