summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 488130112de..5c16f0ab712 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -205,10 +205,14 @@ RuntimeDyldImpl::loadObject(std::unique_ptr<ObjectImage> Obj) {
bool IsCode = SI->isText();
unsigned SectionID =
findOrEmitSection(*Obj, *SI, IsCode, LocalSections);
+ // Add the symbol to the local symbol table for this module.
LocalSymbols[Name.data()] = SymbolLoc(SectionID, SectOffset);
DEBUG(dbgs() << "\tOffset: " << format("%p", (uintptr_t)SectOffset)
<< " flags: " << Flags << " SID: " << SectionID);
- GlobalSymbolTable[Name] = SymbolLoc(SectionID, SectOffset);
+ // If exported, add to the global symbol table for other modules to also link in.
+ if (Flags & SymbolRef::SF_Exported) {
+ GlobalSymbolTable[Name] = SymbolLoc(SectionID, SectOffset);
+ }
}
}
DEBUG(dbgs() << "\tType: " << SymType << " Name: " << Name << "\n");
OpenPOWER on IntegriCloud