Deleted Added
sdiff udiff text old ( 280031 ) new ( 283526 )
full compact
1//===-- RuntimeDyldMachO.cpp - Run-time dynamic linker for MC-JIT -*- C++ -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 163 unchanged lines hidden (view full) ---

172 }
173}
174
175bool RuntimeDyldMachO::isCompatibleFile(const object::ObjectFile &Obj) const {
176 return Obj.isMachO();
177}
178
179template <typename Impl>
180void RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &ObjImg,
181 ObjSectionToIDMap &SectionMap) {
182 unsigned EHFrameSID = RTDYLD_INVALID_SECTION_ID;
183 unsigned TextSID = RTDYLD_INVALID_SECTION_ID;
184 unsigned ExceptTabSID = RTDYLD_INVALID_SECTION_ID;
185 ObjSectionToIDMap::iterator i, e;
186
187 for (i = SectionMap.begin(), e = SectionMap.end(); i != e; ++i) {
188 const SectionRef &Section = i->first;
189 StringRef Name;
190 Section.getName(Name);
191 if (Name == "__eh_frame")
192 EHFrameSID = i->second;
193 else if (Name == "__text")
194 TextSID = i->second;
195 else if (Name == "__gcc_except_tab")
196 ExceptTabSID = i->second;
197 else
198 impl().finalizeSection(ObjImg, i->second, Section);
199 }
200 UnregisteredEHFrameSections.push_back(
201 EHFrameRelatedSections(EHFrameSID, TextSID, ExceptTabSID));
202}
203
204template <typename Impl>
205unsigned char *RuntimeDyldMachOCRTPBase<Impl>::processFDE(unsigned char *P,
206 int64_t DeltaForText,

--- 26 unchanged lines hidden (view full) ---

233 TargetPtrT NewLSDA = LSDA - DeltaForEH;
234 writeBytesUnaligned(NewLSDA, P, sizeof(TargetPtrT));
235 }
236
237 return Ret;
238}
239
240static int64_t computeDelta(SectionEntry *A, SectionEntry *B) {
241 int64_t ObjDistance = A->ObjAddress - B->ObjAddress;
242 int64_t MemDistance = A->LoadAddress - B->LoadAddress;
243 return ObjDistance - MemDistance;
244}
245
246template <typename Impl>
247void RuntimeDyldMachOCRTPBase<Impl>::registerEHFrames() {
248
249 if (!MemMgr)

--- 51 unchanged lines hidden ---