mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Handle weak_extern in the JIT. This fixes
SingleSource/UnitTests/2007-04-25-weak.c in JIT mode. The test now passes on systems which are able to produce a correct reference output to compare with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -509,16 +509,17 @@ void *JIT::getPointerToFunction(Function *F) {
|
||||
<< "' from bitcode file: " << ErrorMsg << "\n";
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
if (void *Addr = getPointerToGlobalIfAvailable(F)) {
|
||||
return Addr;
|
||||
// Now retry to get the address.
|
||||
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
||||
return Addr;
|
||||
}
|
||||
|
||||
MutexGuard locked(lock);
|
||||
|
||||
if (F->isDeclaration()) {
|
||||
void *Addr = getPointerToNamedFunction(F->getName());
|
||||
bool AbortOnFailure = F->getLinkage() != GlobalValue::ExternalWeakLinkage;
|
||||
void *Addr = getPointerToNamedFunction(F->getName(), AbortOnFailure);
|
||||
addGlobalMapping(F, Addr);
|
||||
return Addr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user