summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2013-12-07 04:25:19 +0000
committerLang Hames <lhames@gmail.com>2013-12-07 04:25:19 +0000
commit567befd88fd6e21ab9c02c5db51a753b9430dc68 (patch)
tree3db9b3f5c5daf9894e1cc5512baf6e31308b56f3 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parent2ce64a7d9e2dd1fa614680da69dafbe682687e13 (diff)
downloadbcm5719-llvm-567befd88fd6e21ab9c02c5db51a753b9430dc68.tar.gz
bcm5719-llvm-567befd88fd6e21ab9c02c5db51a753b9430dc68.zip
Revert r196639 while I investigate a bot failure.
llvm-svn: 196641
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 800a75ef7ed..161135a4f8c 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -82,24 +82,12 @@ ObjectImage *RuntimeDyldImpl::createObjectImage(ObjectBuffer *InputBuffer) {
return new ObjectImageCommon(InputBuffer);
}
-ObjectImage *RuntimeDyldImpl::createObjectImageFromFile(ObjectFile *InputObject) {
- return new ObjectImageCommon(InputObject);
-}
-
-ObjectImage *RuntimeDyldImpl::loadObject(ObjectFile *InputObject) {
- return loadObject(createObjectImageFromFile(InputObject));
-}
-
ObjectImage *RuntimeDyldImpl::loadObject(ObjectBuffer *InputBuffer) {
- return loadObject(createObjectImage(InputBuffer));
-}
-
-ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
MutexGuard locked(lock);
- OwningPtr<ObjectImage> obj(InputObject);
+ OwningPtr<ObjectImage> obj(createObjectImage(InputBuffer));
if (!obj)
- return NULL;
+ report_fatal_error("Unable to create object image from memory buffer!");
// Save information about our target
Arch = (Triple::ArchType)obj->getArch();
@@ -151,7 +139,7 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
if (si == obj->end_sections()) continue;
Check(si->getContents(SectionData));
Check(si->isText(IsCode));
- const uint8_t* SymPtr = (const uint8_t*)InputObject->getData().data() +
+ const uint8_t* SymPtr = (const uint8_t*)InputBuffer->getBufferStart() +
(uintptr_t)FileOffset;
uintptr_t SectOffset = (uintptr_t)(SymPtr -
(const uint8_t*)SectionData.begin());
@@ -575,22 +563,6 @@ RuntimeDyld::~RuntimeDyld() {
delete Dyld;
}
-ObjectImage *RuntimeDyld::loadObject(ObjectFile *InputObject) {
- if (!Dyld) {
- if (InputObject->isELF())
- Dyld = new RuntimeDyldELF(MM);
- else if (InputObject->isMachO())
- Dyld = new RuntimeDyldMachO(MM);
- else
- report_fatal_error("Incompatible object format!");
- } else {
- if (!Dyld->isCompatibleFile(InputObject))
- report_fatal_error("Incompatible object format!");
- }
-
- return Dyld->loadObject(InputObject);
-}
-
ObjectImage *RuntimeDyld::loadObject(ObjectBuffer *InputBuffer) {
if (!Dyld) {
sys::fs::file_magic Type =
OpenPOWER on IntegriCloud