Is there a way to change the symbol name of the Rust std library to V0

The default mangle name rule used by the Rust std library is legacy. How can I change it to V0.
default:

readelf -sW libstd-075c79122bf4ef22.so

Symbol table '.dynsym' contains 1720 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     ....
    171: 00000000000a83a0    22 FUNC    GLOBAL DEFAULT   12 _ZN3std3net3udp9UdpSocket9peek_from17h0fdef50c6a94bf95E

     ......

The v0 rule is introduced here:
https://doc.rust-lang.org/rustc/symbol-mangling/v0.html

If you're building the toolchain yourself, you can set in config.toml:

[rust]
new-symbol-mangling = true
1 Like