aboutdebug.xml 2.1 KB

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