开发者

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

开发者 https://www.devze.com 2023-03-01 00:07 出处:网络
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 wh

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

精彩评论

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