source: chapter06/aboutdebug.xml@ dcff046

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk v5_1 v5_1_1 xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since dcff046 was dcff046, checked in by Alex Gronenwoud <alex@…>, 20 years ago

Changing chapter IDs in anticipation.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3221 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 1.9 KB
Line 
1<sect1 id="ch-system-aboutdebug">
2<title>About debugging symbols</title>
3<?dbhtml filename="aboutdebug.html" dir="chapter06"?>
4
5<para>Most programs and libraries are, by default, compiled with debugging
6symbols included (with gcc option -g).</para>
7
8<para>When debugging a program or library that was compiled with debugging
9information included, the debugger can give you not only memory addresses
10but also the names of the routines and variables.</para>
11
12<para>But the inclusion of these debugging symbols enlarges a program or
13library significantly. To get an idea of the amount of space these symbols
14occupy, have a look at the following:</para>
15
16<itemizedlist>
17
18<listitem><para>a bash binary
19with debugging symbols: 1200 KB</para></listitem>
20
21<listitem><para>a bash binary
22without debugging symbols: 480 KB</para></listitem>
23
24<listitem><para>Glibc and GCC files (/lib and /usr/lib)
25with debugging symbols: 87 MB</para></listitem>
26
27<listitem><para>Glibc and GCC files
28without debugging symbols: 16 MB</para></listitem>
29
30</itemizedlist>
31
32<para>Sizes may vary a little, depending on which compiler was used and
33which C library. But when comparing programs with and without debugging
34symbols, the difference will generally be a factor between 2 and 5.</para>
35
36<para>As most people will probably never use a debugger on their system
37software, a lot of disk space can be regained by removing these symbols .</para>
38
39<para>To remove debugging symbols from a binary (which must be an a.out
40or ELF binary), run <command>strip --strip-debug filename</command>.
41Wildcards can be used to treat multiple files (use something like
42<userinput>strip --strip-debug $LFS/tools/bin/*</userinput>).</para>
43
44<para>For your convenience, <xref linkend="chapter-finalizing"/> includes one simple
45command to strip all debugging symbols from all programs and libraries on your
46system. Additional information on optimization can be found in the hint at
47<ulink url="&hints-root;optimization.txt"/>.</para>
48
49</sect1>
50
Note: See TracBrowser for help on using the repository browser.