如何在编译时从输出中排除源文件元数据? [英] How can I exclude source file metadata from output when compiling?

查看:133
本文介绍了如何在编译时从输出中排除源文件元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:

$ gcc -O3 foobar.c -o foobar
$ grep 'foobar\.c' foobar
Binary file foobar matches

如何排除这些不必要和显示的元数据从 gcc 和其他编译器的输出?

How can I exclude such unnecessary and revealing metadata from the output of gcc and other compilers? It appears regardless of whether the output is an assembly file, object file, or executable.

推荐答案

man strip(1)

man strip(1)

> strip -s a.out

这篇关于如何在编译时从输出中排除源文件元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆