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