aboutdebug.xml 2.0 KB

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