Ignore llvm specific symbols in the LTOModule.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Jul 2014 19:31:27 +0000 (19:31 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Jul 2014 19:31:27 +0000 (19:31 +0000)
These are the llvm.* globals and functions.

I don't think it is possible to test this directly since llvm-lto is not
a full linker and will not report duplicated symbols, but this fixes
bootstrap with gold and lto enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212354 91177308-0d34-0410-b5e6-96231b3b80d8

lib/LTO/LTOModule.cpp

index 314831ff6f84b43606eeefb6a33aadc9cbac4db9..2fa450fd9d9cf8a93847bf513259fd99f34386f2 100644 (file)
@@ -531,6 +531,9 @@ bool LTOModule::parseSymbols(std::string &errMsg) {
   for (auto &Sym : IRFile->symbols()) {
     const GlobalValue *GV = IRFile->getSymbolGV(Sym.getRawDataRefImpl());
     uint32_t Flags = Sym.getFlags();
+    if (Flags & object::BasicSymbolRef::SF_FormatSpecific)
+      continue;
+
     bool IsUndefined = Flags & object::BasicSymbolRef::SF_Undefined;
 
     if (!GV) {