| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | <sect1 id="ch06-aboutdebug"><title>About debugging symbols</title><para>Most programs and libraries by default are compiled with debuggingsymbols (gcc option -g) Let me explain what these debugging symbolsare and why you may not want them.</para><para>A program compiled with debugging symbols means a user can run a program or library through a debugger and the debugger's output will be userfriendly. These debugging symbols also enlarge the program or library significantly. </para><para>Before you start wondering whether these debugging symbols really make a big difference, here are some statistics. Use them to draw your ownconclusion.</para><itemizedlist><listitem><para>        A dynamic Bash binary with debugging symbols: 1.2MB</para></listitem><listitem><para>        A dynamic Bash binary without debugging symbols: 478KB</para></listitem><listitem><para>        /lib and /usr/lib (glibc and gcc files) with debugging                symbols: 87MB</para></listitem><listitem><para>        /lib and /usr/lib (glibc and gcc files) without                debugging symbols: 16MB</para></listitem></itemizedlist><para>Sizes vary depending on which compiler was used and which C libraryversion was used to link dynamic programs against, but results will besimilar if you compare programs with and without debugging symbols. AfterI was done with this chapter and stripped all debugging symbols from all LFSbinaries I regained a little over 102 MB of disk space. Quite the difference.</para><para>To remove debugging symbols from a binary (must be an a.out or ELFbinary) run <userinput>strip --strip-debug filename</userinput>. Wild cardscan be used to strip debugging symbols from multiple files (use something like <userinput>strip --strip-debug $LFS/usr/bin/*</userinput>).Most people will probably never use a debugger on software, so byremoving those symbols a lot of diskspace can be regained.</para><para>You might find additional information in the optimization hint which can be found at <ulink url="http://cvs.linuxfromscratch.org/index.cgi/hints/">http://cvs.linuxfromscratch.org/index.cgi/hints/</ulink>.</para></sect1>
 |