0
我使用objcopy
来提取/替换某个部分是Windows系统上的ELF文件。如何避免objcopy炸毁文件?
>objcopy.exe -V
GNU objcopy 2.17.50 20060824
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
这工作一般。
但我的elf文件包含调试信息,我需要在传递之前删除以减小文件大小。
我发现THT选项-g
或--strip-debug
应该做我想做的:
>"objcopy.exe" --strip-debug -I elf32-big -O elf32-big with-debug.elf without-debug.elf
但悲惨的失败了。而不是使文件更小从〜炸毁的文件大小为20MB到3GB与失败之前:
objcopy.exe: without-debug.elf: File truncated
objcopy.exe: without-debug.elf: No space left on device
我怎么corectly从ELF使用objcopy命令删除调试信息?
不知道这是重要的,但objcopy把问题的一些警告,最加时赛中ELF的部分是这样的:
BFD: without-debug.elf: warning: allocated section `.sdata' not in segment
我的问题是,我被绑定到该版本。新版本在另一个功能上有不同的行为,这会造成麻烦... –