-static void
-generate_ecoff_stab (what, string, type, other, desc)
- int what;
- const char *string;
- int type;
- int other;
- int desc;
-{
- efdr_t *save_file_ptr = cur_file_ptr;
- symbolS *sym;
- symint_t value;
- st_t st;
- sc_t sc;
- symint_t indx;
- localsym_t *hold = NULL;
-
- /* We don't handle .stabd. */
- if (what != 's' && what != 'n')
- {
- as_bad (".stab%c is not supported", what);
- return;
- }
-
- /* We ignore the other field. */
- if (other != 0)
- as_warn (".stab%c: ignoring non-zero other field", what);
-
- /* Make sure we have a current file. */
- if (cur_file_ptr == (efdr_t *) NULL)
- {
- add_file ((const char *) NULL, 0, 1);
- save_file_ptr = cur_file_ptr;
- }
-
- /* For stabs in ECOFF, the first symbol must be @stabs. This is a
- signal to gdb. */
- if (stabs_seen == 0)
- mark_stabs (0);
-
- /* Line number stabs are handled differently, since they have two
- values, the line number and the address of the label. We use the
- index field (aka desc) to hold the line number, and the value
- field to hold the address. The symbol type is st_Label, which
- should be different from the other stabs, so that gdb can
- recognize it. */
- if (type == N_SLINE)
- {
- SYMR dummy_symr;
-
-#ifndef NO_LISTING
- if (listing)
- listing_source_line ((unsigned int) desc);
-#endif
-
- dummy_symr.index = desc;
- if (dummy_symr.index != desc)
- {
- as_warn ("Line number (%d) for .stab%c directive cannot fit in index field (20 bits)",
- desc, what);
- return;
- }
-
- sym = symbol_find_or_make ((char *)string);
- value = 0;
- st = st_Label;
- sc = sc_Text;
- indx = desc;
- }
- else
- {
-#ifndef NO_LISTING
- if (listing && (type == N_SO || type == N_SOL))
- listing_source_file (string);
-#endif
-
- sym = symbol_find_or_make ((char *)string);
- sc = sc_Nil;
- st = st_Nil;
- value = 0;
- indx = ECOFF_MARK_STAB (type);
- }
-
- /* Don't store the stabs symbol we are creating as the type of the
- ECOFF symbol. We want to compute the type of the ECOFF symbol
- independently. */
- if (sym != (symbolS *) NULL)
- hold = sym->ecoff_symbol;
-
- (void) add_ecoff_symbol (string, st, sc, sym, (bfd_vma) 0, value, indx);
-
- if (sym != (symbolS *) NULL)
- sym->ecoff_symbol = hold;
-
- /* Restore normal file type. */
- cur_file_ptr = save_file_ptr;
-}
-
-int