+Wed Nov 6 17:21:59 1991 John Gilmore (gnu at cygnus.com)
+
+ * coffread.c: Eliminate c_nsyms in favor of c_naux.
+ Complain if no auxents on .bf and .ef FCN symbols, and assume
+ lots of line numbers.
+ (init_linenos, enter_linenos): Use a sentinel at the end of the
+ read-in linenos, to make for a fast, safe loop-end test.
+
+Wed Nov 6 02:54:08 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * coffread.c (read_coff_symtab): coffread used to rely on the
+ x_sym.x_misc.x_lnsz.x_lnno field giving the # of linnos in a
+ function. Two of the formats I'm using (29k and 88k) don't seem to
+ set it. Ths patch to fcn_last_line and (enter_linenos) is an
+ attempt to use the actual size of the linno table in the file to set
+ the number of linenos to process.
+
Tue Nov 5 22:47:46 1991 Steve Chamberlain (sac at cygnus.com)
* Makefile.in: put a - infront of the mv y.tab.c c-exp.tab.c and
mv y.tab.c m2-exp.tab.c, so that if bison is used, and the files
are created in place, so the mv fails, then the make continues.
-
Tue Nov 5 16:47:47 1991 Per Bothner (bothner at cygnus.com)
Add C++ as a separate language.
struct complaint ef_complaint =
{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
+struct complaint no_aux_complaint =
+ {"symbol %d without one aux entry", 0, 0};
+
struct complaint lineno_complaint =
{"Line number pointer %d lower than start of line numbers", 0, 0};
struct coff_symbol {
char *c_name;
int c_symnum; /* symbol number of this entry */
- int c_nsyms; /* 1 if syment only, 2 if syment + auxent, etc */
+ int c_naux; /* 0 if syment only, 1 if syment + auxent, etc */
long c_value;
int c_sclass;
int c_secnum;
/* value contains address of first non-init type code */
/* main_aux.x_sym.x_misc.x_lnsz.x_lnno
contains line number of '{' } */
+ if (cs->c_naux != 1)
+ complain (no_aux_complaint, cs->c_symnum);
fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
new = (struct context_stack *)
within_function = 0;
break;
}
- fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
+ if (cs->c_naux != 1) {
+ complain (no_aux_complaint, cs->c_symnum);
+ fcn_last_line = 0x7FFFFFFF;
+ } else {
+ fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
+ }
enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line);
finish_block (new->name, &local_symbols, new->old_blocks,
cs->c_symnum = symnum;
fread (temp_sym, local_symesz, 1, nlist_stream_global);
bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *)sym);
- cs->c_nsyms = (sym->n_numaux & 0xff) + 1;
- if (cs->c_nsyms >= 2)
+ cs->c_naux = sym->n_numaux & 0xff;
+ if (cs->c_naux >= 1)
{
fread (temp_aux, local_auxesz, 1, nlist_stream_global);
bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
(char *)aux);
/* If more than one aux entry, read past it (only the first aux
is important). */
- for (i = 2; i < cs->c_nsyms; i++)
+ for (i = 1; i < cs->c_naux; i++)
fread (temp_aux, local_auxesz, 1, nlist_stream_global);
}
cs->c_name = getsymname (sym);
if (!SDB_TYPE (cs->c_type))
cs->c_type = 0;
- symnum += cs->c_nsyms;
+ symnum += 1 + cs->c_naux;
}
\f
/* Support for string table handling */
if (lseek (chan, offset, 0) < 0)
return -1;
- linetab = (char *) xmalloc (size);
+ /* Allocate the desired table, plus a sentinel */
+ linetab = (char *) xmalloc (size + local_linesz);
val = myread (chan, linetab, size);
if (val != size)
return -1;
+ /* Terminate it with an all-zero sentinel record */
+ bzero (linetab + size, local_linesz);
+
make_cleanup (free, linetab); /* Be sure it gets de-allocated. */
return 0;
}
for (;;) {
bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
rawptr += local_linesz;
+ /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
record_line (first_line + L_LNNO32 (&lptr), lptr.l_addr.l_paddr);
else
/* Define an array type. */
/* auxent refers to array, not base type */
if (aux->x_sym.x_tagndx.l == 0)
- cs->c_nsyms = 1;
+ cs->c_naux = 0;
/* shift the indices down */
dim = &aux->x_sym.x_fcnary.x_ary.x_dimen[0];
}
/* Reference to existing type */
- if (cs->c_nsyms > 1 && aux->x_sym.x_tagndx.l != 0)
+ if (cs->c_naux > 0 && aux->x_sym.x_tagndx.l != 0)
{
type = coff_alloc_type (aux->x_sym.x_tagndx.l);
return type;
register union internal_auxent *aux;
{
if (aux->x_sym.x_tagndx.l == 0)
- cs->c_nsyms = 1; /* auxent refers to function, not base type */
+ cs->c_naux = 0; /* auxent refers to function, not base type */
return decode_type (cs, DECREF (c_type), aux);
}
return builtin_type_double;
case T_STRUCT:
- if (cs->c_nsyms != 2)
+ if (cs->c_naux != 1)
{
/* anonymous structure type */
type = coff_alloc_type (cs->c_symnum);
return type;
case T_UNION:
- if (cs->c_nsyms != 2)
+ if (cs->c_naux != 1)
{
/* anonymous union type */
type = coff_alloc_type (cs->c_symnum);