summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2008-11-20 19:08:46 -0800
committerSteve Reinhardt <steve.reinhardt@amd.com>2008-11-20 19:08:46 -0800
commit041ca19edc7ebd905b3fe3e1b731c0b19a146896 (patch)
treeabbda4312d09593485daa5c4792e29becde21a13 /src
parentce4c9a7c10f9a2f91736592f32dcfeb317f17820 (diff)
downloadgem5-041ca19edc7ebd905b3fe3e1b731c0b19a146896.tar.xz
Assume files w/o obvious OS are Linux (with warning)
instead of giving a fatal error.
Diffstat (limited to 'src')
-rw-r--r--src/sim/process.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc
index 50bc5e034..dab374d84 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -655,18 +655,22 @@ LiveProcess::create(LiveProcessParams * params)
"executable as a static binary and try again.\n");
#if THE_ISA == ALPHA_ISA
+ if (objFile->getArch() != ObjectFile::Alpha)
+ fatal("Object file architecture does not match compiled ISA (Alpha).");
+
if (objFile->hasTLS())
fatal("Object file has a TLS section and single threaded TLS is not\n"
" currently supported for Alpha! Please recompile your "
"executable with \n a non-TLS toolchain.\n");
- if (objFile->getArch() != ObjectFile::Alpha)
- fatal("Object file architecture does not match compiled ISA (Alpha).");
switch (objFile->getOpSys()) {
case ObjectFile::Tru64:
process = new AlphaTru64Process(params, objFile);
break;
+ case ObjectFile::UnknownOpSys:
+ warn("Unknown operating system; assuming Linux.");
+ // fall through
case ObjectFile::Linux:
process = new AlphaLinuxProcess(params, objFile);
break;
@@ -675,9 +679,13 @@ LiveProcess::create(LiveProcessParams * params)
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == SPARC_ISA
- if (objFile->getArch() != ObjectFile::SPARC64 && objFile->getArch() != ObjectFile::SPARC32)
+ if (objFile->getArch() != ObjectFile::SPARC64 &&
+ objFile->getArch() != ObjectFile::SPARC32)
fatal("Object file architecture does not match compiled ISA (SPARC).");
switch (objFile->getOpSys()) {
+ case ObjectFile::UnknownOpSys:
+ warn("Unknown operating system; assuming Linux.");
+ // fall through
case ObjectFile::Linux:
if (objFile->getArch() == ObjectFile::SPARC64) {
process = new Sparc64LinuxProcess(params, objFile);
@@ -690,6 +698,7 @@ LiveProcess::create(LiveProcessParams * params)
case ObjectFile::Solaris:
process = new SparcSolarisProcess(params, objFile);
break;
+
default:
fatal("Unknown/unsupported operating system.");
}
@@ -697,9 +706,13 @@ LiveProcess::create(LiveProcessParams * params)
if (objFile->getArch() != ObjectFile::X86)
fatal("Object file architecture does not match compiled ISA (x86).");
switch (objFile->getOpSys()) {
+ case ObjectFile::UnknownOpSys:
+ warn("Unknown operating system; assuming Linux.");
+ // fall through
case ObjectFile::Linux:
process = new X86LinuxProcess(params, objFile);
break;
+
default:
fatal("Unknown/unsupported operating system.");
}
@@ -707,6 +720,9 @@ LiveProcess::create(LiveProcessParams * params)
if (objFile->getArch() != ObjectFile::Mips)
fatal("Object file architecture does not match compiled ISA (MIPS).");
switch (objFile->getOpSys()) {
+ case ObjectFile::UnknownOpSys:
+ warn("Unknown operating system; assuming Linux.");
+ // fall through
case ObjectFile::Linux:
process = new MipsLinuxProcess(params, objFile);
break;
@@ -718,6 +734,9 @@ LiveProcess::create(LiveProcessParams * params)
if (objFile->getArch() != ObjectFile::Arm)
fatal("Object file architecture does not match compiled ISA (ARM).");
switch (objFile->getOpSys()) {
+ case ObjectFile::UnknownOpSys:
+ warn("Unknown operating system; assuming Linux.");
+ // fall through
case ObjectFile::Linux:
process = new ArmLinuxProcess(params, objFile);
break;