Changeset 14609


Ignore:
Timestamp:
Jan 30, 2011, 12:39:44 AM (14 years ago)
Author:
Gary Byers
Message:

mach-o-image.c: earlier victory declaration was ... premature.
Call _exit() on failure.
Rename "READONLY" segment to TEXT; Shark ignores symbols in
other segments.
Remember to add managed_static area.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/mach-o-image.c

    r14608 r14609  
    8383    if (n < 0) {
    8484      perror("reading from image");
    85       exit(1);
     85      _exit(1);
    8686    }
    8787    if (n == 0) {
    8888      fprintf(stderr, "unexpected end of file reading image\n");
    89       exit(1);
     89      _exit(1);
    9090    }
    9191    total += n;
     
    108108    if (n < 0) {
    109109      perror("writing to image");
    110       exit(1);
     110      _exit(1);
    111111    }
    112112    total += n;
     
    307307    f;
    308308  int tag;
    309   natural size_in_bytes;
     309  natural size_in_bytes, code_words;
    310310  macho_nlist symbol;
    311311
     
    330330#ifdef X8632
    331331      f = ((LispObj)start)+fulltag_misc;
    332       size_in_bytes = (header_element_count(header)<<node_shift)-tag_misc;
     332      code_words = (unsigned short)deref(f,1);
     333      if (code_words & 0x8000) {
     334        code_words = header_element_count(header) - (code_words & 0x7fff);
     335      }
     336      size_in_bytes = (code_words<<node_shift)-tag_misc;
    333337#endif
    334338#ifdef X8664
    335339      f = ((LispObj)start)+fulltag_function;
    336       size_in_bytes = (header_element_count(header)<<node_shift)-tag_function;
     340      code_words = (int)deref(f,1);
     341      size_in_bytes = (code_words<<node_shift)-tag_function;
    337342#endif
    338343
     
    484489
    485490  seg = add_macho_segment(p,
    486                           "READONLY",
     491                          "__TEXT",
    487492                          (natural)(readonly_area->low-4096),
    488493                          4096+align_to_power_of_2(readonly_area->active-readonly_area->low,12),
     
    492497                          VM_PROT_READ|VM_PROT_EXECUTE,
    493498                          1,
    494                           "purespace");
     499                          "text");
    495500  init_macho_section(seg,
    496501                     0,
     
    827832    managed_static_area = new_area(ms_start,ms_end,AREA_MANAGED_STATIC);
    828833    managed_static_area->active = ms_end;
     834    add_area_holding_area_lock(managed_static_area);
    829835    lisp_global(REF_BASE) = (LispObj) ms_start;
    830836   
Note: See TracChangeset for help on using the changeset viewer.