/[gxemul]/trunk/src/file/file_macho.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_macho.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_macho.c,v 1.1 2007/04/10 16:33:44 debug Exp $   *  $Id: file_macho.c,v 1.2 2007/06/15 17:02:39 debug Exp $
29   *   *
30   *  Mach-O file support.   *  Mach-O file support.
31   */   */
# Line 218  static void file_load_macho(struct machi Line 218  static void file_load_macho(struct machi
218                          debug("symtable: %i symbols @ 0x%x (strings at "                          debug("symtable: %i symbols @ 0x%x (strings at "
219                              "0x%x)\n", nsyms, symoff, stroff);                              "0x%x)\n", nsyms, symoff, stroff);
220    
221                          symbols = malloc(12 * nsyms);                          CHECK_ALLOCATION(symbols = malloc(12 * nsyms));
                         if (symbols == NULL) {  
                                 fprintf(stderr, "out of memory\n");  
                                 exit(1);  
                         }  
222                          fseek(f, symoff, SEEK_SET);                          fseek(f, symoff, SEEK_SET);
223                          fread(symbols, 1, 12 * nsyms, f);                          fread(symbols, 1, 12 * nsyms, f);
224    
225                          strings = malloc(strsize);                          CHECK_ALLOCATION(strings = malloc(strsize));
                         if (strings == NULL) {  
                                 fprintf(stderr, "out of memory\n");  
                                 exit(1);  
                         }  
226                          fseek(f, stroff, SEEK_SET);                          fseek(f, stroff, SEEK_SET);
227                          fread(strings, 1, strsize, f);                          fread(strings, 1, strsize, f);
228    

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

  ViewVC Help
Powered by ViewVC 1.1.26