this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix dylib loading regressions

+6 -4
+6 -4
src/dyld/MachOObject.cpp
··· 199 199 #endif 200 200 } 201 201 202 - if ((void*)seg->vmaddr < m_base && !isMainModule()) 202 + if ((void*)seg->vmaddr < m_base && !isMainModule() && !m_slide) 203 203 m_slide = uintptr_t(m_base) - seg->vmaddr; 204 204 205 205 mappingSize = pageAlign(seg->filesize); ··· 210 210 checkMappingAddr(mappingAddr); 211 211 212 212 if (MachOMgr::instance()->printSegments()) 213 - std::cerr << "dyld: Mapping segment " << seg->segname << " from " << m_file->filename() << " to " << mappingAddr << ", slide is " << m_slide << std::endl; 213 + std::cerr << "dyld: Mapping segment " << seg->segname << " from " << m_file->filename() << " to " << mappingAddr << ", slide is 0x" << std::hex << m_slide << std::dec << std::endl; 214 214 215 215 rv = ::mmap(mappingAddr, mappingSize, maxprot, MAP_FIXED | MAP_PRIVATE, m_file->fd(), m_file->offset() + seg->fileoff); 216 216 if (rv == MAP_FAILED) ··· 346 346 347 347 void MachOObject::writeBind(int type, void** ptr, void* newAddr, const std::string& name) 348 348 { 349 + assert(newAddr != nullptr); 349 350 if (MachOMgr::instance()->printBindings()) 350 351 std::cerr << "dyld: Binding " << name << " at " << ptr << ": " << (void*)(*ptr) << " -> " << (void*)newAddr << std::endl; 351 352 ··· 436 437 437 438 void* MachOObject::getExportedSymbol(const std::string& symbolName, bool nonWeakOnly) const 438 439 { 439 - auto it = m_exports.find(symbolName); 440 + auto it = m_exports.find("_"+symbolName); 440 441 441 442 if (it != m_exports.end()) 442 443 { ··· 677 678 addr = mgr->generate(addr, bind->name.c_str()+1); 678 679 } 679 680 680 - writeBind(bind->type, (void**)(bind->vmaddr + m_slide), addr, bind->name); 681 + //if (addr != nullptr) 682 + writeBind(bind->type, (void**)(bind->vmaddr + m_slide), addr, bind->name); 681 683 682 684 return addr; 683 685 }