f->length *= 2;
f->vector = (struct type **)
xrealloc (f->vector, f->length * sizeof (struct type *));
- bzero (&f->vector[f->length / 2],
- f->length * sizeof (struct type *) / 2);
+ memset (&f->vector[f->length / 2],
+ '\0', f->length * sizeof (struct type *) / 2);
}
return &f->vector[index];
}
return result;
}
-/* Close off the current usage of a partial_symbol table entry. This
- involves setting the correct number of includes (with a realloc),
- setting the high text mark, setting the symbol length in the
- executable, and setting the length of the global and static lists
- of psymbols.
+/* Close off the current usage of PST.
+ Returns PST or NULL if the partial symtab was empty and thrown away.
- The global symbols and static symbols are then seperately sorted.
+ FIXME: List variables and peculiarities of same. */
- Then the partial symtab is put on the global list.
- *** List variables and peculiarities of same. ***
- */
-
-void
+struct partial_symtab *
end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
capping_text, dependency_list, number_dependencies)
struct partial_symtab *pst;
pst->next = pst->objfile->free_psymtabs;
pst->objfile->free_psymtabs = pst;
+
+ /* Indicate that psymtab was thrown away. */
+ pst = (struct partial_symtab *)NULL;
}
+ return pst;
}
\f
static void
unsigned char type;
unsigned max_symnum;
register bfd *abfd;
- struct symtab *rtn;
struct objfile *objfile;
int sym_offset; /* Offset to start of symbols to read */
int sym_size; /* Size of symbols to read */
.stab "foo:V...",N_STSYM is relative (section base subtracted).
This leaves us no choice but to search for the 'S' or 'V'...
(or pass the whole section_offsets stuff down ONE MORE function
- call level, which we really don't want to do). */
+ call level, which we really don't want to do).
+
+ The above is indeed true for Solaris 2.1. I'm not sure what
+ happens in Solaris 2.3, in which ld stops relocating stabs. */
{
char *p;
p = strchr (name, ':');
{
/* FIXME! We relocate it by the TEXT offset, in case the
whole module moved in memory. But this is wrong, since
- the sections can side around independently. */
+ the sections can side around independently. (I suspect that
+ the text offset is always zero anyway--elfread.c doesn't
+ process (and Sun cc doesn't produce) Ttext.text symbols). */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
goto define_a_symbol;
}
previous function. This means that we can use the
minimal symbol table to get the address. */
- if (type == N_GSYM || type == N_STSYM)
+ /* On solaris up to 2.2, the N_FUN stab gets relocated.
+ On Solaris 2.3, ld no longer relocates stabs (which
+ is good), and the N_FUN's value is now always zero.
+ We only provide this correction for functions, not for
+ all N_FUN symbols, because that is easiest and all
+ readonly variables seem to go in the .rodata on Solaris. */
+
+ if (type == N_GSYM || type == N_STSYM
+ || (type == N_FUN && valu == 0))
{
struct minimal_symbol *m;
int l = colon_pos - name;
DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
DBX_SYMTAB_OFFSET (objfile) = staboffset;
- if (stabstrsize < 0 /* FIXME: stabstrsize is unsigned; never true! */
- || stabstrsize > bfd_get_size (sym_bfd))
+ if (stabstrsize > bfd_get_size (sym_bfd))
error ("ridiculous string table size: %d bytes", stabstrsize);
DBX_STRINGTAB (objfile) = (char *)
obstack_alloc (&objfile->psymbol_obstack, stabstrsize+1);