recent(10)
2022-05-19
5721066129452119pnfeyfhv
45735396239973447pnfeyfhv
6494721599562769pnfeyfhv
hdhzbz
RecentDeleted
2021-12-18
cvv
xxxxxee
xxxxx
xxx
wdwdcvcvcvdvdvvaacc
本文
ノート
編集
差分
Edit of UNIX/コマンド/プログラミング/strip
TITLE:strip - 実行ファイルのサイズを減少 #navi(UNIX/コマンド) #contentsx オブジェクトファイルからリロケート情報とシンボルテーブルのデバッグ用の 情報を削除することで実行ファイルのサイズを減少させることができます。 % ls -l a.out -rwxr-xr-x 1 s1080134 student 5671 Oct 14 14:32 a.out* % file a.out a.out: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped % strip a.out % file a.out a.out: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped % ls -l a.out -rwxr-xr-x 1 s1080134 student 3172 Oct 14 14:33 a.out* 指定ディレクトリ以下のバイナリファイルをすべてstripするには % find [path] -type f -perm +a=x | xargs file | fgrep -i `uname -p` | fgrep 'not stripped' | cut -d: -f1 | xargs strip のようにするかもしれません。 実行許可のあるファイルを探し、file コマンドで情報を得て、'not stripped' かつ OS が実行環境と同じもの(会津大学には Solaris, IRIX その他があるため)に対してだけ strip しています。 #navi(UNIX/コマンド,,footer)
Do not change timestamp
TITLE:strip - 実行ファイルのサイズを減少 #navi(UNIX/コマンド) #contentsx オブジェクトファイルからリロケート情報とシンボルテーブルのデバッグ用の 情報を削除することで実行ファイルのサイズを減少させることができます。 % ls -l a.out -rwxr-xr-x 1 s1080134 student 5671 Oct 14 14:32 a.out* % file a.out a.out: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped % strip a.out % file a.out a.out: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped % ls -l a.out -rwxr-xr-x 1 s1080134 student 3172 Oct 14 14:33 a.out* 指定ディレクトリ以下のバイナリファイルをすべてstripするには % find [path] -type f -perm +a=x | xargs file | fgrep -i `uname -p` | fgrep 'not stripped' | cut -d: -f1 | xargs strip のようにするかもしれません。 実行許可のあるファイルを探し、file コマンドで情報を得て、'not stripped' かつ OS が実行環境と同じもの(会津大学には Solaris, IRIX その他があるため)に対してだけ strip しています。 #navi(UNIX/コマンド,,footer)
ログインまたはアカウント作成