Could someone send me a binary that doesn't get recognized? I implemented the .note-ABI-tag code to figure out the OS/Arch when it wasn't set on the binary and that section in the file should still exist. I want to figure out what is going on there.
Thanks, Ali On Nov 20, 2008, at 10:48 PM, Steve Reinhardt wrote: > changeset db1653549204 in /z/repo/m5 > details: http://repo.m5sim.org/m5?cmd=changeset;node=db1653549204 > description: > Assume files w/o obvious OS are Linux (with warning) > instead of giving a fatal error. > > diffstat: > > 1 file changed, 3 insertions(+) > src/sim/process.cc | 3 +++ > > diffs (85 lines): > > diff -r 32ec0a0e41b2 -r db1653549204 src/sim/process.cc > --- a/src/sim/process.cc Mon Nov 17 12:41:50 2008 -0800 > +++ b/src/sim/process.cc Thu Nov 20 19:08:46 2008 -0800 > @@ -655,18 +655,22 @@ > "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 @@ > 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 @@ > case ObjectFile::Solaris: > process = new SparcSolarisProcess(params, objFile); > break; > + > default: > fatal("Unknown/unsupported operating system."); > } > @@ -697,9 +706,13 @@ > 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 @@ > 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 @@ > 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; > _______________________________________________ > m5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/m5-dev > _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
