@@ -623,7 +623,8 @@ Mangled names conform to the following grammar:
623
623
624
624
```
625
625
// The <decimal-number> specifies the encoding version.
626
- <symbol-name> = "_R" [<decimal-number>] <path> [<instantiating-crate>]
626
+ <symbol-name> =
627
+ "_R" [<decimal-number>] <path> [<instantiating-crate>] [<vendor-specific-suffix>]
627
628
628
629
<path> = "C" <identifier> // crate root
629
630
| "M" <impl-path> <type> // <T> (inherent impl)
@@ -746,6 +747,10 @@ Mangled names conform to the following grammar:
746
747
// We use <path> here, so that we don't have to add a special rule for
747
748
// compression. In practice, only a crate root is expected.
748
749
<instantiating-crate> = <path>
750
+
751
+ // There are no restrictions on the characters that may be used
752
+ // in the suffix following the `.`.
753
+ <vendor-specific-suffix> = "." <suffix>
749
754
```
750
755
751
756
### Namespace Tags
@@ -801,6 +806,18 @@ With this post-processing in place the Punycode strings can be treated
801
806
like regular identifiers and need no further special handling.
802
807
803
808
809
+ ### Vendor-specific suffix
810
+
811
+ Similarly to the [ Itanium C++ ABI mangling scheme] [ itanium-mangling-structure ] , a symbol name
812
+ containing a period (` . ` ) represents a vendor-specific version of the symbol. There are no
813
+ restrictions on the characters following the period.
814
+
815
+ This can happen in practice when locally unique names needed to become globally unique. For example,
816
+ LLVM can append a ` .llvm.<numbers> ` suffix during LTO to ensure a unique name. In these situations
817
+ it's generally fine to ignore the suffix: the suffixed name has the same semantics as the original.
818
+
819
+ [ itanium-mangling-structure ] : https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-structure
820
+
804
821
## Compression
805
822
806
823
Symbol name compression works by substituting parts of the mangled
@@ -1156,3 +1173,4 @@ pub static QUUX: u32 = {
1156
1173
- Make ` <binder> ` optional in ` <fn-sig> ` and ` <dyn-bounds> ` productions.
1157
1174
- Extend ` <const-data> ` to include ` bool ` values, ` char ` values, and negative integer values.
1158
1175
- Remove type from constant placeholders.
1176
+ - Allow vendor-specific suffixes.
0 commit comments