aboutdebug.html
来自「lfs3.1 从源代码构建linux。html版本。」· HTML 代码 · 共 205 行
HTML
205 行
<HTML><HEAD><TITLE>About debugging symbols</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Installing basic system software"HREF="../chapter06/chapter06.html"><LINKREL="PREVIOUS"TITLE="Introduction"HREF="../chapter06/introduction.html"><LINKREL="NEXT"TITLE="Creating $LFS/root/.bash_profile"HREF="../chapter06/bashprofile.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter06/introduction.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 6. Installing basic system software</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter06/bashprofile.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch06-aboutdebug">6.2. About debugging symbols</A></H1><P>Most programs and libraries by default are compiled with debuggingsymbols (gcc option -g).</P><P>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.</P><P>Before you start wondering whether these debugging symbols really make a big difference, here are some statistics. Use them to draw your ownconclusion.</P><P></P><UL><LI><P>A dynamic Bash binary with debugging symbols: 1.2MB</P></LI><LI><P>A dynamic Bash binary without debugging symbols: 478KB</P></LI><LI><P>/lib and /usr/lib (glibc and gcc files) with debugging symbols: 87MB</P></LI><LI><P>/lib and /usr/lib (glibc and gcc files) without debugging symbols: 16MB</P></LI></UL><P>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.</P><P>To remove debugging symbols from a binary (must be an a.out or ELFbinary) run <TTCLASS="userinput"><B>strip --strip-debug filename</B></TT>. Wildcardscan be used to strip debugging symbols from multiple files (use something like <TTCLASS="userinput"><B>strip --strip-debug $LFS/usr/bin/*</B></TT>).Most people will probably never use a debugger on software, so byremoving those symbols a lot of disk space can be regained.</P><P>For your convenience, chapter 9 includes one simple command to stripall debugging symbols from all programs and libraries on yoursystem.</P><P>You might find additional information in the optimization hint which can be found at <AHREF="http://hints.linuxfromscratch.org/hints/optimization.txt"TARGET="_top">http://hints.linuxfromscratch.org/hints/optimization.txt</A>.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter06/introduction.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter06/bashprofile.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Introduction</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter06/chapter06.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Creating $LFS/root/.bash_profile</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?