gcc -g -o hello hello.c
でデバッグシンボル付きの実行可能なオブジェクトファイルhelloが生成されます。
objcopy --strip-debug hello
とすることで、デバッグシンボルなしなオブジェクトファイルになります。
ではデバッグシンボルのみなオブジェクトファイルを生成するには、どのようにすればいいのでしょうか?
スタック・オーバーフローはプログラマーとプログラミングに熱心な人のためのQ&Aサイトです。すぐ登録できます。
登録してこのコミュニティに参加する$ strip --only-keep-debug [executable]
strip(1)
--only-keep-debug
Strip a file, removing contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact.
もしくは、
$ objcopy --only-keep-debug [executable] [output]