一、空间优化(减少可执行文件的大小)
主要有两个方向:1)去除符号信息 2)只链接有用的东西
示例引自http://wiki.wxwidgets.org/Reducing_Executable_Size:Test #1
# wxGTK compiled with:
# ./configure --disable-debug --disable-shared
# make
$ ls -l minimal
-rwxr-xr-x 1 frm frm 4,3M 2009-02-11 17:04 minimal*
$ size minimal
text data bss dec hex filename
3698330 10436 49692 3758458 39597a minimal
$ strip --strip-all minimal
$ ls -l minimal
-rwxr-xr-x 1 frm frm 3,6M 2009-02-11 17:23 minimal*
$ strip --remove-section=.comment --remove-section=.note minimal
$ ls -l minimal
-rwxr-xr-x 1 frm frm 3,6M 2009-02-11 17:28 minimal*
I.e. using --strip-all provided a 17% improvement. Removing the .comment and .note sections didn't produce any noti