close

對編譯後生成的執行檔使用 strip 命令

strip -s 執行檔.exe


編譯前給 GCC 加入 CFLAGS「-s」。臨時調用可以使用 CC 搭配 configure

CC='gcc -s' ./configure


無論使用「strip -s」還是「gcc -s」,最終得到的檔案大小都相同。strip 和 gcc 的 -s 參數還可以寫作 --strip-all。
-s 的定義:Remove all symbol and relocation information;Strip all symbols。

最後可以使用 UPX 壓縮執行檔,「-9」表示最大壓縮,同 7-zip 壓縮效果差不多。

upx -9 執行檔.exe
arrow
arrow
    全站熱搜

    呆丸北拜 發表在 痞客邦 留言(0) 人氣()