mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-01-18 21:17:38 +00:00
d920fb0a20
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1877 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
53 lines
2.0 KiB
XML
53 lines
2.0 KiB
XML
<sect1 id="ch06-aboutdebug">
|
|
<title>About debugging symbols</title>
|
|
<?dbhtml filename="aboutdebug.html" dir="chapter06"?>
|
|
|
|
<para>Most programs and libraries by default are compiled with debugging
|
|
symbols (gcc option -g).</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 user
|
|
friendly. 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 own
|
|
conclusion.</para>
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem><para>A dynamic Bash binary
|
|
with debugging symbols: 1.2 MB</para></listitem>
|
|
|
|
<listitem><para>A dynamic Bash binary
|
|
without debugging symbols: 478 KB</para></listitem>
|
|
|
|
<listitem><para>/lib and /usr/lib (glibc
|
|
and gcc files) with debugging symbols: 87 MB</para></listitem>
|
|
|
|
<listitem><para>/lib and /usr/lib (glibc
|
|
and gcc files) without debugging symbols: 16 MB</para></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
<para>Sizes vary depending on which compiler was used and which C library
|
|
version was used to link dynamic programs against, but results will be
|
|
similar if you compare programs with and without debugging symbols.</para>
|
|
|
|
<para>To remove debugging symbols from a binary (must be an a.out or ELF
|
|
binary) run <userinput>strip --strip-debug filename</userinput>. Wildcards
|
|
can 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 by
|
|
removing those symbols a lot of disk space can be regained.</para>
|
|
|
|
<para>For your convenience, chapter 9 includes one simple command to strip
|
|
all debugging symbols from all programs and libraries on your
|
|
system.</para>
|
|
|
|
<para>You might find additional information in the optimization hint which can
|
|
be found at <ulink url="&hints-root;optimization.txt"/>.</para>
|
|
|
|
</sect1>
|
|
|