Skip to content

Commit 2531d08

Browse files
committed
Auto merge of rust-lang#123336 - workingjubilee:strip-the-trace-off-my-back, r=Nilstrieb
Note impact of `-Cstrip` on backtraces It is not always clear to people what the impact of `-Cstrip` options are. They are a common question on sites like StackOverflow, and sometimes people even report bugs with "no backtrace" after deliberately mangling the symbol table. We cannot exhaustively document every permutation, but we should warn people about common effects.
2 parents e2cf2cb + 1dcaf70 commit 2531d08

File tree

1 file changed

+11
-3
lines changed
  • src/doc/rustc/src/codegen-options

1 file changed

+11
-3
lines changed

src/doc/rustc/src/codegen-options/index.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,17 @@ Supported values for this option are:
553553
of MSVC).
554554
- `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table
555555
section are stripped at link time and are not copied to the produced binary
556-
or separate files.
557-
- `symbols` - same as `debuginfo`, but the rest of the symbol table section is
558-
stripped as well if the linker supports it.
556+
or separate files. This should leave backtraces mostly-intact but may make
557+
using a debugger like gdb or lldb ineffectual.
558+
- `symbols` - same as `debuginfo`, but the rest of the symbol table section is stripped as well,
559+
depending on platform support. On platforms which depend on this symbol table for backtraces,
560+
profiling, and similar, this can affect them so negatively as to make the trace incomprehensible.
561+
Programs which may be combined with others, such as CLI pipelines and developer tooling,
562+
or even anything which wants crash-reporting, should usually avoid `-Cstrip=symbols`.
563+
564+
Note that, at any level, removing debuginfo only necessarily impacts "friendly" introspection.
565+
`-Cstrip` cannot be relied on as a meaningful security or obfuscation measure, as disassemblers
566+
and decompilers can extract considerable information even in the absence of symbols.
559567

560568
## symbol-mangling-version
561569

0 commit comments

Comments
 (0)