/[gxemul]/trunk/src/file/file_ecoff.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/file_ecoff.c

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

revision 41 by dpavlin, Mon Oct 8 16:21:53 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: file_ecoff.c,v 1.1 2007/04/10 16:33:44 debug Exp $   *  $Id: file_ecoff.c,v 1.2 2007/06/15 17:02:39 debug Exp $
29   *   *
30   *  ECOFF file support.   *  ECOFF file support.
31   */   */
# Line 307  static void file_load_ecoff(struct machi Line 307  static void file_load_ecoff(struct machi
307                           *    mat%20Specification.txt                           *    mat%20Specification.txt
308                           *  for more details.                           *  for more details.
309                           */                           */
310                          ms_sym_buf = malloc(sizeof(struct ms_sym) * f_nsyms);                          CHECK_ALLOCATION(ms_sym_buf =
311                          if (ms_sym_buf == NULL) {                              malloc(sizeof(struct ms_sym) * f_nsyms));
                                 fprintf(stderr, "out of memory\n");  
                                 exit(1);  
                         }  
312                          fseek(f, f_symptr, SEEK_SET);                          fseek(f, f_symptr, SEEK_SET);
313                          len = fread(ms_sym_buf, 1,                          len = fread(ms_sym_buf, 1,
314                              sizeof(struct ms_sym) * f_nsyms, f);                              sizeof(struct ms_sym) * f_nsyms, f);
# Line 380  static void file_load_ecoff(struct machi Line 377  static void file_load_ecoff(struct machi
377                  debug("%i symbols @ 0x%08x (strings @ 0x%08x)\n",                  debug("%i symbols @ 0x%08x (strings @ 0x%08x)\n",
378                      iextMax, cbExtOffset, cbSsExtOffset);                      iextMax, cbExtOffset, cbSsExtOffset);
379    
380                  symbol_data = malloc(issExtMax + 2);                  CHECK_ALLOCATION(symbol_data = malloc(issExtMax + 2));
                 if (symbol_data == NULL) {  
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
381                  memset(symbol_data, 0, issExtMax + 2);                  memset(symbol_data, 0, issExtMax + 2);
382                  fseek(f, cbSsExtOffset, SEEK_SET);                  fseek(f, cbSsExtOffset, SEEK_SET);
383                  fread(symbol_data, 1, issExtMax + 1, f);                  fread(symbol_data, 1, issExtMax + 1, f);
384    
385                  nsymbols = iextMax;                  nsymbols = iextMax;
386    
387                  extsyms = malloc(iextMax * sizeof(struct ecoff_extsym));                  CHECK_ALLOCATION(extsyms =
388                  if (extsyms == NULL) {                      malloc(iextMax * sizeof(struct ecoff_extsym)));
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
389                  memset(extsyms, 0, iextMax * sizeof(struct ecoff_extsym));                  memset(extsyms, 0, iextMax * sizeof(struct ecoff_extsym));
390                  fseek(f, cbExtOffset, SEEK_SET);                  fseek(f, cbExtOffset, SEEK_SET);
391                  fread(extsyms, 1, iextMax * sizeof(struct ecoff_extsym), f);                  fread(extsyms, 1, iextMax * sizeof(struct ecoff_extsym), f);

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26