Difference between strip = symbols and strip = debuginfo

I'm reading here:

https://doc.rust-lang.org/cargo/reference/profiles.html#release

and it mentions

strip = "debuginfo"
strip = "symbols"

what is the difference between the two (and advantages btw using one vs the other)?

Thank you!

According to the Rust linker code

debuginfo corresponds to the --strip-debug argument to the LLVM linker. Specifically, it will "Remove all debug sections from the output."

symbols corresponds to --strip-all. The detailed description is "For ELF objects, remove from the output all symbols and non-alloc sections not within segments, except for .gnu.warning, .ARM.attribute sections and the section name table. For COFF objects, remove all symbols, debug sections, and relocations from the output."

In other words, symbols is more thorough than debuginfo and will result in a smaller binary.

4 Likes

thank you :slight_smile: