[RuntimeDyld] Skip undefined symbols when building the symbol table.
authorLang Hames <lhames@gmail.com>
Wed, 30 Nov 2016 01:12:07 +0000 (01:12 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 30 Nov 2016 01:12:07 +0000 (01:12 +0000)
Storing these in the symbol table (with zero values) is just wasted space.

llvm-svn: 288225

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

index 82b582a..b1fa578 100644 (file)
@@ -205,6 +205,10 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
        ++I) {
     uint32_t Flags = I->getFlags();
 
+    // Skip undefined symbols.
+    if (Flags & SymbolRef::SF_Undefined)
+      continue;
+
     if (Flags & SymbolRef::SF_Common)
       CommonSymbols.push_back(*I);
     else {