process.cc (5713:993c7952b930) process.cc (5753:db1653549204)
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 641 unchanged lines hidden (view full) ---

650 }
651
652 if (objFile->isDynamic())
653 fatal("Object file is a dynamic executable however only static "
654 "executables are supported!\n Please recompile your "
655 "executable as a static binary and try again.\n");
656
657#if THE_ISA == ALPHA_ISA
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 641 unchanged lines hidden (view full) ---

650 }
651
652 if (objFile->isDynamic())
653 fatal("Object file is a dynamic executable however only static "
654 "executables are supported!\n Please recompile your "
655 "executable as a static binary and try again.\n");
656
657#if THE_ISA == ALPHA_ISA
658 if (objFile->getArch() != ObjectFile::Alpha)
659 fatal("Object file architecture does not match compiled ISA (Alpha).");
660
658 if (objFile->hasTLS())
659 fatal("Object file has a TLS section and single threaded TLS is not\n"
660 " currently supported for Alpha! Please recompile your "
661 "executable with \n a non-TLS toolchain.\n");
662
661 if (objFile->hasTLS())
662 fatal("Object file has a TLS section and single threaded TLS is not\n"
663 " currently supported for Alpha! Please recompile your "
664 "executable with \n a non-TLS toolchain.\n");
665
663 if (objFile->getArch() != ObjectFile::Alpha)
664 fatal("Object file architecture does not match compiled ISA (Alpha).");
665 switch (objFile->getOpSys()) {
666 case ObjectFile::Tru64:
667 process = new AlphaTru64Process(params, objFile);
668 break;
669
666 switch (objFile->getOpSys()) {
667 case ObjectFile::Tru64:
668 process = new AlphaTru64Process(params, objFile);
669 break;
670
671 case ObjectFile::UnknownOpSys:
672 warn("Unknown operating system; assuming Linux.");
673 // fall through
670 case ObjectFile::Linux:
671 process = new AlphaLinuxProcess(params, objFile);
672 break;
673
674 default:
675 fatal("Unknown/unsupported operating system.");
676 }
677#elif THE_ISA == SPARC_ISA
674 case ObjectFile::Linux:
675 process = new AlphaLinuxProcess(params, objFile);
676 break;
677
678 default:
679 fatal("Unknown/unsupported operating system.");
680 }
681#elif THE_ISA == SPARC_ISA
678 if (objFile->getArch() != ObjectFile::SPARC64 && objFile->getArch() != ObjectFile::SPARC32)
682 if (objFile->getArch() != ObjectFile::SPARC64 &&
683 objFile->getArch() != ObjectFile::SPARC32)
679 fatal("Object file architecture does not match compiled ISA (SPARC).");
680 switch (objFile->getOpSys()) {
684 fatal("Object file architecture does not match compiled ISA (SPARC).");
685 switch (objFile->getOpSys()) {
686 case ObjectFile::UnknownOpSys:
687 warn("Unknown operating system; assuming Linux.");
688 // fall through
681 case ObjectFile::Linux:
682 if (objFile->getArch() == ObjectFile::SPARC64) {
683 process = new Sparc64LinuxProcess(params, objFile);
684 } else {
685 process = new Sparc32LinuxProcess(params, objFile);
686 }
687 break;
688
689
690 case ObjectFile::Solaris:
691 process = new SparcSolarisProcess(params, objFile);
692 break;
689 case ObjectFile::Linux:
690 if (objFile->getArch() == ObjectFile::SPARC64) {
691 process = new Sparc64LinuxProcess(params, objFile);
692 } else {
693 process = new Sparc32LinuxProcess(params, objFile);
694 }
695 break;
696
697
698 case ObjectFile::Solaris:
699 process = new SparcSolarisProcess(params, objFile);
700 break;
701
693 default:
694 fatal("Unknown/unsupported operating system.");
695 }
696#elif THE_ISA == X86_ISA
697 if (objFile->getArch() != ObjectFile::X86)
698 fatal("Object file architecture does not match compiled ISA (x86).");
699 switch (objFile->getOpSys()) {
702 default:
703 fatal("Unknown/unsupported operating system.");
704 }
705#elif THE_ISA == X86_ISA
706 if (objFile->getArch() != ObjectFile::X86)
707 fatal("Object file architecture does not match compiled ISA (x86).");
708 switch (objFile->getOpSys()) {
709 case ObjectFile::UnknownOpSys:
710 warn("Unknown operating system; assuming Linux.");
711 // fall through
700 case ObjectFile::Linux:
701 process = new X86LinuxProcess(params, objFile);
702 break;
712 case ObjectFile::Linux:
713 process = new X86LinuxProcess(params, objFile);
714 break;
715
703 default:
704 fatal("Unknown/unsupported operating system.");
705 }
706#elif THE_ISA == MIPS_ISA
707 if (objFile->getArch() != ObjectFile::Mips)
708 fatal("Object file architecture does not match compiled ISA (MIPS).");
709 switch (objFile->getOpSys()) {
716 default:
717 fatal("Unknown/unsupported operating system.");
718 }
719#elif THE_ISA == MIPS_ISA
720 if (objFile->getArch() != ObjectFile::Mips)
721 fatal("Object file architecture does not match compiled ISA (MIPS).");
722 switch (objFile->getOpSys()) {
723 case ObjectFile::UnknownOpSys:
724 warn("Unknown operating system; assuming Linux.");
725 // fall through
710 case ObjectFile::Linux:
711 process = new MipsLinuxProcess(params, objFile);
712 break;
713
714 default:
715 fatal("Unknown/unsupported operating system.");
716 }
717#elif THE_ISA == ARM_ISA
718 if (objFile->getArch() != ObjectFile::Arm)
719 fatal("Object file architecture does not match compiled ISA (ARM).");
720 switch (objFile->getOpSys()) {
726 case ObjectFile::Linux:
727 process = new MipsLinuxProcess(params, objFile);
728 break;
729
730 default:
731 fatal("Unknown/unsupported operating system.");
732 }
733#elif THE_ISA == ARM_ISA
734 if (objFile->getArch() != ObjectFile::Arm)
735 fatal("Object file architecture does not match compiled ISA (ARM).");
736 switch (objFile->getOpSys()) {
737 case ObjectFile::UnknownOpSys:
738 warn("Unknown operating system; assuming Linux.");
739 // fall through
721 case ObjectFile::Linux:
722 process = new ArmLinuxProcess(params, objFile);
723 break;
724
725 default:
726 fatal("Unknown/unsupported operating system.");
727 }
728#else

--- 14 unchanged lines hidden ---
740 case ObjectFile::Linux:
741 process = new ArmLinuxProcess(params, objFile);
742 break;
743
744 default:
745 fatal("Unknown/unsupported operating system.");
746 }
747#else

--- 14 unchanged lines hidden ---