剥离可执行文件 (Windows)
我听说 strip 是一个可以使可执行文件变小的程序。
我尝试从我的编译器(针对 Python)打开它,但是当运行 strip 时,我只是在命令提示符中看到“strip 未被识别为命令或程序”错误。
那么我在哪里可以获得 Windows 版 strip 的可执行文件呢?
I've heard that strip is a program that makes an executable smaller.
I've tried to turn it on from my compiler (for Python) but when it comes to run strip I just see "strip is not recognized as a command or as a program" error from the Command Prompt.
So where do I get the executable of strip for Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
strip 是 GNU binutils 的一部分。
strip is part of GNU's binutils.
Unix/Linux 样式条将删除用于调试目的的符号信息。据我所知,Windows 下的 strip 实用程序特定于所使用的编译器。有关详细信息,请参阅此处。
可能有用的相关实用程序是 StripReloc,它是一个从可执行文件中删除重定位信息的实用程序,这使得它们变得更小。不过,请阅读说明,但不建议对系统上的每个 .exe 盲目运行它......
Unix/Linux style strip will remove symbol info that is used for debugging purposes. AFAIK under Windows a strip utility is specific to the compiler that was used. See here on SO for more info.
A related utility that might be useful is StripReloc, a utility that removes relocation info from executables and as such makes them smaller. Read the instructions though, it's not recommended to run it blindly against every .exe on your system...
Strip 从目标文件中删除调试符号等信息。这样做可以使文件更小。
如果您有它,它可能会随您的 C 编译器(例如 GCC)一起分发。
Strip removes information such as debugging symbols from object files. Doing this makes the file smaller.
If you have it, it would likely be distributed with your C compiler (such as GCC).