Project

General

Profile

Actions

Bug #13780

closed

Add support for rust v0 mangling format

Added by Jason King about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

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.

Actions #1

Updated by Electric Monk about 2 years ago

  • Gerrit CR set to 1467
Actions #2

Updated by Jason King about 2 years 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.

Actions #3

Updated by Electric Monk about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 1cd083931cfd3fb8617c1178f62bce417cfa6af2

commit  1cd083931cfd3fb8617c1178f62bce417cfa6af2
Author: Jason King <jason.brian.king@gmail.com>
Date:   2021-05-13T21:10:25.000Z

    13780 Add support for rust v0 mangling format
    Portions contributed by: Eduard-Mihai Burtescu <eddyb@lyken.rs>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF