blob: 1b1840ae06618a5863ff098c3e54eb7175061fe1 [file] [log] [blame]
Jim Grosbache0934be2012-01-16 23:50:58 +00001//===-- RuntimeDyld.cpp - Run-time dynamic linker for MC-JIT ----*- C++ -*-===//
Jim Grosbach6e563312011-03-21 22:15:52 +00002//
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//===----------------------------------------------------------------------===//
9//
10// Implementation of the MC-JIT runtime dynamic linker.
11//
12//===----------------------------------------------------------------------===//
13
Jim Grosbach8b54dca2011-03-23 19:52:00 +000014#define DEBUG_TYPE "dyld"
Danil Malyshevcf852dc2011-07-13 07:57:58 +000015#include "RuntimeDyldImpl.h"
Eli Bendersky76463fd2012-01-22 07:05:02 +000016#include "RuntimeDyldELF.h"
17#include "RuntimeDyldMachO.h"
Eli Benderskya66a1852012-01-16 08:56:09 +000018#include "llvm/Support/Path.h"
Eli Bendersky76463fd2012-01-22 07:05:02 +000019
Jim Grosbach6e563312011-03-21 22:15:52 +000020using namespace llvm;
21using namespace llvm::object;
22
Chandler Carruth53c5e7b2011-04-05 23:54:31 +000023// Empty out-of-line virtual destructor as the key function.
24RTDyldMemoryManager::~RTDyldMemoryManager() {}
Danil Malyshevcf852dc2011-07-13 07:57:58 +000025RuntimeDyldImpl::~RuntimeDyldImpl() {}
Chandler Carruth53c5e7b2011-04-05 23:54:31 +000026
Jim Grosbach6e563312011-03-21 22:15:52 +000027namespace llvm {
Jim Grosbach6e563312011-03-21 22:15:52 +000028
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000029namespace {
30 // Helper for extensive error checking in debug builds.
31 error_code Check(error_code Err) {
32 if (Err) {
33 report_fatal_error(Err.message());
34 }
35 return Err;
36 }
37} // end anonymous namespace
Jim Grosbach61425c02012-01-16 22:26:39 +000038
Jim Grosbachf8c1c842011-04-12 21:20:41 +000039// Resolve the relocations for all symbols we currently know about.
40void RuntimeDyldImpl::resolveRelocations() {
Preston Gurdc68dda82012-04-12 20:13:57 +000041 // First, resolve relocations associated with external symbols.
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000042 resolveSymbols();
43
Jim Grosbach61425c02012-01-16 22:26:39 +000044 // Just iterate over the sections we have and resolve all the relocations
45 // in them. Gross overkill, but it gets the job done.
46 for (int i = 0, e = Sections.size(); i != e; ++i) {
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000047 reassignSectionAddress(i, Sections[i].LoadAddress);
Jim Grosbach61425c02012-01-16 22:26:39 +000048 }
Jim Grosbachf8c1c842011-04-12 21:20:41 +000049}
50
Jim Grosbach020f4e82012-01-16 23:50:55 +000051void RuntimeDyldImpl::mapSectionAddress(void *LocalAddress,
52 uint64_t TargetAddress) {
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000053 for (unsigned i = 0, e = Sections.size(); i != e; ++i) {
54 if (Sections[i].Address == LocalAddress) {
55 reassignSectionAddress(i, TargetAddress);
56 return;
57 }
58 }
59 llvm_unreachable("Attempting to remap address of unknown section!");
Jim Grosbach020f4e82012-01-16 23:50:55 +000060}
61
Preston Gurd689ff9c2012-04-16 22:12:58 +000062// Subclasses can implement this method to create specialized image instances
63// The caller owns the the pointer that is returned.
64ObjectImage *RuntimeDyldImpl::createObjectImage(const MemoryBuffer *InputBuffer) {
65 ObjectFile *ObjFile = ObjectFile::createObjectFile(const_cast<MemoryBuffer*>
66 (InputBuffer));
67 ObjectImage *Obj = new ObjectImage(ObjFile);
68 return Obj;
69}
70
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000071bool RuntimeDyldImpl::loadObject(const MemoryBuffer *InputBuffer) {
Preston Gurd689ff9c2012-04-16 22:12:58 +000072 OwningPtr<ObjectImage> obj(createObjectImage(InputBuffer));
Preston Gurdc68dda82012-04-12 20:13:57 +000073 if (!obj)
74 report_fatal_error("Unable to create object image from memory buffer!");
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000075
76 Arch = (Triple::ArchType)obj->getArch();
77
78 LocalSymbolMap LocalSymbols; // Functions and data symbols from the
79 // object file.
80 ObjSectionToIDMap LocalSections; // Used sections from the object file
Preston Gurdc68dda82012-04-12 20:13:57 +000081 CommonSymbolMap CommonSymbols; // Common symbols requiring allocation
82 uint64_t CommonSize = 0;
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +000083
84 error_code err;
85 // Parse symbols
86 DEBUG(dbgs() << "Parse symbols:\n");
87 for (symbol_iterator i = obj->begin_symbols(), e = obj->end_symbols();
88 i != e; i.increment(err)) {
89 Check(err);
90 object::SymbolRef::Type SymType;
91 StringRef Name;
92 Check(i->getType(SymType));
93 Check(i->getName(Name));
94
Preston Gurdc68dda82012-04-12 20:13:57 +000095 uint32_t flags;
96 Check(i->getFlags(flags));
97
98 bool isCommon = flags & SymbolRef::SF_Common;
99 if (isCommon) {
100 // Add the common symbols to a list. We'll allocate them all below.
101 uint64_t Size = 0;
102 Check(i->getSize(Size));
103 CommonSize += Size;
104 CommonSymbols[*i] = Size;
105 } else {
106 if (SymType == object::SymbolRef::ST_Function ||
107 SymType == object::SymbolRef::ST_Data) {
108 uint64_t FileOffset;
109 StringRef sData;
110 section_iterator si = obj->end_sections();
111 Check(i->getFileOffset(FileOffset));
112 Check(i->getSection(si));
113 if (si == obj->end_sections()) continue;
114 Check(si->getContents(sData));
115 const uint8_t* SymPtr = (const uint8_t*)InputBuffer->getBufferStart() +
116 (uintptr_t)FileOffset;
117 uintptr_t SectOffset = (uintptr_t)(SymPtr - (const uint8_t*)sData.begin());
118 unsigned SectionID =
Preston Gurd689ff9c2012-04-16 22:12:58 +0000119 findOrEmitSection(*obj,
120 *si,
Preston Gurdc68dda82012-04-12 20:13:57 +0000121 SymType == object::SymbolRef::ST_Function,
122 LocalSections);
123 bool isGlobal = flags & SymbolRef::SF_Global;
124 LocalSymbols[Name.data()] = SymbolLoc(SectionID, SectOffset);
125 DEBUG(dbgs() << "\tFileOffset: " << format("%p", (uintptr_t)FileOffset)
126 << " flags: " << flags
127 << " SID: " << SectionID
128 << " Offset: " << format("%p", SectOffset));
129 if (isGlobal)
130 SymbolTable[Name] = SymbolLoc(SectionID, SectOffset);
131 }
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000132 }
133 DEBUG(dbgs() << "\tType: " << SymType << " Name: " << Name << "\n");
134 }
135
Preston Gurdc68dda82012-04-12 20:13:57 +0000136 // Allocate common symbols
137 if (CommonSize != 0)
Preston Gurd689ff9c2012-04-16 22:12:58 +0000138 emitCommonSymbols(*obj, CommonSymbols, CommonSize, LocalSymbols);
Preston Gurdc68dda82012-04-12 20:13:57 +0000139
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000140 // Parse and proccess relocations
141 DEBUG(dbgs() << "Parse relocations:\n");
142 for (section_iterator si = obj->begin_sections(),
143 se = obj->end_sections(); si != se; si.increment(err)) {
144 Check(err);
145 bool isFirstRelocation = true;
146 unsigned SectionID = 0;
147 StubMap Stubs;
148
149 for (relocation_iterator i = si->begin_relocations(),
150 e = si->end_relocations(); i != e; i.increment(err)) {
151 Check(err);
152
153 // If it's first relocation in this section, find its SectionID
154 if (isFirstRelocation) {
Preston Gurd689ff9c2012-04-16 22:12:58 +0000155 SectionID = findOrEmitSection(*obj, *si, true, LocalSections);
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000156 DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
157 isFirstRelocation = false;
158 }
159
160 ObjRelocationInfo RI;
161 RI.SectionID = SectionID;
162 Check(i->getAdditionalInfo(RI.AdditionalInfo));
163 Check(i->getOffset(RI.Offset));
164 Check(i->getSymbol(RI.Symbol));
165 Check(i->getType(RI.Type));
166
167 DEBUG(dbgs() << "\t\tAddend: " << RI.AdditionalInfo
168 << " Offset: " << format("%p", (uintptr_t)RI.Offset)
169 << " Type: " << (uint32_t)(RI.Type & 0xffffffffL)
170 << "\n");
171 processRelocationRef(RI, *obj, LocalSections, LocalSymbols, Stubs);
172 }
173 }
Preston Gurd689ff9c2012-04-16 22:12:58 +0000174
175 handleObjectLoaded(obj.take());
176
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000177 return false;
178}
179
Preston Gurd689ff9c2012-04-16 22:12:58 +0000180unsigned RuntimeDyldImpl::emitCommonSymbols(ObjectImage &Obj,
181 const CommonSymbolMap &Map,
Preston Gurdc68dda82012-04-12 20:13:57 +0000182 uint64_t TotalSize,
183 LocalSymbolMap &LocalSymbols) {
184 // Allocate memory for the section
185 unsigned SectionID = Sections.size();
186 uint8_t *Addr = MemMgr->allocateDataSection(TotalSize, sizeof(void*),
187 SectionID);
188 if (!Addr)
189 report_fatal_error("Unable to allocate memory for common symbols!");
190 uint64_t Offset = 0;
191 Sections.push_back(SectionEntry(Addr, TotalSize, TotalSize, 0));
192 memset(Addr, 0, TotalSize);
193
194 DEBUG(dbgs() << "emitCommonSection SectionID: " << SectionID
195 << " new addr: " << format("%p", Addr)
196 << " DataSize: " << TotalSize
197 << "\n");
198
199 // Assign the address of each symbol
200 for (CommonSymbolMap::const_iterator it = Map.begin(), itEnd = Map.end();
201 it != itEnd; it++) {
202 uint64_t Size = it->second;
203 StringRef Name;
204 it->first.getName(Name);
Preston Gurd689ff9c2012-04-16 22:12:58 +0000205 Obj.updateSymbolAddress(it->first, (uint64_t)Addr);
Preston Gurdc68dda82012-04-12 20:13:57 +0000206 LocalSymbols[Name.data()] = SymbolLoc(SectionID, Offset);
207 Offset += Size;
208 Addr += Size;
209 }
210
211 return SectionID;
212}
213
Preston Gurd689ff9c2012-04-16 22:12:58 +0000214unsigned RuntimeDyldImpl::emitSection(ObjectImage &Obj,
215 const SectionRef &Section,
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000216 bool IsCode) {
217
218 unsigned StubBufSize = 0,
219 StubSize = getMaxStubSize();
220 error_code err;
221 if (StubSize > 0) {
222 for (relocation_iterator i = Section.begin_relocations(),
Preston Gurdc68dda82012-04-12 20:13:57 +0000223 e = Section.end_relocations(); i != e; i.increment(err), Check(err))
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000224 StubBufSize += StubSize;
225 }
226 StringRef data;
227 uint64_t Alignment64;
228 Check(Section.getContents(data));
229 Check(Section.getAlignment(Alignment64));
230
231 unsigned Alignment = (unsigned)Alignment64 & 0xffffffffL;
Preston Gurdc68dda82012-04-12 20:13:57 +0000232 bool IsRequired;
233 bool IsVirtual;
234 bool IsZeroInit;
235 uint64_t DataSize;
236 Check(Section.isRequiredForExecution(IsRequired));
237 Check(Section.isVirtual(IsVirtual));
238 Check(Section.isZeroInit(IsZeroInit));
239 Check(Section.getSize(DataSize));
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000240
Preston Gurdc68dda82012-04-12 20:13:57 +0000241 unsigned Allocate;
242 unsigned SectionID = Sections.size();
243 uint8_t *Addr;
244 const char *pData = 0;
245
246 // Some sections, such as debug info, don't need to be loaded for execution.
247 // Leave those where they are.
248 if (IsRequired) {
249 Allocate = DataSize + StubBufSize;
250 Addr = IsCode
251 ? MemMgr->allocateCodeSection(Allocate, Alignment, SectionID)
252 : MemMgr->allocateDataSection(Allocate, Alignment, SectionID);
253 if (!Addr)
254 report_fatal_error("Unable to allocate section memory!");
255
256 // Virtual sections have no data in the object image, so leave pData = 0
257 if (!IsVirtual)
258 pData = data.data();
259
260 // Zero-initialize or copy the data from the image
261 if (IsZeroInit || IsVirtual)
262 memset(Addr, 0, DataSize);
263 else
264 memcpy(Addr, pData, DataSize);
265
266 DEBUG(dbgs() << "emitSection SectionID: " << SectionID
267 << " obj addr: " << format("%p", pData)
268 << " new addr: " << format("%p", Addr)
269 << " DataSize: " << DataSize
270 << " StubBufSize: " << StubBufSize
271 << " Allocate: " << Allocate
272 << "\n");
Preston Gurd689ff9c2012-04-16 22:12:58 +0000273 Obj.updateSectionAddress(Section, (uint64_t)Addr);
Preston Gurdc68dda82012-04-12 20:13:57 +0000274 }
275 else {
276 // Even if we didn't load the section, we need to record an entry for it
277 // to handle later processing (and by 'handle' I mean don't do anything
278 // with these sections).
279 Allocate = 0;
280 Addr = 0;
281 DEBUG(dbgs() << "emitSection SectionID: " << SectionID
282 << " obj addr: " << format("%p", data.data())
283 << " new addr: 0"
284 << " DataSize: " << DataSize
285 << " StubBufSize: " << StubBufSize
286 << " Allocate: " << Allocate
287 << "\n");
288 }
289
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000290 Sections.push_back(SectionEntry(Addr, Allocate, DataSize,(uintptr_t)pData));
291 return SectionID;
292}
293
Preston Gurd689ff9c2012-04-16 22:12:58 +0000294unsigned RuntimeDyldImpl::findOrEmitSection(ObjectImage &Obj,
295 const SectionRef &Section,
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000296 bool IsCode,
297 ObjSectionToIDMap &LocalSections) {
298
299 unsigned SectionID = 0;
300 ObjSectionToIDMap::iterator i = LocalSections.find(Section);
301 if (i != LocalSections.end())
302 SectionID = i->second;
303 else {
Preston Gurd689ff9c2012-04-16 22:12:58 +0000304 SectionID = emitSection(Obj, Section, IsCode);
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000305 LocalSections[Section] = SectionID;
306 }
307 return SectionID;
308}
309
310void RuntimeDyldImpl::AddRelocation(const RelocationValueRef &Value,
311 unsigned SectionID, uintptr_t Offset,
312 uint32_t RelType) {
313 DEBUG(dbgs() << "AddRelocation SymNamePtr: " << format("%p", Value.SymbolName)
314 << " SID: " << Value.SectionID
315 << " Addend: " << format("%p", Value.Addend)
316 << " Offset: " << format("%p", Offset)
317 << " RelType: " << format("%x", RelType)
318 << "\n");
319
320 if (Value.SymbolName == 0) {
321 Relocations[Value.SectionID].push_back(RelocationEntry(
322 SectionID,
323 Offset,
324 RelType,
325 Value.Addend));
326 } else
327 SymbolRelocations[Value.SymbolName].push_back(RelocationEntry(
328 SectionID,
329 Offset,
330 RelType,
331 Value.Addend));
332}
333
334uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr) {
335 // TODO: There is only ARM far stub now. We should add the Thumb stub,
336 // and stubs for branches Thumb - ARM and ARM - Thumb.
337 if (Arch == Triple::arm) {
338 uint32_t *StubAddr = (uint32_t*)Addr;
339 *StubAddr = 0xe51ff004; // ldr pc,<label>
340 return (uint8_t*)++StubAddr;
341 }
342 else
343 return Addr;
344}
345
346// Assign an address to a symbol name and resolve all the relocations
347// associated with it.
348void RuntimeDyldImpl::reassignSectionAddress(unsigned SectionID,
349 uint64_t Addr) {
350 // The address to use for relocation resolution is not
351 // the address of the local section buffer. We must be doing
352 // a remote execution environment of some sort. Re-apply any
353 // relocations referencing this section with the given address.
354 //
355 // Addr is a uint64_t because we can't assume the pointer width
356 // of the target is the same as that of the host. Just use a generic
357 // "big enough" type.
358 Sections[SectionID].LoadAddress = Addr;
359 DEBUG(dbgs() << "Resolving relocations Section #" << SectionID
360 << "\t" << format("%p", (uint8_t *)Addr)
361 << "\n");
362 resolveRelocationList(Relocations[SectionID], Addr);
363}
364
365void RuntimeDyldImpl::resolveRelocationEntry(const RelocationEntry &RE,
366 uint64_t Value) {
Preston Gurdc68dda82012-04-12 20:13:57 +0000367 // Ignore relocations for sections that were not loaded
368 if (Sections[RE.SectionID].Address != 0) {
369 uint8_t *Target = Sections[RE.SectionID].Address + RE.Offset;
370 DEBUG(dbgs() << "\tSectionID: " << RE.SectionID
371 << " + " << RE.Offset << " (" << format("%p", Target) << ")"
372 << " Data: " << RE.Data
373 << " Addend: " << RE.Addend
374 << "\n");
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000375
Preston Gurdc68dda82012-04-12 20:13:57 +0000376 resolveRelocation(Target, Sections[RE.SectionID].LoadAddress + RE.Offset,
377 Value, RE.Data, RE.Addend);
378 }
Danil Malyshev0e4fa5f2012-03-30 16:45:19 +0000379}
380
381void RuntimeDyldImpl::resolveRelocationList(const RelocationList &Relocs,
382 uint64_t Value) {
383 for (unsigned i = 0, e = Relocs.size(); i != e; ++i) {
384 resolveRelocationEntry(Relocs[i], Value);
385 }
386}
387
388// resolveSymbols - Resolve any relocations to the specified symbols if
389// we know where it lives.
390void RuntimeDyldImpl::resolveSymbols() {
391 StringMap<RelocationList>::iterator i = SymbolRelocations.begin(),
392 e = SymbolRelocations.end();
393 for (; i != e; i++) {
394 StringRef Name = i->first();
395 RelocationList &Relocs = i->second;
396 StringMap<SymbolLoc>::const_iterator Loc = SymbolTable.find(Name);
397 if (Loc == SymbolTable.end()) {
398 // This is an external symbol, try to get it address from
399 // MemoryManager.
400 uint8_t *Addr = (uint8_t*) MemMgr->getPointerToNamedFunction(Name.data(),
401 true);
402 DEBUG(dbgs() << "Resolving relocations Name: " << Name
403 << "\t" << format("%p", Addr)
404 << "\n");
405 resolveRelocationList(Relocs, (uintptr_t)Addr);
406 } else {
407 // Change the relocation to be section relative rather than symbol
408 // relative and move it to the resolved relocation list.
409 DEBUG(dbgs() << "Resolving symbol '" << Name << "'\n");
410 for (int i = 0, e = Relocs.size(); i != e; ++i) {
411 RelocationEntry Entry = Relocs[i];
412 Entry.Addend += Loc->second.second;
413 Relocations[Loc->second.first].push_back(Entry);
414 }
415 Relocs.clear();
416 }
417 }
418}
419
420
Jim Grosbach6e563312011-03-21 22:15:52 +0000421//===----------------------------------------------------------------------===//
422// RuntimeDyld class implementation
Danil Malyshevcf852dc2011-07-13 07:57:58 +0000423RuntimeDyld::RuntimeDyld(RTDyldMemoryManager *mm) {
424 Dyld = 0;
425 MM = mm;
Jim Grosbach6e563312011-03-21 22:15:52 +0000426}
427
428RuntimeDyld::~RuntimeDyld() {
429 delete Dyld;
430}
431
432bool RuntimeDyld::loadObject(MemoryBuffer *InputBuffer) {
Danil Malyshevcf852dc2011-07-13 07:57:58 +0000433 if (!Dyld) {
Eli Benderskya66a1852012-01-16 08:56:09 +0000434 sys::LLVMFileType type = sys::IdentifyFileType(
435 InputBuffer->getBufferStart(),
436 static_cast<unsigned>(InputBuffer->getBufferSize()));
437 switch (type) {
438 case sys::ELF_Relocatable_FileType:
439 case sys::ELF_Executable_FileType:
440 case sys::ELF_SharedObject_FileType:
441 case sys::ELF_Core_FileType:
442 Dyld = new RuntimeDyldELF(MM);
443 break;
444 case sys::Mach_O_Object_FileType:
445 case sys::Mach_O_Executable_FileType:
446 case sys::Mach_O_FixedVirtualMemorySharedLib_FileType:
447 case sys::Mach_O_Core_FileType:
448 case sys::Mach_O_PreloadExecutable_FileType:
449 case sys::Mach_O_DynamicallyLinkedSharedLib_FileType:
450 case sys::Mach_O_DynamicLinker_FileType:
451 case sys::Mach_O_Bundle_FileType:
452 case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType:
453 case sys::Mach_O_DSYMCompanion_FileType:
454 Dyld = new RuntimeDyldMachO(MM);
455 break;
456 case sys::Unknown_FileType:
457 case sys::Bitcode_FileType:
458 case sys::Archive_FileType:
459 case sys::COFF_FileType:
460 report_fatal_error("Incompatible object format!");
461 }
Danil Malyshevcf852dc2011-07-13 07:57:58 +0000462 } else {
Eli Benderskya66a1852012-01-16 08:56:09 +0000463 if (!Dyld->isCompatibleFormat(InputBuffer))
Danil Malyshevcf852dc2011-07-13 07:57:58 +0000464 report_fatal_error("Incompatible object format!");
465 }
466
Jim Grosbach6e563312011-03-21 22:15:52 +0000467 return Dyld->loadObject(InputBuffer);
468}
469
Jim Grosbachb0271052011-04-08 17:31:24 +0000470void *RuntimeDyld::getSymbolAddress(StringRef Name) {
Jim Grosbach6e563312011-03-21 22:15:52 +0000471 return Dyld->getSymbolAddress(Name);
472}
473
Jim Grosbachf8c1c842011-04-12 21:20:41 +0000474void RuntimeDyld::resolveRelocations() {
475 Dyld->resolveRelocations();
476}
477
Jim Grosbach61425c02012-01-16 22:26:39 +0000478void RuntimeDyld::reassignSectionAddress(unsigned SectionID,
479 uint64_t Addr) {
480 Dyld->reassignSectionAddress(SectionID, Addr);
Jim Grosbachf8c1c842011-04-12 21:20:41 +0000481}
482
Jim Grosbach020f4e82012-01-16 23:50:55 +0000483void RuntimeDyld::mapSectionAddress(void *LocalAddress,
484 uint64_t TargetAddress) {
485 Dyld->mapSectionAddress(LocalAddress, TargetAddress);
486}
487
Jim Grosbach91dde152011-03-22 18:22:27 +0000488StringRef RuntimeDyld::getErrorString() {
Jim Grosbachb3eecaf2011-03-22 18:19:42 +0000489 return Dyld->getErrorString();
490}
491
Jim Grosbach6e563312011-03-21 22:15:52 +0000492} // end namespace llvm