making up for cvs export not creating empy dirs
[linux_from_scratch.git] / BOOK / chapter06 / aboutdebug.xml
blobfb991bca429a83d3b3de73c0feb449aef6a2e63e
1 <sect1 id="ch06-aboutdebug">
2 <title>About debugging symbols</title>
3 <?dbhtml filename="aboutdebug.html" dir="chapter06"?>
5 <para>Most programs and libraries by default are compiled with debugging
6 symbols (gcc option -g).</para>
8 <para>A program compiled with debugging symbols means a user can run a program 
9 or library through a debugger and the debugger's output will be user
10 friendly. These debugging symbols also enlarge the program or library 
11 significantly.</para>
13 <para>Before you start wondering whether these debugging symbols really make a 
14 big difference, here are some statistics. Use them to draw your own
15 conclusion.</para>
17 <itemizedlist>
19 <listitem><para>A dynamic Bash binary 
20 with debugging symbols: 1.2MB</para></listitem>
22 <listitem><para>A dynamic Bash binary 
23 without debugging symbols: 478KB</para></listitem>
25 <listitem><para>/lib and /usr/lib (glibc 
26 and gcc files) with debugging symbols: 87MB</para></listitem>
28 <listitem><para>/lib and /usr/lib (glibc 
29 and gcc files) without debugging symbols: 16MB</para></listitem>
31 </itemizedlist>
33 <para>Sizes vary depending on which compiler was used and which C library
34 version was used to link dynamic programs against, but results will be
35 similar if you compare programs with and without debugging symbols.</para>
37 <para>To remove debugging symbols from a binary (must be an a.out or ELF
38 binary) run <userinput>strip --strip-debug filename</userinput>. Wildcards
39 can be used to strip debugging symbols from multiple files (use something 
40 like <userinput>strip --strip-debug $LFS/usr/bin/*</userinput>).
41 Most people will probably never use a debugger on software, so by
42 removing those symbols a lot of disk space can be regained.</para>
44 <para>For your convenience, chapter 9 includes one simple command to strip
45 all debugging symbols from all programs and libraries on your
46 system.</para>
48 <para>You might find additional information in the optimization hint which can 
49 be found at <ulink
50 url="&hints-root;optimization.txt">&hints-root;optimization.txt</ulink>
51 .</para>
53 </sect1>