Changeset 721


Ignore:
Timestamp:
Sep 24, 2003, 8:32:26 PM (22 years ago)
Author:
bird
Message:

#456: Special hack for global variable - defined and undefines.

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.19 to 1.20
    r720 r721  
    597597      case ty_memfunc:      uhash = (unsigned)t->d.memfunc.type; break;
    598598      case ty_baseclass:    uhash = (unsigned)t->d.baseclass.type; break;
     599      default:break; /* shut up warnings. */
    599600    }
    600601  uhash += t->tag;
     
    32193220  char *name;
    32203221  const char *str, *p;
    3221   const struct nlist *symbol, *sym2;
     3222  const struct nlist *symbol;
    32223223  struct type *t1;
    32233224  int i, n, ti, alloc_flag;
     
    32393240        {
    32403241        case 'G':
     3242          /* Static storage, global scope */
     3243          #if 1 /* birds ugly hacking of 'G' allow this code path. */
     3244          if (where == -1)
     3245            {
     3246              /* I really hope this works! */
     3247              where = symbol->n_type == N_FUN ? N_TEXT : N_DATA;
     3248            }
     3249          if (symbol->n_value == -12357)
     3250            { /* Special hack for unresolved external variables.
     3251                 We expect the previous two symbols to be an alias for the
     3252                 undefined symbol. The first of them will then have the name
     3253                 of this record with an $hll$ suffix. */
     3254              if (   *index >= 2
     3255                  && symbol[-2].n_type == (N_INDR | N_EXT)
     3256                  && symbol[-1].n_type == N_EXT
     3257                  && strstr(str_ptr + symbol[-2].n_un.n_strx, "$hll$"))
     3258                {
     3259                  ++parse_ptr;
     3260                  ti = hll_type ();
     3261#if defined (HLL_DEBUG)
     3262                  printf ("  type=%#x\n", ti);
     3263#endif
     3264                  sst_static (name, 0, ti, *index - 1, 1);
     3265                }
     3266              else
     3267                {
     3268                  warning ("Cannot find address of external variable %s", name);
     3269                  return;
     3270                }
     3271              break;
     3272            }
     3273          /* fall thru */
     3274
     3275          #else
    32413276          {
    32423277          char *psz;
    32433278          int   cch;
    3244           /* Static storage, global scope */
     3279          const struct nlist *sym2;
    32453280
    32463281          ++parse_ptr;
     
    32493284          printf ("  type=%#x\n", ti);
    32503285#endif
    3251 
    32523286          psz = alloca(cch = strlen(name) + 2);
    32533287          *psz = '_';
     
    32653299          break;
    32663300          }
     3301          #endif
    32673302
    32683303        case 'S':
Note: See TracChangeset for help on using the changeset viewer.