/[gcl]/gcl/o/unexmacosx.c
ViewVC logotype

Diff of /gcl/o/unexmacosx.c

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

revision 1.1.4.5 by rlbrk, Mon Mar 15 17:07:42 2004 UTC revision 1.1.4.5.14.1 by camm, Thu Dec 1 22:18:23 2005 UTC
# Line 124  Foundation, 675 Mass Ave, Cambridge, MA Line 124  Foundation, 675 Mass Ave, Cambridge, MA
124  #endif  #endif
125  #include <mach-o/nlist.h>  #include <mach-o/nlist.h>
126  #include <mach-o/getsect.h>  #include <mach-o/getsect.h>
127  #include <objc/malloc.h>  #include <malloc/malloc.h>
128    
129  #include <sys/mman.h>  #include <sys/mman.h>
130    
# Line 528  static void Line 528  static void
528  print_load_command (struct load_command *lc)  print_load_command (struct load_command *lc)
529  {  {
530    print_load_command_name (lc->cmd);    print_load_command_name (lc->cmd);
531    printf ("%#10lx", lc->cmdsize);    printf ("%#10x", lc->cmdsize);
532    
533    if (lc->cmd == LC_SEGMENT)    if (lc->cmd == LC_SEGMENT)
534      {      {
# Line 537  print_load_command (struct load_command Line 537  print_load_command (struct load_command
537        int j;        int j;
538    
539        scp = (struct segment_command *) lc;        scp = (struct segment_command *) lc;
540        printf (" %-16.16s %#10lx %#10lx\n",        printf (" %-16.16s %#10x %#10x\n",
541          scp->segname, scp->vmaddr, scp->vmsize);          scp->segname, scp->vmaddr, scp->vmsize);
542    
543        sectp = (struct section *) (scp + 1);        sectp = (struct section *) (scp + 1);
544        for (j = 0; j < scp->nsects; j++)        for (j = 0; j < scp->nsects; j++)
545          {          {
546            printf ("                               %-16.16s %#10lx %#10lx\n",            printf ("                               %-16.16s %#10x %#10x\n",
547                    sectp->sectname, sectp->addr, sectp->size);                    sectp->sectname, sectp->addr, sectp->size);
548            sectp++;            sectp++;
549          }          }
# Line 571  read_load_commands () Line 571  read_load_commands ()
571    
572  #if VERBOSE  #if VERBOSE
573    printf ("--- Header Information ---\n");    printf ("--- Header Information ---\n");
574    printf ("Magic      = 0x%08lx\n", mh.magic);    printf ("Magic      = 0x%08x\n",  mh.magic);
575    printf ("CPUType    = %d\n",      mh.cputype);    printf ("CPUType    = %d\n",      mh.cputype);
576    printf ("CPUSubType = %d\n",      mh.cpusubtype);    printf ("CPUSubType = %d\n",      mh.cpusubtype);
577    printf ("FileType   = 0x%lx\n",   mh.filetype);    printf ("FileType   = 0x%x\n",    mh.filetype);
578    printf ("NCmds      = %ld\n",     mh.ncmds);    printf ("NCmds      = %d\n",      mh.ncmds);
579    printf ("SizeOfCmds = %ld\n",     mh.sizeofcmds);    printf ("SizeOfCmds = %d\n",      mh.sizeofcmds);
580    printf ("Flags      = 0x%08lx\n", mh.flags);    printf ("Flags      = 0x%08x\n",  mh.flags);
581  #endif  #endif
582    
583    nlc = mh.ncmds;    nlc = mh.ncmds;
# Line 655  copy_segment (struct load_command *lc) Line 655  copy_segment (struct load_command *lc)
655    if (strncmp (scp->segname, SEG_LINKEDIT, 16) == 0)    if (strncmp (scp->segname, SEG_LINKEDIT, 16) == 0)
656      scp->vmaddr += linkedit_delta;      scp->vmaddr += linkedit_delta;
657        
658    printf ("Writing segment %-16.16s at %#10lx - %#10lx (sz: %#10lx)\n",    printf ("Writing segment %-16.16s at %#10x - %#10x (sz: %#10x)\n",
659            scp->segname, scp->fileoff, scp->fileoff + scp->filesize,            scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
660            scp->filesize);            scp->filesize);
661    
# Line 693  copy_data_segment (struct load_command * Line 693  copy_data_segment (struct load_command *
693      return;      return;
694    }    }
695    
696    printf ("Writing segment %-16.16s at %#10lx - %#10lx (sz: %#10lx)\n",    printf ("Writing segment %-16.16s at %#10x - %#10x (sz: %#10x)\n",
697            scp->segname, scp->fileoff, scp->fileoff + scp->filesize,            scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
698            scp->filesize);            scp->filesize);
699        
# Line 741  copy_data_segment (struct load_command * Line 741  copy_data_segment (struct load_command *
741        else        else
742          unexec_error ("unrecognized section name in __DATA segment");          unexec_error ("unrecognized section name in __DATA segment");
743    
744        printf ("        section %-16.16s at %#10lx - %#10lx (sz: %#10lx)\n",        printf ("        section %-16.16s at %#10x - %#10x (sz: %#10x)\n",
745                sectp->sectname, sectp->offset, sectp->offset + sectp->size,                sectp->sectname, sectp->offset, sectp->offset + sectp->size,
746                sectp->size);                sectp->size);
747    
# Line 830  copy_data_segment (struct load_command * Line 830  copy_data_segment (struct load_command *
830        section.reserved1 = 0;        section.reserved1 = 0;
831        section.reserved2 = 0;        section.reserved2 = 0;
832                            
833        printf ("Writing segment %-16.16s at %#10lx - %#10lx (sz: %#10lx)\n",        printf ("Writing segment %-16.16s at %#10x - %#10x (sz: %#10x)\n",
834                sc.segname, sc.fileoff, sc.fileoff + sc.filesize, sc.filesize);                sc.segname, sc.fileoff, sc.fileoff + sc.filesize, sc.filesize);
835    
836        if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.filesize))        if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.filesize))
# Line 1274  void init_darwin_zone_compat () Line 1274  void init_darwin_zone_compat ()
1274    
1275  /* Replacement for broken sbrk(2).  */  /* Replacement for broken sbrk(2).  */
1276    
1277  char *my_sbrk (int incr)  void *my_sbrk (int incr)
1278  {  {
1279    char               *temp, *ptr;    char               *temp, *ptr;
1280    kern_return_t       rtn;    kern_return_t       rtn;

Legend:
Removed from v.1.1.4.5  
changed lines
  Added in v.1.1.4.5.14.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26