-#endif /* not __GNU_STAB__ */
-\f
-/* Symbol table */
-
-/* Global symbol data is recorded in these structures,
- one for each global symbol.
- They are found via hashing in 'symtab', which points to a vector of buckets.
- Each bucket is a chain of these structures through the link field. */
-
-typedef
- struct glosym
- {
- /* Pointer to next symbol in this symbol's hash bucket. */
- struct glosym *link;
- /* Name of this symbol. */
- char *name;
- /* Value of this symbol as a global symbol. */
- long value;
- /* Chain of external 'nlist's in files for this symbol, both defs
- and refs. */
- struct nlist *refs;
- /* Any warning message that might be associated with this symbol
- from an N_WARNING symbol encountered. */
- char *warning;
- /* Nonzero means definitions of this symbol as common have been seen,
- and the value here is the largest size specified by any of them. */
- int max_common_size;
- /* For relocatable_output, records the index of this global sym in the
- symbol table to be written, with the first global sym given index 0.*/
- int def_count;
- /* Nonzero means a definition of this global symbol is known to exist.
- Library members should not be loaded on its account. */
- char defined;
- /* Nonzero means a reference to this global symbol has been seen
- in a file that is surely being loaded.
- A value higher than 1 is the n_type code for the symbol's
- definition. */
- char referenced;
- /* A count of the number of undefined references printed for a
- specific symbol. If a symbol is unresolved at the end of
- digest_symbols (and the loading run is supposed to produce
- relocatable output) do_file_warnings keeps track of how many
- unresolved reference error messages have been printed for
- each symbol here. When the number hits MAX_UREFS_PRINTED,
- messages stop. */
- unsigned char undef_refs;
- /* 1 means that this symbol has multiple definitions. 2 means
- that it has multiple definitions, and some of them are set
- elements, one of which has been printed out already. */
- unsigned char multiply_defined;
- /* Nonzero means print a message at all refs or defs of this symbol */
- char trace;
- }
- symbol;
-
-/* Demangler for C++. */
-extern char *cplus_demangle ();
-
-/* Demangler function to use. */
-char *(*demangler)() = NULL;
-
-/* Number of buckets in symbol hash table */
-#define TABSIZE 1009
-
-/* The symbol hash table: a vector of TABSIZE pointers to struct glosym. */
-symbol *symtab[TABSIZE];
-
-/* Number of symbols in symbol hash table. */
-int num_hash_tab_syms = 0;
-
-/* Count the number of nlist entries that are for local symbols.
- This count and the three following counts
- are incremented as as symbols are entered in the symbol table. */
-int local_sym_count;
-
-/* Count number of nlist entries that are for local symbols
- whose names don't start with L. */
-int non_L_local_sym_count;
-
-/* Count the number of nlist entries for debugger info. */
-int debugger_sym_count;
-
-/* Count the number of global symbols referenced and not defined. */
-int undefined_global_sym_count;
-
-/* Count the number of global symbols multiply defined. */
-int multiple_def_count;
-
-/* Count the number of defined global symbols.
- Each symbol is counted only once
- regardless of how many different nlist entries refer to it,
- since the output file will need only one nlist entry for it.
- This count is computed by `digest_symbols';
- it is undefined while symbols are being loaded. */
-int defined_global_sym_count;
-
-/* Count the number of symbols defined through common declarations.
- This count is kept in symdef_library, linear_library, and
- enter_global_ref. It is incremented when the defined flag is set
- in a symbol because of a common definition, and decremented when
- the symbol is defined "for real" (ie. by something besides a common
- definition). */
-int common_defined_global_count;
-
-/* Count the number of set element type symbols and the number of
- separate vectors which these symbols will fit into. See the
- GNU a.out.h for more info.
- This count is computed by 'enter_file_symbols' */
-int set_symbol_count;
-int set_vector_count;
-
-/* Define a linked list of strings which define symbols which should
- be treated as set elements even though they aren't. Any symbol
- with a prefix matching one of these should be treated as a set
- element.
-
- This is to make up for deficiencies in many assemblers which aren't
- willing to pass any stabs through to the loader which they don't
- understand. */
-struct string_list_element {
- char *str;
- struct string_list_element *next;
-};
-
-struct string_list_element *set_element_prefixes;
-
-/* Count the number of definitions done indirectly (ie. done relative
- to the value of some other symbol. */
-int global_indirect_count;
-
-/* Count the number of warning symbols encountered. */
-int warning_count;
-
-/* Total number of symbols to be written in the output file.
- Computed by digest_symbols from the variables above. */
-int nsyms;
-
-
-/* Nonzero means ptr to symbol entry for symbol to use as start addr.
- -e sets this. */
-symbol *entry_symbol;
-
-symbol *edata_symbol; /* the symbol _edata */
-symbol *etext_symbol; /* the symbol _etext */
-symbol *end_symbol; /* the symbol _end */
-\f
-/* Each input file, and each library member ("subfile") being loaded,
- has a `file_entry' structure for it.
-
- For files specified by command args, these are contained in the vector
- which `file_table' points to.
-
- For library members, they are dynamically allocated,
- and chained through the `chain' field.
- The chain is found in the `subfiles' field of the `file_entry'.
- The `file_entry' objects for the members have `superfile' fields pointing
- to the one for the library. */
-
-struct file_entry {
- /* Name of this file. */
- char *filename;
- /* Name to use for the symbol giving address of text start */
- /* Usually the same as filename, but for a file spec'd with -l
- this is the -l switch itself rather than the filename. */
- char *local_sym_name;
-
- /* Describe the layout of the contents of the file */
-
- /* The file's a.out header. */
- struct exec header;
- /* Offset in file of GDB symbol segment, or 0 if there is none. */
- int symseg_offset;
-
- /* Describe data from the file loaded into core */
-
- /* Symbol table of the file. */
- struct nlist *symbols;
- /* Size in bytes of string table. */
- int string_size;
- /* Pointer to the string table.
- The string table is not kept in core all the time,
- but when it is in core, its address is here. */
- char *strings;
-
- /* Next two used only if `relocatable_output' or if needed for */
- /* output of undefined reference line numbers. */
-
- /* Text reloc info saved by `write_text' for `coptxtrel'. */
- struct relocation_info *textrel;
- /* Data reloc info saved by `write_data' for `copdatrel'. */
- struct relocation_info *datarel;
-
- /* Relation of this file's segments to the output file */
-
- /* Start of this file's text seg in the output file core image. */
- int text_start_address;
- /* Start of this file's data seg in the output file core image. */
- int data_start_address;
- /* Start of this file's bss seg in the output file core image. */
- int bss_start_address;
- /* Offset in bytes in the output file symbol table
- of the first local symbol for this file. Set by `write_file_symbols'. */
- int local_syms_offset;
-
- /* For library members only */
-
- /* For a library, points to chain of entries for the library members. */
- struct file_entry *subfiles;
- /* For a library member, offset of the member within the archive.
- Zero for files that are not library members. */
- int starting_offset;
- /* Size of contents of this file, if library member. */
- int total_size;
- /* For library member, points to the library's own entry. */
- struct file_entry *superfile;
- /* For library member, points to next entry for next member. */
- struct file_entry *chain;
-
- /* 1 if file is a library. */
- char library_flag;
-
- /* 1 if file's header has been read into this structure. */
- char header_read_flag;
-
- /* 1 means search a set of directories for this file. */
- char search_dirs_flag;
-
- /* 1 means this is base file of incremental load.
- Do not load this file's text or data.
- Also default text_start to after this file's bss. */
- char just_syms_flag;
-};
-
-/* Vector of entries for input files specified by arguments.
- These are all the input files except for members of specified libraries. */
-struct file_entry *file_table;
-
-/* Length of that vector. */
-int number_of_files;
-\f
-/* When loading the text and data, we can avoid doing a close
- and another open between members of the same library.
-
- These two variables remember the file that is currently open.
- Both are zero if no file is open.