mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.
Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT clients to skip relocations for selected external symbols by returning ~0ULL from their symbol resolver. If this value is returned for a given symbol, RuntimeDyld will skip all relocations for that symbol. The client will be responsible for applying the skipped relocations manually before the code is executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -815,12 +815,16 @@ void RuntimeDyldImpl::resolveExternalSymbols() {
|
||||
report_fatal_error("Program used external function '" + Name +
|
||||
"' which could not be resolved!");
|
||||
|
||||
DEBUG(dbgs() << "Resolving relocations Name: " << Name << "\t"
|
||||
<< format("0x%lx", Addr) << "\n");
|
||||
// This list may have been updated when we called getSymbolAddress, so
|
||||
// don't change this code to get the list earlier.
|
||||
RelocationList &Relocs = i->second;
|
||||
resolveRelocationList(Relocs, Addr);
|
||||
// If Resolver returned UINT64_MAX, the client wants to handle this symbol
|
||||
// manually and we shouldn't resolve its relocations.
|
||||
if (Addr != UINT64_MAX) {
|
||||
DEBUG(dbgs() << "Resolving relocations Name: " << Name << "\t"
|
||||
<< format("0x%lx", Addr) << "\n");
|
||||
// This list may have been updated when we called getSymbolAddress, so
|
||||
// don't change this code to get the list earlier.
|
||||
RelocationList &Relocs = i->second;
|
||||
resolveRelocationList(Relocs, Addr);
|
||||
}
|
||||
}
|
||||
|
||||
ExternalSymbolRelocations.erase(i);
|
||||
|
@@ -727,7 +727,9 @@ bool RuntimeDyldCheckerImpl::checkAllRulesInBuffer(StringRef RulePrefix,
|
||||
}
|
||||
|
||||
bool RuntimeDyldCheckerImpl::isSymbolValid(StringRef Symbol) const {
|
||||
return getRTDyld().getSymbolLocalAddress(Symbol) != nullptr;
|
||||
if (getRTDyld().getSymbolLocalAddress(Symbol))
|
||||
return true;
|
||||
return !!getRTDyld().Resolver.findSymbol(Symbol);
|
||||
}
|
||||
|
||||
uint64_t RuntimeDyldCheckerImpl::getSymbolLocalAddr(StringRef Symbol) const {
|
||||
|
Reference in New Issue
Block a user