开发者

What happens if I don't use -g in linking time

Using gcc or clang, I used -g option for compilation and without it for linking. Does that mean that the final binary is equivalent in perf开发者_运维问答ormance to the one without -g option in the whole compilation process?


Usually it is considered a compiler bug if the performance of the binary with debugging information differs from the binary without. So, yes, you should expect the same performance.


-g generates debugging information during the compile step; it is completely ignored by the linker. So what you're doing is equivalent to both compiling and linking in one step, using -g.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜