mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
[RuntimeDyld] Work around a bug in RuntimeDyldELF exposed by r234839.
Hopefully this will fix the failures on the windows builders that started with r234839. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235043 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -267,6 +267,11 @@ static int executeInput() {
|
|||||||
TrivialMemoryManager MemMgr;
|
TrivialMemoryManager MemMgr;
|
||||||
RuntimeDyld Dyld(MemMgr, 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 we don't have any input files, read from stdin.
|
||||||
if (!InputFileList.size())
|
if (!InputFileList.size())
|
||||||
InputFileList.push_back("-");
|
InputFileList.push_back("-");
|
||||||
@@ -283,6 +288,7 @@ static int executeInput() {
|
|||||||
return Error("unable to create object file: '" + EC.message() + "'");
|
return Error("unable to create object file: '" + EC.message() + "'");
|
||||||
|
|
||||||
ObjectFile &Obj = **MaybeObj;
|
ObjectFile &Obj = **MaybeObj;
|
||||||
|
InputBuffers.push_back(std::move(*InputBuffer));
|
||||||
|
|
||||||
// Load the object file
|
// Load the object file
|
||||||
Dyld.loadObject(Obj);
|
Dyld.loadObject(Obj);
|
||||||
@@ -519,6 +525,11 @@ static int linkAndVerify() {
|
|||||||
RuntimeDyldChecker Checker(Dyld, Disassembler.get(), InstPrinter.get(),
|
RuntimeDyldChecker Checker(Dyld, Disassembler.get(), InstPrinter.get(),
|
||||||
llvm::dbgs());
|
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 we don't have any input files, read from stdin.
|
||||||
if (!InputFileList.size())
|
if (!InputFileList.size())
|
||||||
InputFileList.push_back("-");
|
InputFileList.push_back("-");
|
||||||
@@ -537,6 +548,7 @@ static int linkAndVerify() {
|
|||||||
return Error("unable to create object file: '" + EC.message() + "'");
|
return Error("unable to create object file: '" + EC.message() + "'");
|
||||||
|
|
||||||
ObjectFile &Obj = **MaybeObj;
|
ObjectFile &Obj = **MaybeObj;
|
||||||
|
InputBuffers.push_back(std::move(*InputBuffer));
|
||||||
|
|
||||||
// Load the object file
|
// Load the object file
|
||||||
Dyld.loadObject(Obj);
|
Dyld.loadObject(Obj);
|
||||||
|
Reference in New Issue
Block a user