/[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 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 28 by dpavlin, Mon Oct 8 16:20:26 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2006  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: file.c,v 1.119 2005/11/19 21:00:59 debug Exp $   *  $Id: file.c,v 1.132 2006/07/09 05:51:28 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 are:   *  memory. File formats recognized so far are:
# Line 56  Line 56 
56  #include "symbol.h"  #include "symbol.h"
57    
58    
59    extern int quiet_mode;
60    extern int verbose;
61    
62    
63  /*  ELF machine types as strings: (same as exec_elf.h)  */  /*  ELF machine types as strings: (same as exec_elf.h)  */
64  #define N_ELF_MACHINE_TYPES     64  #define N_ELF_MACHINE_TYPES     84
65  static char *elf_machine_type[N_ELF_MACHINE_TYPES] = {  static char *elf_machine_type[N_ELF_MACHINE_TYPES] = {
66          "NONE", "M32", "SPARC", "386",                          /*  0..3  */          "NONE", "M32", "SPARC", "386",                          /*  0..3  */
67          "68K", "88K", "486", "860",                             /*  4..7  */          "68K", "88K", "486", "860",                             /*  4..7  */
# Line 74  static char *elf_machine_type[N_ELF_MACH Line 78  static char *elf_machine_type[N_ELF_MACH
78          "H8S", "H8_500", "IA_64", "MIPS_X",                     /*  48..51  */          "H8S", "H8_500", "IA_64", "MIPS_X",                     /*  48..51  */
79          "COLDFIRE", "68HC12", "unknown54", "unknown55",         /*  52..55  */          "COLDFIRE", "68HC12", "unknown54", "unknown55",         /*  52..55  */
80          "unknown56", "unknown57", "unknown58", "unknown59",     /*  56..59  */          "unknown56", "unknown57", "unknown58", "unknown59",     /*  56..59  */
81          "unknown60", "unknown61", "AMD64", "unknown63"          /*  60..63  */          "unknown60", "unknown61", "AMD64", "unknown63",         /*  60..63  */
82            "unknown64", "unknown65", "unknown66", "unknown67",     /*  64..67  */
83            "unknown68", "unknown69", "unknown70", "unknown71",     /*  68..71  */
84            "unknown72", "unknown73", "unknown74", "unknown75",     /*  72..75  */
85            "unknown76", "unknown77", "unknown78", "unknown79",     /*  76..79  */
86            "unknown80", "unknown81", "unknown82", "AVR"            /*  80..83  */
87  };  };
88    
89    
# Line 127  struct ms_sym { Line 136  struct ms_sym {
136  #define AOUT_FLAG_DECOSF1               1  #define AOUT_FLAG_DECOSF1               1
137  #define AOUT_FLAG_FROM_BEGINNING        2  #define AOUT_FLAG_FROM_BEGINNING        2
138  #define AOUT_FLAG_VADDR_ZERO_HACK       4  #define AOUT_FLAG_VADDR_ZERO_HACK       4
139    #define AOUT_FLAG_NO_SIZES              8
140  /*  /*
141   *  file_load_aout():   *  file_load_aout():
142   *   *
# Line 162  static void file_load_aout(struct machin Line 172  static void file_load_aout(struct machin
172          if (flags & AOUT_FLAG_DECOSF1) {          if (flags & AOUT_FLAG_DECOSF1) {
173                  fread(&buf, 1, 32, f);                  fread(&buf, 1, 32, f);
174                  vaddr = buf[16] + (buf[17] << 8) +                  vaddr = buf[16] + (buf[17] << 8) +
175                      (buf[18] << 16) + (buf[19] << 24);                      (buf[18] << 16) + ((uint64_t)buf[19] << 24);
176                  entry = buf[20] + (buf[21] << 8) +                  entry = buf[20] + (buf[21] << 8) +
177                      (buf[22] << 16) + (buf[23] << 24);                      (buf[22] << 16) + ((uint64_t)buf[23] << 24);
178                  debug("OSF1 a.out, load address 0x%08lx, "                  debug("OSF1 a.out, load address 0x%08lx, "
179                      "entry point 0x%08x\n", (long)vaddr, (long)entry);                      "entry point 0x%08x\n", (long)vaddr, (long)entry);
180                  symbsize = 0;                  symbsize = 0;
# Line 173  static void file_load_aout(struct machin Line 183  static void file_load_aout(struct machin
183                  textsize = ftello(f) - 512;                  textsize = ftello(f) - 512;
184                  datasize = 0;                  datasize = 0;
185                  fseek(f, 512, SEEK_SET);                  fseek(f, 512, SEEK_SET);
186            } else if (flags & AOUT_FLAG_NO_SIZES) {
187                    fseek(f, 0, SEEK_END);
188                    textsize = ftello(f) - 32;
189                    datasize = 0;
190                    vaddr = entry = 0;
191                    fseek(f, 32, SEEK_SET);
192          } else {          } else {
193                  len = fread(&aout_header, 1, sizeof(aout_header), f);                  len = fread(&aout_header, 1, sizeof(aout_header), f);
194                  if (len != sizeof(aout_header)) {                  if (len != sizeof(aout_header)) {
# Line 331  static void file_load_macho(struct machi Line 347  static void file_load_macho(struct machi
347          char *symbols, *strings;          char *symbols, *strings;
348          uint32_t cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags;          uint32_t cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags;
349          uint64_t vmaddr, vmsize, fileoff, filesize;          uint64_t vmaddr, vmsize, fileoff, filesize;
350          int cmd_type, cmd_len, pos, i, flavor;          int cmd_type, cmd_len, i, flavor;
351          int32_t symoff, nsyms, stroff, strsize;          int32_t symoff, nsyms, stroff, strsize;
352          size_t len;          size_t len, pos;
353    
354          if (m->cpus[0]->byte_order == EMUL_BIG_ENDIAN)          if (m->cpus[0]->byte_order == EMUL_BIG_ENDIAN)
355                  encoding = ELFDATA2MSB;                  encoding = ELFDATA2MSB;
# Line 858  static void file_load_ecoff(struct machi Line 874  static void file_load_ecoff(struct machi
874                                          debug("%c", sym->name[i]);  */                                          debug("%c", sym->name[i]);  */
875                                  v = sym->value[0] + (sym->value[1] << 8)                                  v = sym->value[0] + (sym->value[1] << 8)
876                                      + (sym->value[2] << 16)                                      + (sym->value[2] << 16)
877                                      + (sym->value[3] << 24);                                      + ((uint64_t)sym->value[3] << 24);
878                                  altname = sym->name[4] + (sym->name[5] << 8)                                  altname = sym->name[4] + (sym->name[5] << 8)
879                                      + (sym->name[6] << 16)                                      + (sym->name[6] << 16)
880                                      + (sym->name[3] << 24);                                      + ((uint64_t)sym->name[3] << 24);
881                                  t = (sym->type[1] << 8) + sym->type[0];                                  t = (sym->type[1] << 8) + sym->type[0];
882                                  /*  TODO: big endian COFF?  */                                  /*  TODO: big endian COFF?  */
883                                  /*  debug("' value=0x%x type=0x%04x", v, t);  */                                  /*  debug("' value=0x%x type=0x%04x", v, t);  */
# Line 1092  static void file_load_srec(struct machin Line 1108  static void file_load_srec(struct machin
1108                                      bytes[2];                                      bytes[2];
1109                                  break;                                  break;
1110                          case 3: data_start = 4;                          case 3: data_start = 4;
1111                                  vaddr = (bytes[0] << 24) + (bytes[1] << 16) +                                  vaddr = ((uint64_t)bytes[0] << 24) +
1112                                      (bytes[2] << 8) + bytes[3];                                      (bytes[1] << 16) + (bytes[2]<<8) + bytes[3];
1113                          }                          }
1114                          m->cpus[0]->memory_rw(m->cpus[0], mem, vaddr,                          m->cpus[0]->memory_rw(m->cpus[0], mem, vaddr,
1115                              &bytes[data_start], count - 1 - data_start,                              &bytes[data_start], count - 1 - data_start,
# Line 1105  static void file_load_srec(struct machin Line 1121  static void file_load_srec(struct machin
1121                  case 9:                  case 9:
1122                          /*  switch again, to get the entry point:  */                          /*  switch again, to get the entry point:  */
1123                          switch (buf[1]) {                          switch (buf[1]) {
1124                          case 7: entry = (bytes[0] << 24) + (bytes[1] << 16) +                          case 7: entry = ((uint64_t)bytes[0] << 24) +
1125                                      (bytes[2] << 8) + bytes[3];                                      (bytes[1] << 16) + (bytes[2]<<8) + bytes[3];
1126                                  break;                                  break;
1127                          case 8: entry = (bytes[0] << 16) + (bytes[1] << 8) +                          case 8: entry = (bytes[0] << 16) + (bytes[1] << 8) +
1128                                      bytes[2];                                      bytes[2];
# Line 1148  static void file_load_raw(struct machine Line 1164  static void file_load_raw(struct machine
1164  {  {
1165          FILE *f;          FILE *f;
1166          int len;          int len;
1167          unsigned char buf[4096];          unsigned char buf[16384];
1168          uint64_t entry, loadaddr, vaddr, skip = 0;          uint64_t entry, loadaddr, vaddr, skip = 0;
1169          char *p, *p2;          char *p, *p2;
1170    
# Line 1185  static void file_load_raw(struct machine Line 1201  static void file_load_raw(struct machine
1201    
1202          /*  Load file contents:  */          /*  Load file contents:  */
1203          while (!feof(f)) {          while (!feof(f)) {
1204                  len = fread(buf, 1, sizeof(buf), f);                  size_t to_read = sizeof(buf);
1205    
1206                    /*  If vaddr isn't buf-size aligned, then start with a
1207                        smaller buffer:  */
1208                    if (vaddr & (sizeof(buf) - 1))
1209                            to_read = sizeof(buf) - (vaddr & (sizeof(buf)-1));
1210    
1211                    len = fread(buf, 1, to_read, f);
1212    
1213                  if (len > 0)                  if (len > 0)
1214                          m->cpus[0]->memory_rw(m->cpus[0], mem, vaddr, &buf[0],                          m->cpus[0]->memory_rw(m->cpus[0], mem, vaddr, &buf[0],
# Line 1194  static void file_load_raw(struct machine Line 1217  static void file_load_raw(struct machine
1217                  vaddr += len;                  vaddr += len;
1218          }          }
1219    
1220          debug("RAW: 0x%llx bytes @ 0x%08llx",          debug("RAW: 0x%"PRIx64" bytes @ 0x%08"PRIx64,
1221              (long long) (ftello(f) - skip), (long long)loadaddr);              (uint64_t) (ftello(f) - skip), (uint64_t) loadaddr);
1222    
1223          if (skip != 0)          if (skip != 0)
1224                  debug(" (0x%llx bytes of header skipped)", (long long)skip);                  debug(" (0x%"PRIx64" bytes of header skipped)",
1225                        (uint64_t) skip);
1226    
1227          debug("\n");          debug("\n");
1228    
1229          fclose(f);          fclose(f);
# Line 1392  static void file_load_elf(struct machine Line 1418  static void file_load_elf(struct machine
1418                  }                  }
1419                  break;                  break;
1420          case ARCH_MIPS:          case ARCH_MIPS:
         case ARCH_NEWMIPS:  
1421                  switch (emachine) {                  switch (emachine) {
1422                  case EM_MIPS:                  case EM_MIPS:
1423                  case EM_MIPS_RS3_LE:                  case EM_MIPS_RS3_LE:
# Line 1453  static void file_load_elf(struct machine Line 1478  static void file_load_elf(struct machine
1478              encoding == ELFDATA2LSB? "LSB (LE)" : "MSB (BE)", s);              encoding == ELFDATA2LSB? "LSB (LE)" : "MSB (BE)", s);
1479    
1480          if (elf64)          if (elf64)
1481                  debug("%016llx\n", (long long)eentry);                  debug("%016"PRIx64"\n", (uint64_t) eentry);
1482          else          else
1483                  debug("%08x\n", (int)eentry);                  debug("%08"PRIx32"\n", (uint32_t) eentry);
   
         /*  
          *  MIPS16 encoding?  
          *  
          *  TODO:  Find out what e_flag actually contains.  
          *  TODO 2: This only sets mips16 for cpu 0. Yuck. Fix this!  
          */  
         if ((arch == ARCH_MIPS || arch == ARCH_NEWMIPS)  
             && ((eflags >> 24) & 0xff) == 0x24) {  
                 debug("MIPS16 encoding (e_flags = 0x%08x)\n", eflags);  
 #ifdef ENABLE_MIPS16  
                 m->cpus[0]->cd.mips.mips16 = 1;  
 #else  
                 fatal("ENABLE_MIPS16 must be defined in misc.h.\n"  
                     "(or use the --mips16 configure option)\n");  
                 exit(1);  
 #endif  
         } else if ((arch == ARCH_MIPS || arch == ARCH_NEWMIPS)  
                     && (eentry & 0x3)) {  
                 debug("MIPS16 encoding (eentry not 32-bit aligned)\n");  
 #ifdef ENABLE_MIPS16  
                 m->cpus[0]->cd.mips.mips16 = 1;  
 #else  
                 fatal("ENABLE_MIPS16 must be defined in misc.h.\n"  
                     "(or use the --mips16 configure option)\n");  
                 exit(1);  
 #endif  
         }  
1484    
1485          /*          /*
1486           *  SH64: 32-bit instruction encoding?  TODO           *  SH64: 32-bit instruction encoding?  TODO
# Line 1531  static void file_load_elf(struct machine Line 1528  static void file_load_elf(struct machine
1528                  }                  }
1529    
1530                  /*                  /*
1531                   *  Hack for loading Linux/PPC kernels, linked to high                   *  Hack for loading PPC kernels that are linked to high
1532                   *  addresses, at low addresses.                   *  addresses. (This requires enabling of instruction and
1533                     *  data virtual address translation.)
1534                   */                   */
1535                  if (arch == ARCH_PPC) {                  if (arch == ARCH_PPC) {
1536                          if (elf64) {                          if ( (elf64 && (p_vaddr >> 60) != 0) ||
1537                                  p_vaddr &= 0x0fffffffffffffffULL;                              (!elf64 && (p_vaddr >> 28) != 0) )
1538                                  p_paddr &= 0x0fffffffffffffffULL;                                  m->cpus[m->bootstrap_cpu]->
1539                          } else {                                      cd.ppc.msr |= PPC_MSR_IR | PPC_MSR_DR;
                                 p_vaddr &= 0x0fffffff;  
                                 p_paddr &= 0x0fffffff;  
                         }  
1540                  }                  }
1541    
1542                  if (p_memsz != 0 && (p_type == PT_LOAD ||                  if (p_memsz != 0 && (p_type == PT_LOAD ||
# Line 1550  static void file_load_elf(struct machine Line 1545  static void file_load_elf(struct machine
1545                          if (p_type == PT_LOAD)                          if (p_type == PT_LOAD)
1546                                  debug("load");                                  debug("load");
1547                          else                          else
1548                                  debug("0x%08x", (int)p_type);                                  debug("0x%08"PRIx32, (uint32_t) p_type);
1549    
1550                          debug(") @ 0x%llx, vaddr 0x", (long long)p_offset);                          debug(") @ 0x%"PRIx64", vaddr 0x", (uint64_t) p_offset);
1551    
1552                          if (elf64)                          if (elf64)
1553                                  debug("%016llx", (long long)p_vaddr);                                  debug("%016"PRIx64, (uint64_t) p_vaddr);
1554                          else                          else
1555                                  debug("%08x", (int)p_vaddr);                                  debug("%08"PRIx32, (uint32_t) p_vaddr);
1556    
1557                          debug(" len=0x%llx\n", (long long)p_memsz);                          debug(" len=0x%"PRIx64"\n", (uint64_t) p_memsz);
1558    
1559                          if (p_vaddr != p_paddr)                          if (p_vaddr != p_paddr) {
1560                                  fatal("WARNING! vaddr (0x%llx) and paddr "                                  if (elf64)
1561                                      "(0x%llx) differ; using vaddr\n",                                          debug("NOTE: vaddr (0x%"PRIx64") and "
1562                                      (long long)p_vaddr, (long long)p_paddr);                                              "paddr (0x%"PRIx64") differ; using "
1563                                                "vaddr\n", (uint64_t) p_vaddr,
1564                                                (uint64_t) p_paddr);
1565                                    else
1566                                            debug("NOTE: vaddr (0x%08"PRIx32") and "
1567                                                "paddr (0x%08"PRIx32") differ; usin"
1568                                                "g vaddr\n", (uint32_t) p_vaddr,
1569                                                (uint32_t)p_paddr);
1570                            }
1571    
1572                          if (p_memsz < p_filesz) {                          if (p_memsz < p_filesz) {
1573                                  fprintf(stderr, "%s: memsz < filesz. TODO: how"                                  fprintf(stderr, "%s: memsz < filesz. TODO: how"
1574                                      " to handle this? memsz=%016llx filesz="                                      " to handle this? memsz=%016"PRIx64
1575                                      "%016llx\n", filename, (long long)p_memsz,                                      " filesz=%016"PRIx64"\n", filename,
1576                                      (long long)p_filesz);                                      (uint64_t) p_memsz, (uint64_t) p_filesz);
1577                                  exit(1);                                  exit(1);
1578                          }                          }
1579    
# Line 1638  static void file_load_elf(struct machine Line 1641  static void file_load_elf(struct machine
1641                  off_t sh_offset;                  off_t sh_offset;
1642                  int n_entries;  /*  for reading the symbol / string tables  */                  int n_entries;  /*  for reading the symbol / string tables  */
1643    
1644                  /*  debug("section header %i at %016llx\n", i,                  /*  debug("section header %i at %016"PRIx64"\n", i,
1645                      (long long) eshoff+i*eshentsize);  */                      (uint64_t) eshoff+i*eshentsize);  */
1646    
1647                  fseek(f, eshoff + i * eshentsize, SEEK_SET);                  fseek(f, eshoff + i * eshentsize, SEEK_SET);
1648    
# Line 1725  static void file_load_elf(struct machine Line 1728  static void file_load_elf(struct machine
1728                                  exit(1);                                  exit(1);
1729                          }                          }
1730    
1731                          debug("%i symbol entries at 0x%llx\n",                          debug("%i symbol entries at 0x%"PRIx64"\n",
1732                              (int)n_entries, (long long)sh_offset);                              (int) n_entries, (uint64_t) sh_offset);
1733    
1734                          n_symbols = n_entries;                          n_symbols = n_entries;
1735                  }                  }
# Line 1759  static void file_load_elf(struct machine Line 1762  static void file_load_elf(struct machine
1762                                  exit(1);                                  exit(1);
1763                          }                          }
1764    
1765                          debug("%i bytes of symbol strings at 0x%llx\n",                          debug("%i bytes of symbol strings at 0x%"PRIx64"\n",
1766                              (int)sh_size, (long long)sh_offset);                              (int) sh_size, (uint64_t) sh_offset);
1767    
1768                          symbol_strings[sh_size] = '\0';                          symbol_strings[sh_size] = '\0';
1769                          symbol_length = sh_size;                          symbol_length = sh_size;
# Line 1789  static void file_load_elf(struct machine Line 1792  static void file_load_elf(struct machine
1792                                  unencode(size,    &sym32.st_size, Elf32_Word);                                  unencode(size,    &sym32.st_size, Elf32_Word);
1793                          }                          }
1794    
1795                          /*  debug("symbol info=0x%02x addr=0x%016llx"                          /*  debug("symbol info=0x%02x addr=0x%016"PRIx64
1796                              " (%i) '%s'\n", st_info, (long long)addr,                              " (%i) '%s'\n", st_info, (uint64_t) addr,
1797                              st_name, symbol_strings + st_name);  */                              st_name, symbol_strings + st_name);  */
1798    
1799                          if (size == 0)                          if (size == 0)
# Line 1798  static void file_load_elf(struct machine Line 1801  static void file_load_elf(struct machine
1801    
1802                          if (addr != 0) /* && ((st_info >> 4) & 0xf)                          if (addr != 0) /* && ((st_info >> 4) & 0xf)
1803                              >= STB_GLOBAL) */ {                              >= STB_GLOBAL) */ {
1804                                  /*  debug("symbol info=0x%02x addr=0x%016llx"                                  /*  debug("symbol info=0x%02x addr=0x%016"PRIx64
1805                                      " '%s'\n", st_info, (long long)addr,                                      " '%s'\n", st_info, (uint64_t) addr,
1806                                      symbol_strings + st_name);  */                                      symbol_strings + st_name);  */
1807                                  add_symbol_name(&m->symbol_context,                                  add_symbol_name(&m->symbol_context,
1808                                      addr, size, symbol_strings + st_name,                                      addr, size, symbol_strings + st_name,
# Line 1809  static void file_load_elf(struct machine Line 1812  static void file_load_elf(struct machine
1812                          if (strcmp(symbol_strings + st_name, "_gp") == 0) {                          if (strcmp(symbol_strings + st_name, "_gp") == 0) {
1813                                  debug("found _gp address: 0x");                                  debug("found _gp address: 0x");
1814                                  if (elf64)                                  if (elf64)
1815                                          debug("%016llx\n", (long long)addr);                                          debug("%016"PRIx64"\n", (uint64_t)addr);
1816                                  else                                  else
1817                                          debug("%08x\n", (int)addr);                                          debug("%08"PRIx32"\n", (uint32_t)addr);
1818                                  *gpp = addr;                                  *gpp = addr;
1819                          }                          }
1820                  }                  }
# Line 1864  static void file_load_elf(struct machine Line 1867  static void file_load_elf(struct machine
1867                      ((uint64_t)b[5] << 16) + ((uint64_t)b[6] << 8) +                      ((uint64_t)b[5] << 16) + ((uint64_t)b[6] << 8) +
1868                      (uint64_t)b[7];                      (uint64_t)b[7];
1869    
1870                  debug("entrypoint 0x%016llx, toc_base 0x%016llx\n",                  debug("entrypoint 0x%016"PRIx64", toc_base 0x%016"PRIx64"\n",
1871                      (long long)*entrypointp, (long long)toc_base);                      (uint64_t) *entrypointp, (uint64_t) toc_base);
1872                  if (tocp != NULL)                  if (tocp != NULL)
1873                          *tocp = toc_base;                          *tocp = toc_base;
1874          }          }
# Line 1899  void file_load(struct machine *machine, Line 1902  void file_load(struct machine *machine,
1902          char *filename, uint64_t *entrypointp,          char *filename, uint64_t *entrypointp,
1903          int arch, uint64_t *gpp, int *byte_orderp, uint64_t *tocp)          int arch, uint64_t *gpp, int *byte_orderp, uint64_t *tocp)
1904  {  {
1905          int iadd = 4;          int iadd = DEBUG_INDENTATION, old_quiet_mode;
1906          FILE *f;          FILE *f;
1907          unsigned char buf[12];          unsigned char buf[12];
1908          unsigned char buf2[2];          unsigned char buf2[2];
# Line 1925  void file_load(struct machine *machine, Line 1928  void file_load(struct machine *machine,
1928          if (filename[0] == '@')          if (filename[0] == '@')
1929                  return;                  return;
1930    
1931          debug("loading %s:\n", filename);          debug("loading %s%s\n", filename, verbose >= 2? ":" : "");
1932          debug_indentation(iadd);          debug_indentation(iadd);
1933    
1934            old_quiet_mode = quiet_mode;
1935            if (verbose < 2)
1936                    quiet_mode = 1;
1937    
1938          f = fopen(filename, "r");          f = fopen(filename, "r");
1939          if (f == NULL) {          if (f == NULL) {
1940                  file_load_raw(machine, mem, filename, entrypointp);                  file_load_raw(machine, mem, filename, entrypointp);
# Line 1983  void file_load(struct machine *machine, Line 1990  void file_load(struct machine *machine,
1990                      entrypointp, arch, byte_orderp);                      entrypointp, arch, byte_orderp);
1991                  goto ret;                  goto ret;
1992          }          }
1993            if (buf[0]==0x01 && buf[1]==0x03 && buf[2]==0x01 && buf[3]==0x07) {
1994                    /*  SPARC a.out (old 32-bit NetBSD etc)  */
1995                    file_load_aout(machine, mem, filename, AOUT_FLAG_NO_SIZES,
1996                        entrypointp, arch, byte_orderp);
1997                    goto ret;
1998            }
1999          if (buf[0]==0x00 && buf[2]==0x00 && buf[8]==0x7a && buf[9]==0x75) {          if (buf[0]==0x00 && buf[2]==0x00 && buf[8]==0x7a && buf[9]==0x75) {
2000                  /*  DEC OSF1 on MIPS:  */                  /*  DEC OSF1 on MIPS:  */
2001                  file_load_aout(machine, mem, filename, AOUT_FLAG_DECOSF1,                  file_load_aout(machine, mem, filename, AOUT_FLAG_DECOSF1,
# Line 2085  void file_load(struct machine *machine, Line 2098  void file_load(struct machine *machine,
2098    
2099  ret:  ret:
2100          debug_indentation(-iadd);          debug_indentation(-iadd);
2101            quiet_mode = old_quiet_mode;
2102  }  }
2103    

Legend:
Removed from v.20  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.26