Fixing MCJIT multiple module linking for OSX

llvm-svn: 191780
This commit is contained in:
Andrew Kaylor 2013-10-01 16:42:50 +00:00
parent 97e8a87cfb
commit 89bdd103e5
1 changed files with 4 additions and 0 deletions

View File

@ -526,6 +526,10 @@ void MCJIT::NotifyFreeingObject(const ObjectImage& Obj) {
uint64_t LinkingMemoryManager::getSymbolAddress(const std::string &Name) {
uint64_t Result = ParentEngine->getSymbolAddress(Name, false);
// If the symbols wasn't found and it begins with an underscore, try again
// without the underscore.
if (!Result && Name[0] == '_')
Result = ParentEngine->getSymbolAddress(Name.substr(1), false);
if (Result)
return Result;
return ClientMM->getSymbolAddress(Name);