I have a C code executable for Linux.
For release, I can have two options:
One is build with -g -O3, strip the debug (strip -g) and send the output as release. Second is build the release directly with -O3.
The advantage of the first option, if I understand correctly, is that I can use the exe before the stripping for remote debugging or for analyzing core dumps.
The question is if there is any disadvantages in this approachi.e., is there run time performance overhead of building with -g and then stripping
thanks.
The advantages of this technology include the building's strength, insulation, and adaptability to a variety of building styles. Disadvantages include a higher labor need and increased costs. Formwork is needed to design the shape of cast-in-place concrete as it cures.
There is no run time performance hit for using -g
. The debug info lives in a separate section of the executable, which wont even be loaded if you execute the file.
But you can separate debug info and executables if you wish (which still won't make any performance difference). My Gentoo Linux handles it this way, the reason is simply minimizing used disk space which allows me having all binaries on a small fast disk while still keeping the debug info, which is alomst never used, in a separate partition.
objcopy --only-keep-debug foo foo.debug
strip -g foo
Now you have a foo executable and a foo.debug which contains debug symbols.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With