void RuntimeDyldImpl::mapSectionAddress(void *LocalAddress, uint64_t TargetAddress) { assert(SectionLocalMemToID.count(LocalAddress) && "Attempting to remap address of unknown section!"); unsigned SectionID = SectionLocalMemToID[LocalAddress]; reassignSectionAddress(SectionID, TargetAddress); }
// Resolve the relocations for all symbols we currently know about. void RuntimeDyldImpl::resolveRelocations() { // Just iterate over the sections we have and resolve all the relocations // in them. Gross overkill, but it gets the job done. for (int i = 0, e = Sections.size(); i != e; ++i) { reassignSectionAddress(i, SectionLoadAddress[i]); } }
void RuntimeDyldImpl::mapSectionAddress(void *LocalAddress, uint64_t TargetAddress) { for (unsigned i = 0, e = Sections.size(); i != e; ++i) { if (Sections[i].Address == LocalAddress) { reassignSectionAddress(i, TargetAddress); return; } } llvm_unreachable("Attempting to remap address of unknown section!"); }
// Resolve the relocations for all symbols we currently know about. void RuntimeDyldImpl::resolveRelocations() { // First, resolve relocations associated with external symbols. resolveSymbols(); // Just iterate over the sections we have and resolve all the relocations // in them. Gross overkill, but it gets the job done. for (int i = 0, e = Sections.size(); i != e; ++i) { reassignSectionAddress(i, Sections[i].LoadAddress); } }