summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Symbols.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 1c5cae1b16f..22ec91fa79a 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -146,7 +146,10 @@ std::string elf2::demangle(StringRef Name) {
if (!Config->Demangle)
return Name;
- // Return if it does not look like a C++ symbol.
+ // Don't call __cxa_demangle if the name does not look like a C++
+ // symbol name. We need this check because some implementations of the
+ // function try to demangle a name as something different (e.g. type name)
+ // if it is not a mangled symbol name.
if (!Name.startswith("_Z"))
return Name;
OpenPOWER on IntegriCloud