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 |
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 |
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 |
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 |
682 if (objFile->getArch() != ObjectFile::SPARC64 && 683 objFile->getArch() != ObjectFile::SPARC32) |
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 |
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 |
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 |
712 case ObjectFile::Linux: 713 process = new X86LinuxProcess(params, objFile); 714 break; |
715 |
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 |
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 |
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 --- |