<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[[简单实践]linux中的strip命令~]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Thu, 01 Nov 2018 09:41:36 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：在Docker打包PHP时发现这个命令，于是查了一下。<br/>strip命令用于脱掉文件的衣服， 文件会变小， 其中的符号信息会失去。 那这个strip有什么<br/><br/>用呢？ 很有用的！ 原来的a.out比较大， 可以执行。 在strip之后， 文件变小了， 也是可以执行， 这就节省了很多空间.<br/><br/>      其实， strip不仅仅可以针对可执行文件， 还能针对目标文件和动态库等. 在实际的开发中， 经常需要对动态库.so进行strip操作， 减少占地空间。 而在调试的时候（比如用addr2line）， 就需要符号了。 因此， 通常的做法是： strip前的库用来调试， strip后的库用来实际发布， 他们两者有对应关系。 一旦发布的strip后的库出了问题， 就可以找对应的未strip的库来定位。<br/><br/>      例如某个动态库strip前是50M左右， strip后是20M左右， 可见， 脱脱衣服还是有明显好处的。<br/><br/>      我们在调试过程中， 经常涉及到上传库， 库太大时， 很耗费传输时间， 所以还是先用strip来处理一下比较好。 <br/>--------------------- <br/>/data/codesdev/testdemo/c/strip]<br/>#tree -l<br/>.<br/>├── strip<br/>└── strip.c<br/><br/>#cat strip.c<br/>#include &lt;stdio.h&gt;&nbsp;&nbsp;<br/> <br/>void main()&nbsp;&nbsp;<br/>&#123;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;strip&#92;n&quot;); <br/>&#125; <br/><br/>#make strip<br/>cc&nbsp;&nbsp;&nbsp;&nbsp; strip.c&nbsp;&nbsp; -o strip<br/><br/>#ls -l strip<br/>-rwxr-xr-x 1 root root 8440 11月&nbsp;&nbsp;1 17:26 strip<br/><br/>#/usr/bin/file strip<br/>strip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ec884c4b45d605867f9319a6d5b3acaea1866798, not stripped<br/><br/>#nm strip<br/>000000000060102c B __bss_start<br/>000000000060102c b completed.6355<br/>0000000000601028 D __data_start<br/>0000000000601028 W data_start<br/>0000000000400460 t deregister_tm_clones<br/><br/>#strip strip<br/><br/>#ls -l strip&nbsp;&nbsp;#File Size变小<br/>-rwxr-xr-x 1 root root 6296 11月&nbsp;&nbsp;1 17:28 strip<br/><br/>#file strip<br/>strip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ec884c4b45d605867f9319a6d5b3acaea1866798, stripped<br/><br/>#nm strip<br/>nm: strip：无符号<br/><br/><br/>来自：https://blog.csdn.net/qq_37858386/article/details/78559490
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [简单实践]linux中的strip命令~]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>