summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-01-13 19:40:13 +0000
committerRui Ueyama <ruiu@google.com>2016-01-13 19:40:13 +0000
commit5fa978b4c08702247ccd0b88f1014344185de1eb (patch)
treeaaeb05d71669b2ea22bf1e7f879fb96c1a01deb7
parentaae49c19449e50f60dffe1ed49ee515ab5195de3 (diff)
downloadbcm5719-llvm-5fa978b4c08702247ccd0b88f1014344185de1eb.tar.gz
bcm5719-llvm-5fa978b4c08702247ccd0b88f1014344185de1eb.zip
Attempt to make FreeBSD buildbot green.
It seems that __cxa_demangle function on the buildbot tried to demangle a variable "tlsvar" as a C++ symbol. Do not call that function unless it does not start with "_Z" which is the prefix of mangled names. llvm-svn: 257661
-rw-r--r--lld/ELF/Symbols.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index f7ef342edcc..1c5cae1b16f 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -145,6 +145,11 @@ std::string elf2::demangle(StringRef Name) {
#else
if (!Config->Demangle)
return Name;
+
+ // Return if it does not look like a C++ symbol.
+ if (!Name.startswith("_Z"))
+ return Name;
+
char *Buf =
abi::__cxa_demangle(Name.str().c_str(), nullptr, nullptr, nullptr);
if (!Buf)
OpenPOWER on IntegriCloud