mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-19 03:39:20 +01:00
Text update
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@360 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
4848808d6c
commit
abdeaad6a7
@ -3,36 +3,21 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Most programs and libraries by default are compiled with debugging
|
Most programs and libraries by default are compiled with debugging
|
||||||
symbols and optimizing level 2 (gcc options -g and -O2) and are compiled
|
symbols (gcc option -g) Let me explain what these debugging symbols
|
||||||
for a specific CPU. On Intel platforms software is compiled for i386
|
are and why you may not want them.
|
||||||
processors by default. If a user doesn't wish to run software on other
|
|
||||||
machines other than his own, he might want to change the default
|
|
||||||
compiler options so that they will be compiled with a higher
|
|
||||||
optimization level, no debugging symbols and generate code for his
|
|
||||||
specific architecture. Let me first explain what debugging symbols
|
|
||||||
are.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A program compiled with debugging symbols means a user can run a program or
|
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 friendlier.
|
library through a debugger and the debugger's output will be user
|
||||||
These debugging symbols also enlarge the program or library significantly.
|
friendly. These debugging symbols also enlarge the program or library
|
||||||
|
significantly.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To remove debugging symbols from a binary (must be an a.out or ELF binary)
|
Before you start wondering whether these debugging symbols really make a
|
||||||
run <userinput>strip --strip-debug filename</userinput>. A user can use wild
|
big difference, here are some statistics. Use them to draw your own
|
||||||
cards
|
conclusion.
|
||||||
if he needs to strip debugging symbols from multiple files (use something like
|
|
||||||
strip --strip-debug $LFS/usr/bin/*). Another, easier, options is just
|
|
||||||
not to compile programs with debugging symbols. Most people will probably
|
|
||||||
never use a debugger on software, so by leaving those symbols out
|
|
||||||
a lot of diskspace can be saved.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Before someone wonders if these debugging symbols would make a big difference,
|
|
||||||
here are some statistics:
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
@ -58,12 +43,20 @@ here are some statistics:
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Sizes may vary depending on which compiler was used and which C library
|
Sizes vary depending on which compiler was used and which C library
|
||||||
version was used to link dynamic programs against, but results will be
|
version was used to link dynamic programs against, but results will be
|
||||||
similar if a user compares programs with and without debugging symbols. After
|
similar if you compare programs with and without debugging symbols. After
|
||||||
I was done with this chapter and stripped all debugging symbols from all LFS
|
I was done with this chapter and stripped all debugging symbols from all LFS
|
||||||
binaries and libraries I regained a little over 102 MB of disk space. Quite
|
binaries I regained a little over 102 MB of disk space. Quite the difference.
|
||||||
the difference.
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
To remove debugging symbols from a binary (must be an a.out or ELF
|
||||||
|
binary) run <userinput>strip --strip-debug filename</userinput>. Wild cards
|
||||||
|
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 diskspace can be regained.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
Loading…
Reference in New Issue
Block a user