/[gxemul]/trunk/src/file.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/file.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by dpavlin, Mon Oct 8 16:17:48 2007 UTC revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: file.c,v 1.85 2005/04/06 21:28:36 debug Exp $   *  $Id: file.c,v 1.88 2005/04/17 00:15:24 debug Exp $
29   *   *
30   *  This file contains functions which load executable images into (emulated)   *  This file contains functions which load executable images into (emulated)
31   *  memory.  File formats recognized so far:   *  memory.  File formats recognized so far:
# Line 56  Line 56 
56    
57    
58  /*  ELF machine types as strings: (same as exec_elf.h)  */  /*  ELF machine types as strings: (same as exec_elf.h)  */
59  #define N_ELF_MACHINE_TYPES     54  #define N_ELF_MACHINE_TYPES     64
60  static char *elf_machine_type[N_ELF_MACHINE_TYPES] = {  static char *elf_machine_type[N_ELF_MACHINE_TYPES] = {
61          "NONE", "M32", "SPARC", "386",                          /*  0..3  */          "NONE", "M32", "SPARC", "386",                          /*  0..3  */
62          "68K", "88K", "486", "860",                             /*  4..7  */          "68K", "88K", "486", "860",                             /*  4..7  */
# Line 71  static char *elf_machine_type[N_ELF_MACH Line 71  static char *elf_machine_type[N_ELF_MACH
71          "ARM", "ALPHA", "SH", "SPARCV9",                        /*  40..43  */          "ARM", "ALPHA", "SH", "SPARCV9",                        /*  40..43  */
72          "TRICORE", "ARC", "H8_300", "H8_300H",                  /*  44..47  */          "TRICORE", "ARC", "H8_300", "H8_300H",                  /*  44..47  */
73          "H8S", "H8_500", "IA_64", "MIPS_X",                     /*  48..51  */          "H8S", "H8_500", "IA_64", "MIPS_X",                     /*  48..51  */
74          "COLDFIRE", "68HC12"                                    /*  52..53  */          "COLDFIRE", "68HC12", "unknown54", "unknown55",         /*  52..55  */
75            "unknown56", "unknown57", "unknown58", "unknown59",     /*  56..59  */
76            "unknown60", "unknown61", "AMD64", "unknown63"          /*  60..63  */
77  };  };
78    
79    
# Line 1040  static void file_load_elf(struct machine Line 1042  static void file_load_elf(struct machine
1042    
1043          ok = 0;          ok = 0;
1044          switch (arch) {          switch (arch) {
1045            case ARCH_ALPHA:
1046                    switch (emachine) {
1047                    case EM_ALPHA:
1048                    case -28634:
1049                            ok = 1;
1050                    }
1051                    break;
1052            case ARCH_HPPA:
1053                    switch (emachine) {
1054                    case EM_PARISC:
1055                            ok = 1;
1056                    }
1057                    break;
1058          case ARCH_MIPS:          case ARCH_MIPS:
1059                  switch (emachine) {                  switch (emachine) {
1060                  case EM_MIPS:                  case EM_MIPS:
# Line 1061  static void file_load_elf(struct machine Line 1076  static void file_load_elf(struct machine
1076                          ok = 1;                          ok = 1;
1077                  }                  }
1078                  break;                  break;
1079          case ARCH_HPPA:          case ARCH_X86:
1080                  switch (emachine) {                  switch (emachine) {
1081                  case EM_PARISC:                  case EM_386:
1082                    case EM_486:
1083                          ok = 1;                          ok = 1;
1084                  }                          break;
1085                  break;                  case EM_AMD64:
1086          case ARCH_ALPHA:                          *tocp = 1;
                 switch (emachine) {  
                 case EM_ALPHA:  
                 case -28634:  
1087                          ok = 1;                          ok = 1;
1088                            break;
1089                  }                  }
1090                  break;                  break;
1091          default:          default:
# Line 1622  void file_load(struct machine *machine, Line 1636  void file_load(struct machine *machine,
1636                  exit(1);                  exit(1);
1637          }          }
1638    
1639            if (size == 1474560)
1640                    fprintf(stderr, "Hm... this file is the size of a 1.44 MB "
1641                        "floppy image. Maybe you forgot the\n-d switch?\n");
1642    
1643          /*          /*
1644           *  Last resort:  symbol definitions from nm (or nm -S):           *  Last resort:  symbol definitions from nm (or nm -S):
1645           *           *

Legend:
Removed from v.2  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26