Add OBJF_SYMS flag and use it to decide whether or not we have already

tried to read symbols from a file, for mapped objfiles.  This fixes a
memory leak (actually a constant memory growth) due to reading symbol
files with no debug info and thus generating no psymtabs or symtabs.
Most typically happened with shared libraries.
This commit is contained in:
Fred Fish
1992-03-28 21:06:23 +00:00
parent c2e4669f8c
commit bf349b77fa
3 changed files with 60 additions and 51 deletions

View File

@@ -236,6 +236,15 @@ struct objfile
#define OBJF_MAPPED (1 << 0) /* Objfile data is mmap'd */
/* When using mapped/remapped predigested gdb symbol information, we need
a flag that indicates that we have previously done an initial symbol
table read from this particular objfile. We can't just look for the
absence of any of the three symbol tables (msymbols, psymtab, symtab)
because if the file has no symbols for example, none of these will
exist. */
#define OBJF_SYMS (1 << 1) /* Have tried to read symbols */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */