From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Tool:Rustc" |
|---|
| claim | "rustc adds the LLVM named metadata llvm.ident = "rustc version <CFG_VERSION>" to every module it compiles (the source comment says that on wasm it becomes the producers/processed-by section); in ELF LLVM puts it in .comment, so the string 'rustc version ' marks Rust-compiled code and gives that compiler's version and commit. It is per compiled module, so a binary can hold several different versions (for example precompiled standard-library objects built by the release toolchain next to the user's code), it disappears when .comment is stripped, and whether PE/COFF and Mach-O outputs keep it was not checked." |
|---|
| scope | | level | "tool" |
|---|
| applies_to | "Tool:Rustc" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "string search in .comment (ELF) or the wasm producers section; absent when stripped" |
|---|
| indicator | "rustc version 1.xx.y (<short commit> <date>), possibly more than once with different versions" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "init_module: format!("rustc version {}", CFG_VERSION) added as llvm.ident named metadata. That LLVM writes llvm.ident to ELF .comment is LLVM behaviour, not read here." |
|---|
| repo | "https://github.com/rust-lang/rust" |
|---|
| commit | "02fb0a16311c3411fa373627706da085cd8fbd3c" |
|---|
| path | "compiler/rustc_codegen_llvm/src/context.rs" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| key | "rustc version string" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T05:16:17.381Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:43:45.180Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched rust 02fb0a1 rustc_codegen_llvm/src/context.rs lines 525-540: format!("rustc version {}", CFG_VERSION) added as llvm.ident named metadata, comment says wasm producers processed-by. The ELF .comment placement and strip behaviour are LLVM/binutils behaviour, not read here (the claim says so)." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T09:14:03.778Z" |
|---|
| summary | "Say when the indicator is absent or mixed: the string is per module, so rlibs from other rustc versions keep their own; strip removes .comment; wasm uses producers; I did not verify COFF/Mach-O…" |
|---|
| changed | |
|---|
|
|
|---|