[6370fa6] | 1 | <sect1 id="ch06-aboutdebug">
|
---|
| 2 | <title>About debugging symbols</title>
|
---|
[576e206] | 3 | <?dbhtml filename="aboutdebug.html" dir="chapter06"?>
|
---|
[6370fa6] | 4 |
|
---|
[b822811] | 5 | <para>Most programs and libraries by default are compiled with debugging
|
---|
[2b1174be] | 6 | symbols (gcc option -g).</para>
|
---|
[6370fa6] | 7 |
|
---|
[b822811] | 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
|
---|
[abdeaad6] | 10 | friendly. These debugging symbols also enlarge the program or library
|
---|
[b822811] | 11 | significantly.</para>
|
---|
[6370fa6] | 12 |
|
---|
[b822811] | 13 | <para>Before you start wondering whether these debugging symbols really make a
|
---|
[abdeaad6] | 14 | big difference, here are some statistics. Use them to draw your own
|
---|
[b822811] | 15 | conclusion.</para>
|
---|
[6370fa6] | 16 |
|
---|
| 17 | <itemizedlist>
|
---|
| 18 |
|
---|
[b822811] | 19 | <listitem><para>A dynamic Bash binary
|
---|
[b34a757] | 20 | with debugging symbols: 1.2 MB</para></listitem>
|
---|
[6370fa6] | 21 |
|
---|
[b822811] | 22 | <listitem><para>A dynamic Bash binary
|
---|
[b34a757] | 23 | without debugging symbols: 478 KB</para></listitem>
|
---|
[6370fa6] | 24 |
|
---|
[b822811] | 25 | <listitem><para>/lib and /usr/lib (glibc
|
---|
[b34a757] | 26 | and gcc files) with debugging symbols: 87 MB</para></listitem>
|
---|
[6370fa6] | 27 |
|
---|
[b822811] | 28 | <listitem><para>/lib and /usr/lib (glibc
|
---|
[b34a757] | 29 | and gcc files) without debugging symbols: 16 MB</para></listitem>
|
---|
[6370fa6] | 30 |
|
---|
| 31 | </itemizedlist>
|
---|
| 32 |
|
---|
[b822811] | 33 | <para>Sizes vary depending on which compiler was used and which C library
|
---|
[81a47c0] | 34 | version was used to link dynamic programs against, but results will be
|
---|
[2b1174be] | 35 | similar if you compare programs with and without debugging symbols.</para>
|
---|
[abdeaad6] | 36 |
|
---|
[b822811] | 37 | <para>To remove debugging symbols from a binary (must be an a.out or ELF
|
---|
[18b6e01e] | 38 | binary) run <userinput>strip --strip-debug filename</userinput>. Wildcards
|
---|
[abdeaad6] | 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
|
---|
[b822811] | 42 | removing those symbols a lot of disk space can be regained.</para>
|
---|
[6370fa6] | 43 |
|
---|
[2b1174be] | 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>
|
---|
| 47 |
|
---|
[b822811] | 48 | <para>You might find additional information in the optimization hint which can
|
---|
[d920fb0] | 49 | be found at <ulink url="&hints-root;optimization.txt"/>.</para>
|
---|
[5c453fa] | 50 |
|
---|
[6370fa6] | 51 | </sect1>
|
---|
| 52 |
|
---|