aboutdebug.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.2MB</para></listitem>
  16. <listitem><para>A dynamic Bash binary
  17. without debugging symbols: 478KB</para></listitem>
  18. <listitem><para>/lib and /usr/lib (glibc
  19. and gcc files) with debugging symbols: 87MB</para></listitem>
  20. <listitem><para>/lib and /usr/lib (glibc
  21. and gcc files) without debugging symbols: 16MB</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>. Wild cards
  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.</para>
  35. <para>You might find additional information in the optimization hint which can
  36. be found at <ulink
  37. url="&hints-root;optimization.txt">&hints-root;optimization.txt</ulink>
  38. .</para>
  39. </sect1>