diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-08-26 09:42:08 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-08-26 10:00:48 +0100 |
commit | 8c6a2f1dbf8f9fba942e7be4b566f105bb21f224 (patch) | |
tree | 443a619f141adaf6777eee737055c942837f48fb /gcc/rust/backend/rust-compile-item.h | |
parent | 40042ce11fc5d7f62e31be99e82bf6a0db83234a (diff) | |
download | gcc-8c6a2f1dbf8f9fba942e7be4b566f105bb21f224.zip gcc-8c6a2f1dbf8f9fba942e7be4b566f105bb21f224.tar.gz gcc-8c6a2f1dbf8f9fba942e7be4b566f105bb21f224.tar.bz2 |
Fix issue with mangled name on function items with substitutions
Rust legacy name mangling does not contain the substitutions as part of
its mangled name for Item's. Rust avoids duplicate symbol collisions with
the legacy mangling scheme, but including a 128bit hash at the end of the
symbol, which is made up with metadata and in this case the mangled symbol
contains a hash of the type which this function is.
Fixes #647
Diffstat (limited to 'gcc/rust/backend/rust-compile-item.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-item.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/gcc/rust/backend/rust-compile-item.h b/gcc/rust/backend/rust-compile-item.h index eb7d9ef..1871d10 100644 --- a/gcc/rust/backend/rust-compile-item.h +++ b/gcc/rust/backend/rust-compile-item.h @@ -199,16 +199,7 @@ public: // yet if (!is_main_fn) { - std::string substs_str = fntype->subst_as_string (); - - Resolver::CanonicalPath mangle_me - = substs_str.empty () - ? *canonical_path - : canonical_path->append ( - Resolver::CanonicalPath::new_seg (0, - fntype->subst_as_string ())); - - asm_name = ctx->mangle_item (fntype, mangle_me); + asm_name = ctx->mangle_item (fntype, *canonical_path); } Bfunction *fndecl |