Add support for rust v0 mangling format
RUST RFC 2603 describes a new name mangling format to replace the current one in use (designed 'legacy' by the RFC). Currently, the v0 format is still only available as an opt-in feature in rust nightly, however based on rust#60705 it appears likely this will be come the default in the (relatively) near future. We should add support for this to libdemangle so that the native tools can understand and demangle any symbols mangled using the new format.
It should be noted that as the RFC was implemented in the rust compiler, there were some changes made during the implementation of the RFC in the rust compiler that caused the implementation to deviate from the spec in a few areas. There is also some ambiguity in a few places as well. Unfortunately, there does not appear to be a mechanism currently to update the RFC after the fact with these updates. Talking to some people involved with the rust demangling effort, it does appear these are legitimate changes and not just a bug where the RFC was not followed. The implementation for libdemangle is based off the RFC, however where these deviations have occurred, I've tried to note them to help any future efforts.
Updated by Jason King 6 months ago
To test, the demangling tests (including the new added ones) were run, and all pass.
Additionally, Eduard-Mihai Burtescu (eddyb) from the rust community had a very large set of rust mangled names that was used to help develop the rust-demangle crate (as well as the libierty rust demangling implementation). He was able to run those against the code and verify they all return the same results as the rust-demangle crate.
Updated by Electric Monk 5 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 1cd083931cfd3fb8617c1178f62bce417cfa6af2 Author: Jason King <firstname.lastname@example.org> Date: 2021-05-13T21:10:25.000Z 13780 Add support for rust v0 mangling format Portions contributed by: Eduard-Mihai Burtescu <email@example.com> Reviewed by: Toomas Soome <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>