Ignore:
Timestamp:
May 26, 2003, 4:43:12 PM (22 years ago)
Author:
zap
Message:

See ChangeLog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/stabshll.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r235 r236  
    515515                        int sym_seg, int ext)
    516516{
    517   struct reloc r;
     517  struct relocation_info r;
    518518
    519519  sst_start (SST_static);
    520   r.address = sst.size;
     520  r.r_address = sst.size;
    521521  buffer_dword (&sst, addr);      /* Segment offset */
    522522  buffer_word (&sst, 0);          /* Segment address */
     
    524524  buffer_nstr (&sst, name);       /* Symbol name */
    525525  sst_end ();
    526   r.ext = ext;
    527   r.length = 2;
    528   r.symbolnum = sym_seg;
    529   r.pcrel = 0;
    530   r.unused = 0;
     526  r.r_extern = ext;
     527  r.r_length = 2;
     528  r.r_symbolnum = sym_seg;
     529  r.r_pcrel = 0;
     530  r.r_pad = 0;
    531531  buffer_mem (&sst_reloc, &r, sizeof (r));
    532   r.address += 4;
    533   r.length = 1;
     532  r.r_address += 4;
     533  r.r_length = 1;
    534534  buffer_mem (&sst_reloc, &r, sizeof (r));
    535535}
     
    772772
    773773
    774 #if defined (DEBUG)
     774#if defined (HLL_DEBUG)
    775775
    776776/* This function is used to print an internal type for debugging. */
     
    819819      printf ("(");
    820820      show_type (tp->d.array.etype);
    821       printf ("[%d]", tp->d.array.last + 1 - tp->d.array.first);
     821      printf ("[%ld]", tp->d.array.last + 1 - tp->d.array.first);
    822822      break;
    823823    case ty_bits:
     
    23392339  for (i = *index; i < sym_count; ++i)
    23402340    {
    2341       p = str_ptr + sym_ptr[i].string;
     2341      p = str_ptr + sym_ptr[i].n_un.n_strx;
    23422342      n = strlen (p);
    23432343      if (n > 0 && p[n-1] == '\\')
     
    23512351  if (i == *index)
    23522352    {
    2353       *str = str_ptr + sym_ptr[i].string;
     2353      *str = str_ptr + sym_ptr[i].n_un.n_strx;
    23542354      return FALSE;
    23552355    }
     
    23602360      for (i = *index; i < sym_count; ++i)
    23612361        {
    2362           p = str_ptr + sym_ptr[i].string;
     2362          p = str_ptr + sym_ptr[i].n_un.n_strx;
    23632363          n = strlen (p);
    23642364          if (n > 0 && p[n-1] == '\\')
     
    24012401      memcpy (name, str, n);
    24022402      name[n] = 0;
    2403 #if defined (DEBUG)
     2403#if defined (HLL_DEBUG)
    24042404      printf ("LSYM/LCSYM/GSYM/PSYM/RSYM/STSYM/FUN %s\n", str);
    24052405#endif
     
    24212421            ++parse_ptr;        /* synonymous type */
    24222422          t = parse_complete_type (name);
    2423 #if defined (DEBUG)
     2423#if defined (HLL_DEBUG)
    24242424          printf ("  type: ");
    24252425          show_type (t);
     
    24352435          ++parse_ptr;
    24362436          t = parse_complete_type (name);
    2437 #if defined (DEBUG)
     2437#if defined (HLL_DEBUG)
    24382438          printf ("  type: ");
    24392439          show_type (t);
     
    24452445        case '5': case '6': case '7': case '8': case '9':
    24462446          t = parse_complete_type (name);
    2447 #if defined (DEBUG)
     2447#if defined (HLL_DEBUG)
    24482448          printf ("  type: ");
    24492449          show_type (t);
     
    24642464{
    24652465  size_t ptr;
    2466   struct reloc r;
     2466  struct relocation_info r;
    24672467
    24682468  sst_start (SST_begin);
    2469   r.address = sst.size;
     2469  r.r_address = sst.size;
    24702470  ptr = sst.size;
    24712471  buffer_dword (&sst, addr);    /* Segment offset */
     
    24762476  sst_end ();
    24772477
    2478   r.ext = 0;
    2479   r.length = 2;
    2480   r.symbolnum = N_TEXT;
    2481   r.pcrel = 0;
    2482   r.unused = 0;
     2478  r.r_extern = 0;
     2479  r.r_length = 2;
     2480  r.r_symbolnum = N_TEXT;
     2481  r.r_pcrel = 0;
     2482  r.r_pad = 0;
    24832483  buffer_mem (&sst_reloc, &r, sizeof (r));
    24842484  return ptr;
     
    25222522  const char *p;
    25232523
    2524   if (s->type != N_FUN)
     2524  if (s->n_type != N_FUN)
    25252525    return FALSE;
    2526   p = strchr (str_ptr + s->string, ':');
     2526  p = strchr (str_ptr + s->n_un.n_strx, ':');
    25272527  if (p == NULL)
    25282528    return FALSE;
     
    25672567      if (is_fun (&sym_ptr[i]))
    25682568        {
    2569           addr = sym_ptr[i].value;
     2569          addr = sym_ptr[i].n_value;
    25702570          break;
    25712571        }
     
    25972597      --block_grow.count;
    25982598      hll_end (block_stack[block_grow.count].patch_ptr, 0,
    2599                sym_ptr[i].value - block_stack[block_grow.count].addr);
     2599               sym_ptr[i].n_value - block_stack[block_grow.count].addr);
    26002600      if (block_grow.count == 0 && proc_patch_base != 0)
    26012601        fun_end (i);
     
    26132613{
    26142614  struct type t, *t1, *t2;
    2615   struct reloc r;
     2615  struct relocation_info r;
    26162616  const char *str, *p;
    26172617  char *name;
    26182618  int n, ti;
    26192619
    2620   str = str_ptr + symbol->string;
     2620  str = str_ptr + symbol->n_un.n_strx;
    26212621  p = strchr (str, ':');
    26222622  if (p == NULL)
     
    26272627  name[n] = 0;
    26282628
    2629   proc_start_addr = symbol->value;
     2629  proc_start_addr = symbol->n_value;
    26302630
    26312631  if (args_grow.count == 0)
     
    26462646  make_type (t2, &ti);
    26472647  sst_start (cplusplus_flag ? SST_CPPproc : SST_proc);
    2648   r.address = sst.size;
    2649   buffer_dword (&sst, symbol->value); /* Segment offset */
     2648  r.r_address = sst.size;
     2649  buffer_dword (&sst, symbol->n_value); /* Segment offset */
    26502650  buffer_word (&sst, ti);       /* Type index */
    26512651  proc_patch_base = sst.size;
     
    26602660    buffer_nstr (&sst, name);   /* Proc name */
    26612661  sst_end ();
    2662   r.ext = 0;
    2663   r.length = 2;
    2664   r.symbolnum = N_TEXT;
    2665   r.pcrel = 0;
    2666   r.unused = 0;
     2662  r.r_extern = 0;
     2663  r.r_length = 2;
     2664  r.r_symbolnum = N_TEXT;
     2665  r.r_pcrel = 0;
     2666  r.r_pad = 0;
    26672667  buffer_mem (&sst_reloc, &r, sizeof (r));
    26682668}
     
    26772677  lbrac_index = -1;
    26782678  for (; i < sym_count; ++i)
    2679     if (sym_ptr[i].type == N_RBRAC || is_fun (&sym_ptr[i]))
     2679    if (sym_ptr[i].n_type == N_RBRAC || is_fun (&sym_ptr[i]))
    26802680      return;
    2681     else if (sym_ptr[i].type == N_LBRAC)
     2681    else if (sym_ptr[i].n_type == N_LBRAC)
    26822682      {
    26832683        lbrac_index = i;
    2684         block_begin (sym_ptr[i].value);
     2684        block_begin (sym_ptr[i].n_value);
    26852685        return;
    26862686      }
     
    27152715      memcpy (name, str, n);
    27162716      name[n] = 0;
    2717 #if defined (DEBUG)
     2717#if defined (HLL_DEBUG)
    27182718      printf ("%s %s\n", msg, str);
    27192719#endif
     
    27272727          ++parse_ptr;
    27282728          ti = hll_type ();
    2729 #if defined (DEBUG)
     2729#if defined (HLL_DEBUG)
    27302730          printf ("  type=%#x\n", ti);
    27312731#endif
     
    27362736              return;
    27372737            }
    2738           if (sym2->type == N_EXT)
     2738          if (sym2->n_type == N_EXT)
    27392739            sst_static (name, 0, ti, sym2 - sym_ptr, 1);
    27402740          else
    2741             sst_static (name, sym2->value, ti, sym2->type, 0);
     2741            sst_static (name, sym2->n_value, ti, sym2->n_type, 0);
    27422742          break;
    27432743
     
    27552755          ++parse_ptr;
    27562756          ti = hll_type ();
    2757 #if defined (DEBUG)
     2757#if defined (HLL_DEBUG)
    27582758          printf ("  type=%#x\n", ti);
    27592759#endif
    2760           sst_static (name, symbol->value, ti, where, 0);
     2760          sst_static (name, symbol->n_value, ti, where, 0);
    27612761          break;
    27622762
     
    27742774            {
    27752775              ti = hll_type ();
    2776 #if defined (DEBUG)
     2776#if defined (HLL_DEBUG)
    27772777              printf ("  type=%#x\n", ti);
    27782778#endif
    27792779              sst_start (SST_auto);
    2780               buffer_dword (&sst, symbol->value);  /* Offset into stk frame */
     2780              buffer_dword (&sst, symbol->n_value);/* Offset into stk frame */
    27812781              buffer_word (&sst, ti);              /* Type index */
    27822782              buffer_nstr (&sst, name);            /* Symbol name */
     
    28022802          ++parse_ptr;
    28032803          ti = hll_type ();
    2804           switch (symbol->value)
     2804          switch (symbol->n_value)
    28052805            {
    28062806            case 0:             /* EAX */
     
    28532853              break;
    28542854            default:
    2855               warning ("unknown register %lu", symbol->value);
     2855              warning ("unknown register %lu", symbol->n_value);
    28562856              return;
    28572857            }
     
    28742874            }
    28752875          ti = hll_type ();
    2876 #if defined (DEBUG)
     2876#if defined (HLL_DEBUG)
    28772877          printf ("  type=%#x\n", ti);
    28782878#endif
    28792879          sst_start (SST_auto);
    2880           buffer_dword (&sst, symbol->value);    /* Offset into stk frame */
     2880          buffer_dword (&sst, symbol->n_value);  /* Offset into stk frame */
    28812881          buffer_word (&sst, ti);                /* Type index */
    28822882          buffer_nstr (&sst, name);              /* Symbol name */
     
    29062906          last_fun_valid = TRUE;
    29072907          args_grow.count = 0;
    2908           last_fun_addr = symbol->value;
     2908          last_fun_addr = symbol->n_value;
    29092909          prologue_length = -1;
    29102910
    2911           for (i = *index + 1; i < sym_count && sym_ptr[i].type == N_PSYM; ++i)
     2911          for (i = *index + 1; i < sym_count && sym_ptr[i].n_type == N_PSYM; ++i)
    29122912            parse_symbol (&i, -1, "PSYM", FALSE);
    29132913
     
    29202920            {
    29212921              if (prologue_length == -1)
    2922                 prologue_length = sym_ptr[lbrac_index].value - last_fun_addr;
     2922                prologue_length = sym_ptr[lbrac_index].n_value - last_fun_addr;
    29232923            }
    29242924
    29252925          /* Parameters */
    29262926
    2927           while (*index + 1 < sym_count && sym_ptr[*index+1].type == N_PSYM)
     2927          while (*index + 1 < sym_count && sym_ptr[*index+1].n_type == N_PSYM)
    29282928            {
    29292929              ++(*index);
     
    29992999static void write_changseg (void)
    30003000{
    3001   struct reloc r;
     3001  struct relocation_info r;
    30023002
    30033003  sst_start (SST_changseg);
    3004   r.address = sst.size;
     3004  r.r_address = sst.size;
    30053005  buffer_word (&sst, 0);        /* Segment number */
    30063006  buffer_word (&sst, 0);        /* Reserved */
    30073007  sst_end ();
    3008   r.ext = 0;
    3009   r.length = 1;
    3010   r.symbolnum = N_TEXT;
    3011   r.pcrel = 0;
    3012   r.unused = 0;
     3008  r.r_extern = 0;
     3009  r.r_length = 1;
     3010  r.r_symbolnum = N_TEXT;
     3011  r.r_pcrel = 0;
     3012  r.r_pad = 0;
    30133013  buffer_mem (&sst_reloc, &r, sizeof (r));
    30143014}
     
    30393039
    30403040  for (i = 0; i < sym_count; ++i)
    3041     switch (sym_ptr[i].type)
     3041    switch (sym_ptr[i].n_type)
    30423042      {
    30433043      case N_LSYM:
     
    30643064  lbrac_index = -1; block_grow.count = 0; proc_patch_base = 0;
    30653065  for (i = 0; i < sym_count; ++i)
    3066     switch (sym_ptr[i].type)
     3066    switch (sym_ptr[i].n_type)
    30673067      {
    30683068      case N_LSYM:
     
    30883088      case N_LBRAC:
    30893089        if (lbrac_index == -1)  /* N_LBRAC without local symbols */
    3090           block_begin (sym_ptr[i].value);
     3090          block_begin (sym_ptr[i].n_value);
    30913091        else if (i != lbrac_index)
    30923092          warning ("Invalid N_LBRAC");
Note: See TracChangeset for help on using the changeset viewer.