Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
7 7u83 2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
11
 *    this list of conditions and the following disclaimer in the documentation
12
 *    and/or other materials provided with the distribution.
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific, prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * $Id$
30
 */
31
/*
2 7u83 32
    		 Crown Copyright (c) 1997
7 7u83 33
 
2 7u83 34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
7 7u83 42
 
2 7u83 43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
7 7u83 45
 
2 7u83 46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
7 7u83 49
 
2 7u83 50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
7 7u83 53
 
2 7u83 54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
#ifndef lint
62
static char vcid[] = "nil";
63
#endif /* lint */
64
/*
65
  symbol.c
66
 
67
  This file contains code to generate the alpha symbol table
7 7u83 68
  (the .t file).  This code is based on the MIPS translator file
2 7u83 69
  new_symbol.c
70
*/
71
 
72
/*
73
$Log: symbol.c,v $
74
 * Revision 1.2  1998/02/04  10:43:32  release
75
 * Changes during testing.
76
 *
77
 * Revision 1.1.1.1  1998/01/17  15:56:01  release
78
 * First version to be checked into rolling release.
79
 *
80
 * Revision 1.4  1995/08/21  08:46:39  john
81
 * Changed include files
82
 *
83
 * Revision 1.3  1995/05/16  10:55:52  john
84
 * Cosmetic changes
85
 *
86
 * Revision 1.2  1995/04/07  11:06:12  john
87
 * Renamed some parameters
88
 *
89
 * Revision 1.1.1.1  1995/03/23  10:39:30  john
90
 * Entered into CVS
91
 *
92
 * Revision 1.4  1995/01/31  14:26:22  john
93
 * Variour portability improvements
94
 *
95
 * Revision 1.3  1995/01/12  15:10:27  john
96
 * Changed error messages
97
 *
98
*/
99
 
100
 
101
#include "config.h"
7 7u83 102
#include "symtab.h" 	/* type definitions for translator
103
			   produced debugging information
2 7u83 104
			   to be incorporated into a .T file */
105
#include "bstack.h"
106
#include "makesymtab.h"
107
#include "xalloc.h"
108
#include "common_types.h"
109
#include "diagtypes.h"
110
#include "expmacs.h"
111
#include "symbol.h"
112
#include "type_to_aux.h"
113
#include "cross_config.h"
114
extern  char diagnose;
115
 
116
#ifndef CROSS_INCLUDE
117
#include <symconst.h>
118
#else
119
#include CROSS_INCLUDE/symconst.h>
120
#endif
121
 
122
 
7 7u83 123
/* Procedures to accumulate symbol table records for MIPS translator
2 7u83 124
 
125
   new_lsym
126
   new_lsym_d
127
   new_esym
128
   new_esym_d
129
 
130
   and to output the table
131
 
132
   output_symtab(name)
133
 
134
   by R.R.R.  25/1/91	*/
135
 
136
int numfiles;
137
int numprocs;	/* provided by mipstrans in call to init */
138
 
139
 
140
DENSETAB *dense_numbers, *densenos;
141
STRINGS* extstrings, *external_strings;
142
ESYMS* esymlist, *external_symbols;
143
 
144
pSYMFDR fdrlist, file_desc_table;
145
LSYMS* local_symbols;
146
STRINGS* local_strings;
147
AUXTAB* aux_symbols;
148
BSTACK* blockstack;
149
 
7 7u83 150
int add_aux(AUXU,int);
151
 
2 7u83 152
int* file_inds;
153
int* aux_inds;
154
int* str_inds;
155
int* sym_inds;
156
 
157
PROCSYM* proc_isym_inds;
158
 
159
int nosyms = 0;
160
int stringsize = 0;
161
int nostrings=0;
162
int noaux = 0;
163
int densind = 0;
164
int esymindex = 0;
7 7u83 165
int extind=0;
2 7u83 166
 
167
 
168
void init_table_space
7 7u83 169
(int noofiles, int noprocs)
2 7u83 170
{
171
  int ind=0;
172
  AUXU nilaux;
173
  nilaux.isym=0;
174
  blockstack= (BSTACK*)xcalloc(noofiles,sizeof(BSTACK));
7 7u83 175
  if (noofiles==0)alphafail(NO_DIAGNOSTICS_IN_TDF);
176
  densenos= (DENSETAB*)xcalloc(1,sizeof(DENSETAB));
2 7u83 177
  densenos->num = 0;
178
  densenos->densenolist = (pDNR)xcalloc(DENSETABSIZE,sizeof(DNR));
179
  densenos->moredensenos= (DENSETAB*)0;
180
  dense_numbers=densenos;
7 7u83 181
 
182
  extstrings= (STRINGS*)xcalloc(1,sizeof(STRINGS));
183
  extstrings->str= (char*)xcalloc(STRINGTABSIZE,sizeof(char));
2 7u83 184
  extstrings->usage=0;
7 7u83 185
  extstrings->overspill= (STRINGS*)0;
2 7u83 186
  external_strings=extstrings;
7 7u83 187
 
188
  esymlist= (ESYMS*)xcalloc(1,sizeof(ESYMS));
189
  esymlist->symlist= (pEXTR)xcalloc(SYMTABSIZE,sizeof(EXTR));
2 7u83 190
  esymlist->noofsyms=0;
7 7u83 191
  esymlist->nextsyms= (ESYMS*)0;
2 7u83 192
  external_symbols=esymlist;
7 7u83 193
 
2 7u83 194
  numfiles=noofiles;
195
  numprocs=noprocs;
7 7u83 196
  file_inds = (int*)xcalloc(noofiles,sizeof(int));
197
  aux_inds = (int*)xcalloc(noofiles,sizeof(int));
198
  str_inds = (int*)xcalloc(noofiles,sizeof(int));
199
  sym_inds = (int*)xcalloc(noofiles,sizeof(int));
200
  proc_isym_inds = (PROCSYM*)xcalloc(noprocs,sizeof(PROCSYM));
201
 
2 7u83 202
  fdrlist = (pSYMFDR)xcalloc(noofiles,sizeof(SYMFDR));
203
  file_desc_table = fdrlist;
7 7u83 204
 
2 7u83 205
  local_symbols = (LSYMS*)xcalloc(noofiles,sizeof(LSYMS));
206
  local_symbols->symlist = (pSYMR)xcalloc(noofiles*SYMTABSIZE,sizeof(SYMR));
7 7u83 207
 
2 7u83 208
  local_strings = (STRINGS*)xcalloc(noofiles,sizeof(STRINGS));
209
  local_strings->str = (char*)xcalloc(noofiles*STRINGTABSIZE,sizeof(char));
7 7u83 210
 
211
  aux_symbols= (AUXTAB*)xcalloc(noofiles,sizeof(AUXTAB));
212
  aux_symbols->auxinfo= (pAUXU)xcalloc(noofiles*AUXTABSIZE,sizeof(AUXU));
213
 
214
  for (ind=0; ind<noofiles;ind++,fdrlist++) {
2 7u83 215
    fdrlist->symbols=local_symbols+ind;
216
    fdrlist->filestr=local_strings+ind;
217
    fdrlist->auxtabs=aux_symbols+ind;
218
    fdrlist->proc_count=0;
7 7u83 219
   (local_symbols+ind) ->symlist=local_symbols->symlist+ind*SYMTABSIZE;
220
   (local_strings+ind) ->str=local_strings->str+ind*STRINGTABSIZE;
221
   (aux_symbols+ind) ->auxinfo=aux_symbols->auxinfo+ind*AUXTABSIZE;
2 7u83 222
    add_aux(nilaux,ind);	/* for each file add nilaux so no 0 */
223
  }
7 7u83 224
 
2 7u83 225
}
226
 
7 7u83 227
 
2 7u83 228
void add_proc
7 7u83 229
(int sympos, int filenum)
2 7u83 230
{
231
  static int symcount=0;
232
  pSYMFDR fdrlist=file_desc_table+filenum;
233
  fdrlist->proc_count+=1;
7 7u83 234
 (proc_isym_inds+symcount) ->procsymindex=sympos;
235
 (proc_isym_inds+symcount) ->fnum=filenum;
2 7u83 236
  symcount++;
237
}
238
 
239
 
240
 
7 7u83 241
 
2 7u83 242
/*********************  STRING procedures  ********************/
243
 
244
int add_string
7 7u83 245
(char *str, STRINGS *list)
2 7u83 246
{
247
  int stringind=list->usage;
7 7u83 248
  int length = strlen(str) +1;
249
  while (list->overspill!=0) {
2 7u83 250
    list=list->overspill;
251
    stringind+=list->usage;
252
  }
7 7u83 253
  if ((list->usage+length) >STRINGTABSIZE) {
2 7u83 254
    list->overspill = (STRINGS*)xcalloc(1,sizeof(STRINGS));
255
    list=list->overspill;
7 7u83 256
    list->str= (char*)xcalloc(STRINGTABSIZE,sizeof(char));
2 7u83 257
    list->usage=length;
258
    strcpy(list->str,str);
259
  }
7 7u83 260
  else{
2 7u83 261
    strcpy(list->str+list->usage,str);
262
    list->usage+=length;
263
  }
264
  return stringind;
265
}
266
 
267
 
268
int add_to_loc_strings
7 7u83 269
(char *locstr, int index)
2 7u83 270
{
7 7u83 271
  stringsize+=strlen(locstr) +1;
2 7u83 272
  nostrings++;
273
  return(add_string(locstr, local_strings+index));
274
}
275
 
276
 
277
 
278
int add_to_ext_strings
7 7u83 279
(char *extstr)
2 7u83 280
{
281
  int posind=extind;
282
  add_string(extstr, extstrings);
7 7u83 283
  extind+=strlen(extstr) +1;
2 7u83 284
  return(posind);
285
}
286
 
287
 
288
/******************  DENSE NUMBERS  ********************/
289
 
290
 
291
int add_dense_no
7 7u83 292
(int rfd, int index)
2 7u83 293
{
294
  DNR* curr_dense;
295
  DENSETAB* denseptr= densenos;
7 7u83 296
  while (denseptr->moredensenos) {
2 7u83 297
    denseptr=denseptr->moredensenos;
298
  }
7 7u83 299
  if (denseptr->num==DENSETABSIZE) {
2 7u83 300
    denseptr->moredensenos = (DENSETAB*)xcalloc(1,sizeof(DENSETAB));
301
    denseptr=denseptr->moredensenos;
302
    denseptr->num = 0;
303
    denseptr->densenolist = (pDNR)xcalloc(DENSETABSIZE,sizeof(DNR));
304
    denseptr->moredensenos = (DENSETAB*)0;
305
  }
7 7u83 306
  curr_dense= (denseptr->densenolist) +denseptr->num;
2 7u83 307
  curr_dense->rfd = rfd;
308
  curr_dense->index = index;
309
  denseptr->num+=1;
310
  densind++;
7 7u83 311
  return(densind-1);
2 7u83 312
}
313
 
314
DNR * get_dense_ptr
7 7u83 315
(int densind)
2 7u83 316
{
317
  DENSETAB* denseptr = densenos;
318
  int densecount=denseptr->num;
7 7u83 319
  while (densecount<=densind) {
2 7u83 320
    denseptr=denseptr->moredensenos;
321
    densecount+=denseptr->num;
322
  }
7 7u83 323
  return(denseptr->densenolist+ (denseptr->num- (densecount-densind)));
2 7u83 324
}
325
 
326
 
327
/********************  SYMBOL PROCEDURES  ********************/
328
 
329
int get_sym_index
7 7u83 330
(int ind)
2 7u83 331
{
332
  LSYMS* lsymlist=local_symbols+ind;
333
  int lsymindex = lsymlist->noofsyms;
7 7u83 334
  while (lsymlist->nextsyms!=0) {
2 7u83 335
    lsymlist=lsymlist->nextsyms;
336
    lsymindex+=lsymlist->noofsyms;
7 7u83 337
  }
338
  return(lsymindex);
339
}
2 7u83 340
 
341
SYMR * get_sym_ptr
7 7u83 342
(int ind, int symind)
2 7u83 343
{
344
  LSYMS* lsymlist=local_symbols+ind;
345
  int symcount=lsymlist->noofsyms;
7 7u83 346
  while (symcount<=symind) {
2 7u83 347
    lsymlist=lsymlist->nextsyms;
348
    symcount+=lsymlist->noofsyms;
349
  }
7 7u83 350
  return(lsymlist->symlist+ (lsymlist->noofsyms- (symcount-symind)));
2 7u83 351
}
352
 
353
 
354
 
355
int add_lsym
7 7u83 356
(int ind, SYMR *newsym)
2 7u83 357
{
358
  LSYMS* lsymlist=local_symbols+ind;
359
  int lsymindex = lsymlist->noofsyms;
360
  nosyms++;
7 7u83 361
  while (lsymlist->nextsyms!=0) {
2 7u83 362
    lsymlist=lsymlist->nextsyms;
363
    lsymindex+=lsymlist->noofsyms;
364
  }
7 7u83 365
  if (lsymlist->noofsyms==SYMTABSIZE) {
366
    lsymlist->nextsyms= (LSYMS*)xcalloc(1,sizeof(LSYMS));
2 7u83 367
    lsymlist=lsymlist->nextsyms;
7 7u83 368
    lsymlist->symlist= (pSYMR)xcalloc(SYMTABSIZE,sizeof(SYMR));
2 7u83 369
    lsymlist->noofsyms=0;
7 7u83 370
    lsymlist->nextsyms= (LSYMS*)0;
2 7u83 371
  }
7 7u83 372
  *(lsymlist->symlist+lsymlist->noofsyms) = (*newsym);
2 7u83 373
  lsymlist->noofsyms += 1;
7 7u83 374
  return(lsymindex);
2 7u83 375
}
376
 
377
 
378
int add_esym
7 7u83 379
(int ind, SYMR *newsym)
2 7u83 380
{
7 7u83 381
  if (esymlist->noofsyms==SYMTABSIZE) {
382
    esymlist->nextsyms= (ESYMS*)xcalloc(1,sizeof(ESYMS));
2 7u83 383
    esymlist=esymlist->nextsyms;
7 7u83 384
    esymlist->symlist= (pEXTR)xcalloc(SYMTABSIZE,sizeof(EXTR));
2 7u83 385
    esymlist->noofsyms=0;
7 7u83 386
    esymlist->nextsyms= (ESYMS*)0;
2 7u83 387
  }
7 7u83 388
 (esymlist->symlist+esymlist->noofsyms) ->ifd = ind;
389
 (esymlist->symlist+esymlist->noofsyms) ->asym= (*newsym);
2 7u83 390
  esymlist->noofsyms += 1;
391
  esymindex++;
392
  return(esymindex-1);
7 7u83 393
}
2 7u83 394
 
7 7u83 395
AUXU* get_aux_ptr(int, int);
2 7u83 396
 
397
int new_lsym
7 7u83 398
(char *chars, int value, int symtype, int symclass, diag_type s, int filenum)
2 7u83 399
{
400
  SYMR newsym;
401
  AUXU nilaux;
402
  int strind, symindex;
403
  nilaux.isym=0;
404
  symindex = get_sym_index(filenum);
405
  newsym.value = value;
406
  newsym.st = symtype;
407
  newsym.sc = symclass;
408
/* do the following as a switch statment */
409
 
7 7u83 410
  if (symtype == stEnd) {
2 7u83 411
    SYMSTR symstrind;
412
    int isymstart;
413
    symstrind = pop(blockstack+filenum);
414
    isymstart = symstrind.sym;
415
    if (symstrind.str>0)
7 7u83 416
    {newsym.iss = symstrind.str;}
417
    else {newsym.iss = 0 ;}
418
    if (isymstart<0) {
419
      newsym.index= (-isymstart);
2 7u83 420
      get_aux_ptr(filenum,
7 7u83 421
		  get_sym_ptr(filenum, -isymstart) ->index) ->isym=symindex+1;
2 7u83 422
    }
423
    else{
7 7u83 424
      get_sym_ptr(filenum, isymstart) ->index=symindex+1;
2 7u83 425
      newsym.index=isymstart;
426
    }
427
 
428
    /* (((local_symbols + filenum)->symlist)+newsym.index)->index = symindex+1; */
429
  }
430
 
7 7u83 431
  else if (symtype == stFile) {
2 7u83 432
    add_aux(nilaux,filenum);
433
    strind=add_to_loc_strings(chars,filenum);
434
    newsym.iss = strind;
435
    push(symindex, strind, blockstack+filenum);
436
    /* newsym.index filled in later by stEnd  */
437
  }
7 7u83 438
  else if (symtype == stBlock) {
439
    if (chars) {strind=add_to_loc_strings(chars,filenum);}
2 7u83 440
    else {strind = 0;}
441
    push(symindex, strind, blockstack+filenum);
442
    newsym.iss = strind;
443
    /* newsym.index filled in later by stEnd  */
444
  }
445
 
446
  else if (symtype == stLabel /*|| symtype == stMember and enum???*/ ){
447
    newsym.index = 0;
448
    newsym.iss = add_to_loc_strings(chars,filenum);
449
  }
450
 
7 7u83 451
  else	if (symtype==stProc) {
2 7u83 452
    DNR* procdense=get_dense_ptr(value);
453
    strind=add_to_loc_strings(chars,filenum);
454
    newsym.value=0;	/* not needed now */
455
/* add esym but with lsymindex as index not aux or isymMac */
456
    newsym.iss = add_to_ext_strings(chars);
457
    newsym.index=symindex;
458
    procdense->rfd=0x7fffffff;
459
    procdense->index=add_esym(filenum, &newsym);
460
    newsym.iss=strind;
461
    newsym.index=add_aux(nilaux,filenum);
462
    push(-symindex, strind, blockstack+filenum);
463
    /*AUX to be filled in at stEnd */
464
    add_proc(symindex,filenum);	/* all are scText */
465
    add_aux(nilaux,filenum);	/* add nil type !! */
466
  }
467
 
468
  else if (symtype==stStaticProc) {
469
    DNR* procdense=get_dense_ptr(value);
470
    strind=add_to_loc_strings(chars,filenum);
471
    newsym.iss=strind;
472
    newsym.value = 0;	/* not needed now */
473
/* add esym but with lsymindex as index not aux or isymMac */
474
    procdense->rfd=filenum;
475
    procdense->index=symindex;
476
    newsym.index=add_aux(nilaux,filenum);
477
    push(-symindex, strind, blockstack+filenum);
7 7u83 478
    add_proc(symindex, filenum);
2 7u83 479
    add_aux(nilaux,filenum);	/* add nil type !! */
480
  }
7 7u83 481
  else if (!diagnose) {
2 7u83 482
    newsym.index = 1048575;
483
    newsym.iss = add_to_loc_strings(chars,filenum);
484
  }
485
  else{
486
    newsym.iss = add_to_loc_strings(chars,filenum);
487
    newsym.index = add_type_to_aux(s, filenum);
488
  }
7 7u83 489
  return(add_lsym(filenum, &newsym));
2 7u83 490
}
491
 
492
 
493
int new_lsym_d
7 7u83 494
(char *chars, int value, int symtype, int symclass, diag_type s, int filenum)
2 7u83 495
{
7 7u83 496
  return(add_dense_no(filenum,new_lsym(chars, value, symtype, symclass,s,
2 7u83 497
					filenum)));
7 7u83 498
 
2 7u83 499
}
500
 
501
 
502
int new_esym
7 7u83 503
(char *chars, int value, int symtype, int symclass, diag_type s, int filenum)
2 7u83 504
{
505
  SYMR newsym;
506
  int strind=add_to_ext_strings(chars);
507
  newsym.iss = strind;
508
  newsym.value = value;
509
  newsym.st = symtype;
510
  newsym.reserved = 0;
511
  newsym.sc = symclass;
7 7u83 512
 
513
  if (((symtype==stProc) && (symclass==scNil ||symclass==scUndefined))
514
      || (!diagnose)) {
2 7u83 515
    /* no diagnostics  */
516
    newsym.index=1048575;
517
    newsym.value=0;
518
  }
519
  else{
520
    newsym.index=add_type_to_aux(s,filenum);
521
  }
7 7u83 522
  return add_esym(filenum, &newsym);
2 7u83 523
}
524
 
525
 
526
int new_esym_d
7 7u83 527
(char *chars, int value, int symtype, int symclass, diag_type s, int filenum)
2 7u83 528
{
529
  return(add_dense_no(0x7fffffff,new_esym(chars, value, symtype, symclass, s
530
					  , filenum)));
531
}
532
 
533
 
534
/********************* Auxillary information  ********************/
535
 
536
AUXU * get_aux_ptr
7 7u83 537
(int index, int auxind)
2 7u83 538
{
539
  AUXTAB* auxdata;
540
  int auxcount;
541
  auxdata=aux_symbols+index;
542
  auxcount=auxdata->num;
7 7u83 543
  while (auxcount<auxind) {
544
    auxdata=auxdata->moreaux;
2 7u83 545
    auxcount+=auxdata->num;
546
  }
7 7u83 547
  return(auxdata->auxinfo+ (auxdata->num- (auxcount-auxind)));
2 7u83 548
}
549
 
550
 
551
int add_aux
7 7u83 552
(AUXU auxent, int index)
2 7u83 553
{
554
  AUXTAB* auxdata;
555
  int auxind;
556
  noaux++;
557
  auxdata=aux_symbols+index;
558
  auxind=auxdata->num;
7 7u83 559
  while (auxdata->moreaux!=0) {
2 7u83 560
    auxdata=auxdata->moreaux;
561
    auxind+=auxdata->num;
562
  }
7 7u83 563
  if (auxdata->num==AUXTABSIZE) {
564
    auxdata->moreaux= (AUXTAB*)xcalloc(1,sizeof(AUXTAB));
2 7u83 565
    auxdata=auxdata->moreaux;
7 7u83 566
    auxdata->auxinfo= (pAUXU)xcalloc(AUXTABSIZE,sizeof(AUXU));
567
    auxdata->moreaux= (AUXTAB*)0;
2 7u83 568
    auxdata->num=0;
569
  }
7 7u83 570
  *((auxdata->auxinfo) +auxdata->num) = auxent;
2 7u83 571
  auxdata->num+=1;
572
  auxind++;
7 7u83 573
  return(auxind-1);
2 7u83 574
}
575
 
576
 
577
int add_st_aux
7 7u83 578
(int ind)
2 7u83 579
{
580
  AUXU straux;
581
  AUXU maxaux;
582
  int indaux;
583
  maxaux.count=0xffffffff;
584
  straux.ti.bt=btStruct;
585
  indaux=add_aux(straux, ind);
586
  add_aux(maxaux, ind);
587
  add_aux(maxaux, ind);
588
  return indaux;
589
}
7 7u83 590
 
2 7u83 591
int add_un_aux
7 7u83 592
(int ind)
2 7u83 593
{
594
  AUXU uniaux;
595
  AUXU maxaux;
596
  int indaux;
597
  maxaux.count=0xffffffff;
598
  uniaux.ti.bt=btUnion;
7 7u83 599
  indaux=add_aux(uniaux, ind);
2 7u83 600
  add_aux(maxaux, ind);
601
  add_aux(maxaux, ind);
602
  return indaux;
603
}
604
 
605
 
606
void output_symtab
7 7u83 607
(char *symfilename)
2 7u83 608
{
609
  /* end all the files */
610
  int i;
611
 
612
  for (i=0;i<numfiles;i++){	/* might need the iss */
613
    new_lsym("",0,stEnd,scText,(diag_type)0,i);
614
  }
615
 
7 7u83 616
  makesymtab(external_strings, external_symbols, dense_numbers,
617
	     file_desc_table, numfiles, symfilename, esymindex, nosyms,
2 7u83 618
	     extind, stringsize, noaux, densind, proc_isym_inds, numprocs);
619
 
620
  return;
7 7u83 621
 
2 7u83 622
}
623
 
624
 
625
 
626
 
627
 
628
 
629
 
7 7u83 630