diff options
author | Lang Hames <lhames@gmail.com> | 2015-04-15 21:18:41 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-04-15 21:18:41 +0000 |
commit | c3246ad45cdd148b93fca2cf7192061c2848cc51 (patch) | |
tree | d9fd1ffaab22e46adac20c1cd5c20bea0f50457f /llvm/tools/llvm-rtdyld | |
parent | fe88b48632ab69708061091897e9f0e4a6ac9c1f (diff) | |
download | bcm5719-llvm-c3246ad45cdd148b93fca2cf7192061c2848cc51.tar.gz bcm5719-llvm-c3246ad45cdd148b93fca2cf7192061c2848cc51.zip |
[RuntimeDyld] Work around a bug in RuntimeDyldELF exposed by r234839.
Hopefully this will fix the failures on the windows builders that started with
r234839.
llvm-svn: 235043
Diffstat (limited to 'llvm/tools/llvm-rtdyld')
-rw-r--r-- | llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index 244ed272569..480032d3b6f 100644 --- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -267,6 +267,11 @@ static int executeInput() { TrivialMemoryManager MemMgr; RuntimeDyld Dyld(MemMgr, MemMgr); + // FIXME: Preserve buffers until resolveRelocations time to work around a bug + // in RuntimeDyldELF. + // This fixme should be fixed ASAP. This is a very brittle workaround. + std::vector<std::unique_ptr<MemoryBuffer>> InputBuffers; + // If we don't have any input files, read from stdin. if (!InputFileList.size()) InputFileList.push_back("-"); @@ -283,6 +288,7 @@ static int executeInput() { return Error("unable to create object file: '" + EC.message() + "'"); ObjectFile &Obj = **MaybeObj; + InputBuffers.push_back(std::move(*InputBuffer)); // Load the object file Dyld.loadObject(Obj); @@ -519,6 +525,11 @@ static int linkAndVerify() { RuntimeDyldChecker Checker(Dyld, Disassembler.get(), InstPrinter.get(), llvm::dbgs()); + // FIXME: Preserve buffers until resolveRelocations time to work around a bug + // in RuntimeDyldELF. + // This fixme should be fixed ASAP. This is a very brittle workaround. + std::vector<std::unique_ptr<MemoryBuffer>> InputBuffers; + // If we don't have any input files, read from stdin. if (!InputFileList.size()) InputFileList.push_back("-"); @@ -537,6 +548,7 @@ static int linkAndVerify() { return Error("unable to create object file: '" + EC.message() + "'"); ObjectFile &Obj = **MaybeObj; + InputBuffers.push_back(std::move(*InputBuffer)); // Load the object file Dyld.loadObject(Obj); |