gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gas / ecoff.c
index 082192230373e78a43057751a893a8130442e1ce..08bfee1fc5c6412934ae1ecd40e1ebbf8078b509 100644 (file)
@@ -1,5 +1,5 @@
 /* ECOFF debugging support.
-   Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    This file was put together by Ian Lance Taylor <ian@cygnus.com>.  A
    good deal of it comes directly from mips-tfile.c, by Michael
@@ -9,7 +9,7 @@
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with GAS; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 #include "as.h"
 
 /* This file is compiled conditionally for those targets which use
-   ECOFF debugging information (e.g., MIPS ECOFF, MIPS ELF, Alpha
-   ECOFF).  */
+   ECOFF debugging information (e.g., MIPS ELF, Alpha ECOFF).  */
+
+#include "ecoff.h"
 
 #ifdef ECOFF_DEBUGGING
 
 #include "coff/internal.h"
 #include "coff/symconst.h"
-#include "ecoff.h"
 #include "aout/stab_gnu.h"
-
-#include <ctype.h>
+#include "filenames.h"
+#include "safe-ctype.h"
 
 /* Why isn't this in coff/sym.h?  */
 #define ST_RFDESCAPE 0xfff
                        tqFar           -- 8086 far pointers
                        tqVol           -- volatile
 
-
    The dense number table is used in the front ends, and disappears by
    the time the .o is created.
 
 
    Each file table has offsets for where the line numbers, local
    strings, local symbols, and procedure table starts from within the
-   global tables, and the indexs are reset to 0 for each of those
+   global tables, and the indices are reset to 0 for each of those
    tables for the file.
 
    The procedure table contains the binary equivalents of the .ent
 
     5) index: pointer to a local symbol or aux. entry.
 
-
-
    For the following program:
 
        #include <stdio.h>
     #26             48  0x00000030  struct no name { ifd = -1, index = 1048575 }
 */
 \f
-/* Redefinition of of storage classes as an enumeration for better
+/* Redefinition of storage classes as an enumeration for better
    debugging.  */
 
 typedef enum sc {
@@ -726,9 +723,9 @@ typedef enum bt {
 
 /* States for whether to hash type or not.  */
 typedef enum hash_state {
-  hash_no      = 0,            /* don't hash type */
-  hash_yes     = 1,            /* ok to hash type, or use previous hash */
-  hash_record  = 2             /* ok to record hash, but don't use prev. */
+  hash_no      = 0,            /* Don't hash type */
+  hash_yes     = 1,            /* OK to hash type, or use previous hash */
+  hash_record  = 2             /* OK to record hash, but don't use prev.  */
 } hash_state_t;
 
 /* Types of different sized allocation requests.  */
@@ -768,13 +765,24 @@ enum aux_type {
    If PAGE_SIZE is > 4096, the string length in the shash_t structure
    can't be represented (assuming there are strings > 4096 bytes).  */
 
+/* FIXME: Yes, there can be such strings while emitting C++ class debug
+   info.  Templates are the offender here, the test case in question
+   having a mangled class name of
+
+     t7rb_tree4Z4xkeyZt4pair2ZC4xkeyZt7xsocket1Z4UserZt9select1st2Zt4pair\
+     2ZC4xkeyZt7xsocket1Z4UserZ4xkeyZt4less1Z4xkey
+
+   Repeat that a couple dozen times while listing the class members and
+   you've got strings over 4k.  Hack around this for now by increasing
+   the page size.  A proper solution would abandon this structure scheme
+   certainly for very large strings, and possibly entirely.  */
+
 #ifndef PAGE_SIZE
-#define PAGE_SIZE 4096         /* size of varray pages */
+#define PAGE_SIZE (8*1024)     /* size of varray pages */
 #endif
 
 #define PAGE_USIZE ((unsigned long) PAGE_SIZE)
 
-
 #ifndef MAX_CLUSTER_PAGES      /* # pages to get from system */
 #define MAX_CLUSTER_PAGES 63
 #endif
@@ -787,7 +795,6 @@ typedef struct vlinks {
   unsigned long         start_index;   /* starting index # of page */
 } vlinks_t;
 
-
 /* Virtual array header.  */
 typedef struct varray {
   vlinks_t     *first;                 /* first page link */
@@ -813,11 +820,9 @@ typedef struct varray {
   OBJECTS_PER_PAGE (type),     /* objects_last_page */                 \
 }
 
-
-/* Master type for indexes within the symbol table. */
+/* Master type for indexes within the symbol table.  */
 typedef unsigned long symint_t;
 
-
 /* Linked list support for nested scopes (file, block, structure, etc.).  */
 typedef struct scope {
   struct scope *prev;          /* previous scope level */
@@ -826,7 +831,6 @@ typedef struct scope {
   st_t          type;          /* type of the node */
 } scope_t;
 
-
 /* For a local symbol we store a gas symbol as well as the debugging
    information we generate.  The gas symbol will be NULL if this is
    only a debugging symbol.  */
@@ -843,7 +847,6 @@ typedef struct localsym {
   EXTR ecoff_sym;              /* ECOFF debugging symbol */
 } localsym_t;
 
-
 /* For aux information we keep the type and the data.  */
 typedef struct ecoff_aux {
   enum aux_type type;          /* aux type */
@@ -860,7 +863,6 @@ typedef struct ecoff_proc {
 /* Number of proc_t structures allocated.  */
 static unsigned long proc_cnt;
 
-
 /* Forward reference list for tags referenced, but not yet defined.  */
 typedef struct forward {
   struct forward *next;                /* next forward reference */
@@ -869,7 +871,6 @@ typedef struct forward {
   aux_t                 *index_ptr;    /* pointer to store symbol index */
 } forward_t;
 
-
 /* Linked list support for tags.  The first tag in the list is always
    the current tag for that block.  */
 typedef struct tag {
@@ -883,7 +884,6 @@ typedef struct tag {
   localsym_t    *sym;          /* file's local symbols */
 } tag_t;
 
-
 /* Head of a block's linked list of tags.  */
 typedef struct thead {
   struct thead *prev;          /* previous block */
@@ -891,7 +891,6 @@ typedef struct thead {
   struct tag   *first_tag;     /* first tag in block defined */
 } thead_t;
 
-
 /* Union containing pointers to each the small structures which are freed up.  */
 typedef union small_free {
   scope_t      *f_scope;       /* scope structure */
@@ -900,7 +899,6 @@ typedef union small_free {
   forward_t    *f_forward;     /* forward tag reference */
 } small_free_t;
 
-
 /* String hash table entry.  */
 
 typedef struct shash {
@@ -913,7 +911,6 @@ typedef struct shash {
   proc_t       *proc_ptr;      /* procedure descriptor pointer */
 } shash_t;
 
-
 /* Type hash table support.  The size of the hash table must fit
    within a page with the other extended file descriptor information.
    Because unique types which are hashed are fewer in number than
@@ -931,7 +928,6 @@ typedef struct thash {
   symint_t      indx;          /* index within string table */
 } thash_t;
 
-
 /* Extended file descriptor that contains all of the support necessary
    to add things to each file separately.  */
 typedef struct efdr {
@@ -955,8 +951,7 @@ typedef struct efdr {
 } efdr_t;
 
 /* Pre-initialized extended file structure.  */
-static const efdr_t init_file =
-{
+static const efdr_t init_file = {
   {                    /* FDR structure */
     0,                 /* adr:         memory address of beginning of file */
     0,                 /* rss:         file name (of source, if known) */
@@ -1003,11 +998,9 @@ static const efdr_t init_file =
   { 0 },               /* thash_head:  type hash table */
 };
 
-
 static efdr_t *first_file;                     /* first file descriptor */
 static efdr_t **last_file_ptr = &first_file;   /* file descriptor tail */
 
-
 /* Line number information is kept in a list until the assembly is
    finished.  */
 typedef struct lineno_list {
@@ -1048,7 +1041,6 @@ typedef union page {
   lineno_list_t        lineno  [ PAGE_SIZE / sizeof (lineno_list_t) ];
 } page_type;
 
-
 /* Structure holding allocation information for small sized structures.  */
 typedef struct alloc_info {
   char         *alloc_name;    /* name of this allocation type (must be first) */
@@ -1060,7 +1052,6 @@ typedef struct alloc_info {
   int           total_pages;   /* total number of pages allocated */
 } alloc_info_t;
 
-
 /* Type information collected together.  */
 typedef struct type_info {
   bt_t       basic_type;               /* basic type */
@@ -1118,7 +1109,7 @@ static const type_info_t type_info_init = {
 /* Global hash table for the tags table and global table for file
    descriptors.  */
 
-static varray_t file_desc      = INIT_VARRAY (efdr_t);
+static varray_t file_desc = INIT_VARRAY (efdr_t);
 
 static struct hash_control *tag_hash;
 
@@ -1131,7 +1122,6 @@ static type_info_t void_type_info;
 static type_info_t last_func_type_info;
 static symbolS *last_func_sym_value;
 
-
 /* Convert COFF basic type to ECOFF basic type.  The T_NULL type
    really should use bt_Void, but this causes the current ecoff GDB to
    issue unsupported type messages, and the Ultrix 4.00 dbx (aka MIPS
@@ -1387,9 +1377,8 @@ static const st_t map_coff_sym_type[] = {
   st_Nil,                      /* 106: C_HIDDEN ??? */
 };
 
-
 /* Keep track of different sized allocation requests.  */
-static alloc_info_t alloc_counts[ (int)alloc_type_last ];
+static alloc_info_t alloc_counts[(int) alloc_type_last];
 \f
 /* Record whether we have seen any debugging information.  */
 int ecoff_debugging_seen = 0;
@@ -1417,77 +1406,74 @@ static char stabs_symbol[] = STABS_SYMBOL;
 \f
 /* Prototypes for functions defined in this file.  */
 
-static void add_varray_page PARAMS ((varray_t *vp));
-static symint_t add_string PARAMS ((varray_t *vp,
-                                   struct hash_control *hash_tbl,
-                                   const char *str,
-                                   shash_t **ret_hash));
-static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type,
-                                            sc_t storage, symbolS *sym,
-                                            bfd_vma addend, symint_t value,
-                                            symint_t indx));
-static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word));
-static symint_t add_aux_sym_rndx PARAMS ((int file_index,
-                                         symint_t sym_index));
-static symint_t add_aux_sym_tir PARAMS ((type_info_t *t,
-                                        hash_state_t state,
-                                        thash_t **hash_tbl));
-static tag_t *get_tag PARAMS ((const char *tag, localsym_t *sym,
-                              bt_t basic_type));
-static void add_unknown_tag PARAMS ((tag_t *ptag));
-static void add_procedure PARAMS ((char *func));
-static void add_file PARAMS ((const char *file_name, int indx, int fake));
+static void add_varray_page (varray_t *vp);
+static symint_t add_string (varray_t *vp,
+                           struct hash_control *hash_tbl,
+                           const char *str,
+                           shash_t **ret_hash);
+static localsym_t *add_ecoff_symbol (const char *str, st_t type,
+                                    sc_t storage, symbolS *sym,
+                                    bfd_vma addend, symint_t value,
+                                    symint_t indx);
+static symint_t add_aux_sym_symint (symint_t aux_word);
+static symint_t add_aux_sym_rndx (int file_index, symint_t sym_index);
+static symint_t add_aux_sym_tir (type_info_t *t,
+                                hash_state_t state,
+                                thash_t **hash_tbl);
+static tag_t *get_tag (const char *tag, localsym_t *sym, bt_t basic_type);
+static void add_unknown_tag (tag_t *ptag);
+static void add_procedure (char *func, int aent);
+static void add_file (const char *file_name, int indx, int fake);
 #ifdef ECOFF_DEBUG
-static char *sc_to_string PARAMS ((sc_t storage_class));
-static char *st_to_string PARAMS ((st_t symbol_type));
+static char *sc_to_string (sc_t storage_class);
+static char *st_to_string (st_t symbol_type);
 #endif
-static void mark_stabs PARAMS ((int));
-static char *ecoff_add_bytes PARAMS ((char **buf, char **bufend,
-                                     char *bufptr, unsigned long need));
+static void mark_stabs (int);
+static char *ecoff_add_bytes (char **buf, char **bufend,
+                             char *bufptr, unsigned long need);
 static unsigned long ecoff_padding_adjust
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset, char **bufptrptr));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset, char **bufptrptr);
 static unsigned long ecoff_build_lineno
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset, long *linecntptr));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset, long *linecntptr);
 static unsigned long ecoff_build_symbols
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_procs
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_aux
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
-static unsigned long ecoff_build_strings PARAMS ((char **buf, char **bufend,
-                                                 unsigned long offset,
-                                                 varray_t *vp));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
+static unsigned long ecoff_build_strings (char **buf, char **bufend,
+                                         unsigned long offset,
+                                         varray_t *vp);
 static unsigned long ecoff_build_ss
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
 static unsigned long ecoff_build_fdr
-  PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
-          unsigned long offset));
-static void ecoff_setup_ext PARAMS ((void));
-static page_type *allocate_cluster PARAMS ((unsigned long npages));
-static page_type *allocate_page PARAMS ((void));
-static scope_t *allocate_scope PARAMS ((void));
-static void free_scope PARAMS ((scope_t *ptr));
-static vlinks_t *allocate_vlinks PARAMS ((void));
-static shash_t *allocate_shash PARAMS ((void));
-static thash_t *allocate_thash PARAMS ((void));
-static tag_t *allocate_tag PARAMS ((void));
-static void free_tag PARAMS ((tag_t *ptr));
-static forward_t *allocate_forward PARAMS ((void));
-static thead_t *allocate_thead PARAMS ((void));
-static void free_thead PARAMS ((thead_t *ptr));
-static lineno_list_t *allocate_lineno_list PARAMS ((void));
-static void generate_ecoff_stab PARAMS ((int, const char *, int, int, int));
+  (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
+   unsigned long offset);
+static void ecoff_setup_ext (void);
+static page_type *allocate_cluster (unsigned long npages);
+static page_type *allocate_page (void);
+static scope_t *allocate_scope (void);
+static void free_scope (scope_t *ptr);
+static vlinks_t *allocate_vlinks (void);
+static shash_t *allocate_shash (void);
+static thash_t *allocate_thash (void);
+static tag_t *allocate_tag (void);
+static void free_tag (tag_t *ptr);
+static forward_t *allocate_forward (void);
+static thead_t *allocate_thead (void);
+static void free_thead (thead_t *ptr);
+static lineno_list_t *allocate_lineno_list (void);
 \f
 /* This function should be called when the assembler starts up.  */
 
 void
-ecoff_read_begin_hook ()
+ecoff_read_begin_hook (void)
 {
   tag_hash = hash_new ();
   top_tag_head = allocate_thead ();
@@ -1500,9 +1486,10 @@ ecoff_read_begin_hook ()
 /* This function should be called when a symbol is created.  */
 
 void
-ecoff_symbol_new_hook (symbolP)
-     symbolS *symbolP;
+ecoff_symbol_new_hook (symbolS *symbolP)
 {
+  OBJ_SYMFIELD_TYPE *obj;
+
   /* Make sure that we have a file pointer, but only if we have seen a
      file.  If we haven't seen a file, then this is a probably special
      symbol created by md_begin which may required special handling at
@@ -1511,16 +1498,26 @@ ecoff_symbol_new_hook (symbolP)
   if (cur_file_ptr == (efdr_t *) NULL
       && seen_at_least_1_file ())
     add_file ((const char *) NULL, 0, 1);
-  symbolP->ecoff_file = cur_file_ptr;
-  symbolP->ecoff_symbol = NULL;
-  symbolP->ecoff_extern_size = 0;
+  obj = symbol_get_obj (symbolP);
+  obj->ecoff_file = cur_file_ptr;
+  obj->ecoff_symbol = NULL;
+  obj->ecoff_extern_size = 0;
+}
+
+void
+ecoff_symbol_clone_hook (symbolS *newsymP, symbolS *orgsymP)
+{
+  OBJ_SYMFIELD_TYPE *n, *o;
+
+  n = symbol_get_obj (newsymP);
+  o = symbol_get_obj (orgsymP);
+  memcpy (n, o, sizeof *n);
 }
 \f
 /* Add a page to a varray object.  */
 
 static void
-add_varray_page (vp)
-     varray_t *vp;                             /* varray to add page to */
+add_varray_page (varray_t *vp /* varray to add page to */)
 {
   vlinks_t *new_links = allocate_vlinks ();
 
@@ -1531,8 +1528,8 @@ add_varray_page (vp)
 #endif
     new_links->datum = allocate_page ();
 
-  alloc_counts[(int)alloc_type_varray].total_alloc++;
-  alloc_counts[(int)alloc_type_varray].total_pages++;
+  alloc_counts[(int) alloc_type_varray].total_alloc++;
+  alloc_counts[(int) alloc_type_varray].total_pages++;
 
   new_links->start_index = vp->num_allocated;
   vp->objects_last_page = 0;
@@ -1550,29 +1547,28 @@ add_varray_page (vp)
 /* Add a string (and null pad) to one of the string tables.  */
 
 static symint_t
-add_string (vp, hash_tbl, str, ret_hash)
-     varray_t *vp;                     /* string obstack */
-     struct hash_control *hash_tbl;    /* ptr to hash table */
-     const char *str;                  /* string */
-     shash_t **ret_hash;               /* return hash pointer */
+add_string (varray_t *vp,                      /* string obstack */
+           struct hash_control *hash_tbl,      /* ptr to hash table */
+           const char *str,                    /* string */
+           shash_t **ret_hash                  /* return hash pointer */)
 {
-  register unsigned long len = strlen (str);
-  register shash_t *hash_ptr;
+  unsigned long len = strlen (str);
+  shash_t *hash_ptr;
 
   if (len >= PAGE_USIZE)
-    as_fatal ("String too big (%lu bytes)", len);
+    as_fatal (_("string too big (%lu bytes)"), len);
 
   hash_ptr = (shash_t *) hash_find (hash_tbl, str);
   if (hash_ptr == (shash_t *) NULL)
     {
-      register const char *err;
+      const char *err;
 
       if (vp->objects_last_page + len >= PAGE_USIZE)
-        {
-          vp->num_allocated =
-            ((vp->num_allocated + PAGE_USIZE - 1) / PAGE_USIZE) * PAGE_USIZE;
-          add_varray_page (vp);
-        }
+       {
+         vp->num_allocated =
+           ((vp->num_allocated + PAGE_USIZE - 1) / PAGE_USIZE) * PAGE_USIZE;
+         add_varray_page (vp);
+       }
 
       hash_ptr = allocate_shash ();
       hash_ptr->indx = vp->num_allocated;
@@ -1586,7 +1582,7 @@ add_string (vp, hash_tbl, str, ret_hash)
 
       err = hash_insert (hash_tbl, str, (char *) hash_ptr);
       if (err)
-       as_fatal ("Inserting \"%s\" into string hash table: %s",
+       as_fatal (_("inserting \"%s\" into string hash table: %s"),
                  str, err);
     }
 
@@ -1599,33 +1595,32 @@ add_string (vp, hash_tbl, str, ret_hash)
 /* Add debugging information for a symbol.  */
 
 static localsym_t *
-add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
-     const char *str;                  /* symbol name */
-     st_t type;                                /* symbol type */
-     sc_t storage;                     /* storage class */
-     symbolS *sym_value;               /* associated symbol.  */
-     bfd_vma addend;                   /* addend to sym_value.  */
-     symint_t value;                   /* value of symbol */
-     symint_t indx;                    /* index to local/aux. syms */
+add_ecoff_symbol (const char *str,     /* symbol name */
+                 st_t type,            /* symbol type */
+                 sc_t storage,         /* storage class */
+                 symbolS *sym_value,   /* associated symbol.  */
+                 bfd_vma addend,       /* addend to sym_value.  */
+                 symint_t value,       /* value of symbol */
+                 symint_t indx         /* index to local/aux. syms */)
 {
   localsym_t *psym;
-  register scope_t *pscope;
-  register thead_t *ptag_head;
-  register tag_t *ptag;
-  register tag_t *ptag_next;
-  register varray_t *vp;
-  register int scope_delta = 0;
+  scope_t *pscope;
+  thead_t *ptag_head;
+  tag_t *ptag;
+  tag_t *ptag_next;
+  varray_t *vp;
+  int scope_delta = 0;
   shash_t *hash_ptr = (shash_t *) NULL;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->symbols;
 
- if (vp->objects_last_page == vp->objects_per_page)
 if (vp->objects_last_page == vp->objects_per_page)
     add_varray_page (vp);
 
-  psym = &vp->last->datum->sym[ vp->objects_last_page++ ];
+  psym = &vp->last->datum->sym[vp->objects_last_page++];
 
   if (str == (const char *) NULL && sym_value != (symbolS *) NULL)
     psym->name = S_GET_NAME (sym_value);
@@ -1633,7 +1628,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
     psym->name = str;
   psym->as_sym = sym_value;
   if (sym_value != (symbolS *) NULL)
-    sym_value->ecoff_symbol = psym;
+    symbol_get_obj (sym_value)->ecoff_symbol = psym;
   psym->addend = addend;
   psym->file_ptr = cur_file_ptr;
   psym->proc_ptr = cur_proc_ptr;
@@ -1691,8 +1686,8 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
        scope_delta = 1;
 
       /* For every block type except file, struct, union, or
-        enumeration blocks, push a level on the tag stack.  We omit
-        file types, so that tags can span file boundaries.  */
+         enumeration blocks, push a level on the tag stack.  We omit
+         file types, so that tags can span file boundaries.  */
       if (type != st_File && storage != sc_Info)
        {
          ptag_head = allocate_thead ();
@@ -1705,7 +1700,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
     case st_End:
       pscope = cur_file_ptr->cur_scope;
       if (pscope == (scope_t *) NULL)
-       as_fatal ("too many st_End's");
+       as_fatal (_("too many st_End's"));
       else
        {
          st_t begin_type = (st_t) pscope->lsym->ecoff_sym.asym.st;
@@ -1757,7 +1752,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
              ty = add_aux_sym_tir (&last_func_type_info,
                                    hash_no,
                                    &cur_file_ptr->thash_head[0]);
-
+             (void) ty;
 /* This seems to be unnecessary.  I'm not even sure what it is
  * intended to do.  It's from mips-tfile.
  *           if (last_func_sym_value != (symbolS *) NULL)
@@ -1788,11 +1783,12 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
               value, depth, sc_str);
 
       if (str_start && str_end_p1 - str_start > 0)
-       fprintf (stderr, " st= %-11s name= %.*s\n", st_str, str_end_p1 - str_start, str_start);
+       fprintf (stderr, " st= %-11s name= %.*s\n",
+                st_str, str_end_p1 - str_start, str_start);
       else
        {
          unsigned long len = strlen (st_str);
-         fprintf (stderr, " st= %.*s\n", len-1, st_str);
+         fprintf (stderr, " st= %.*s\n", len - 1, st_str);
        }
     }
 #endif
@@ -1804,14 +1800,13 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
    for integral aux types, not just symints.  */
 
 static symint_t
-add_aux_sym_symint (aux_word)
-     symint_t aux_word;                /* auxiliary information word */
+add_aux_sym_symint (symint_t aux_word /* auxiliary information word */)
 {
-  register varray_t *vp;
-  register aux_t *aux_ptr;
+  varray_t *vp;
+  aux_t *aux_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1825,19 +1820,16 @@ add_aux_sym_symint (aux_word)
   return vp->num_allocated++;
 }
 
-
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 static symint_t
-add_aux_sym_rndx (file_index, sym_index)
-     int file_index;
-     symint_t sym_index;
+add_aux_sym_rndx (int file_index, symint_t sym_index)
 {
-  register varray_t *vp;
-  register aux_t *aux_ptr;
+  varray_t *vp;
+  aux_t *aux_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1856,20 +1848,19 @@ add_aux_sym_rndx (file_index, sym_index)
    type qualifiers).  */
 
 static symint_t
-add_aux_sym_tir (t, state, hash_tbl)
-     type_info_t *t;           /* current type information */
-     hash_state_t state;       /* whether to hash type or not */
-     thash_t **hash_tbl;       /* pointer to hash table to use */
+add_aux_sym_tir (type_info_t *t,       /* current type information */
+                hash_state_t state,    /* whether to hash type or not */
+                thash_t **hash_tbl     /* pointer to hash table to use */)
 {
-  register varray_t *vp;
-  register aux_t *aux_ptr;
+  varray_t *vp;
+  aux_t *aux_ptr;
   static AUXU init_aux;
   symint_t ret;
   int i;
   AUXU aux;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1885,9 +1876,8 @@ add_aux_sym_tir (t, state, hash_tbl)
   aux.ti.tq4 = (int) t->type_qualifiers[4];
   aux.ti.tq5 = (int) t->type_qualifiers[5];
 
-
   /* For anything that adds additional information, we must not hash,
-     so check here, and reset our state. */
+     so check here, and reset our state.  */
 
   if (state != hash_no
       && (t->type_qualifiers[0] == tq_Array
@@ -1910,8 +1900,8 @@ add_aux_sym_tir (t, state, hash_tbl)
 
   if (state != hash_no)
     {
-      register thash_t *hash_ptr;
-      register symint_t hi;
+      thash_t *hash_ptr;
+      symint_t hi;
 
       hi = aux.isym & ((1 << HASHBITS) - 1);
       hi %= THASH_SIZE;
@@ -1937,11 +1927,11 @@ add_aux_sym_tir (t, state, hash_tbl)
        }
     }
 
-  /* Everything is set up, add the aux symbol. */
+  /* Everything is set up, add the aux symbol.  */
   if (vp->objects_last_page == vp->objects_per_page)
     add_varray_page (vp);
 
-  aux_ptr = &vp->last->datum->aux[ vp->objects_last_page++ ];
+  aux_ptr = &vp->last->datum->aux[vp->objects_last_page++];
   aux_ptr->type = aux_tir;
   aux_ptr->data = aux;
 
@@ -1957,8 +1947,7 @@ add_aux_sym_tir (t, state, hash_tbl)
      for an enum bitfield.  */
 
   if (t->bitfield)
-    (void) add_aux_sym_symint ((symint_t)t->sizes[t->num_sizes-1]);
-
+    (void) add_aux_sym_symint ((symint_t) t->sizes[t->num_sizes - 1]);
 
   /* Add tag information if needed.  Structure, union, and enum
      references add 2 aux symbols: a [file index, symbol index]
@@ -1968,9 +1957,9 @@ add_aux_sym_tir (t, state, hash_tbl)
       || t->basic_type == bt_Union
       || t->basic_type == bt_Enum)
     {
-      register symint_t file_index = t->tag_ptr->ifd;
-      register localsym_t *sym  = t->tag_ptr->sym;
-      register forward_t *forward_ref = allocate_forward ();
+      symint_t file_index = t->tag_ptr->ifd;
+      localsym_t *sym = t->tag_ptr->sym;
+      forward_t *forward_ref = allocate_forward ();
 
       if (sym != (localsym_t *) NULL)
        {
@@ -1985,11 +1974,11 @@ add_aux_sym_tir (t, state, hash_tbl)
 
       (void) add_aux_sym_rndx (ST_RFDESCAPE, indexNil);
       forward_ref->index_ptr
-       = &vp->last->datum->aux[ vp->objects_last_page - 1];
+       = &vp->last->datum->aux[vp->objects_last_page - 1];
 
       (void) add_aux_sym_symint (file_index);
       forward_ref->ifd_ptr
-       = &vp->last->datum->aux[ vp->objects_last_page - 1];
+       = &vp->last->datum->aux[vp->objects_last_page - 1];
     }
 
   /* Add information about array bounds if they exist.  */
@@ -2007,7 +1996,7 @@ add_aux_sym_tir (t, state, hash_tbl)
     };
 
   /* NOTE:  Mips documentation claims that the bitfield width goes here.
-     But it needs to be emitted earlier. */
+     But it needs to be emitted earlier.  */
 
   return ret;
 }
@@ -2015,43 +2004,41 @@ add_aux_sym_tir (t, state, hash_tbl)
 /* Add a tag to the tag table (unless it already exists).  */
 
 static tag_t *
-get_tag (tag, sym, basic_type)
-     const char *tag;                  /* tag name */
-     localsym_t *sym;                  /* tag start block */
-     bt_t basic_type;                  /* bt_Struct, bt_Union, or bt_Enum */
+get_tag (const char *tag,      /* tag name */
+        localsym_t *sym,       /* tag start block */
+        bt_t basic_type        /* bt_Struct, bt_Union, or bt_Enum */)
 {
   shash_t *hash_ptr;
   const char *err;
   tag_t *tag_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   hash_ptr = (shash_t *) hash_find (tag_hash, tag);
 
   if (hash_ptr != (shash_t *) NULL
       && hash_ptr->tag_ptr != (tag_t *) NULL)
-  {
-    tag_ptr = hash_ptr->tag_ptr;
-    if (sym != (localsym_t *) NULL)
-      {
-       tag_ptr->basic_type = basic_type;
-       tag_ptr->ifd        = cur_file_ptr->file_index;
-       tag_ptr->sym        = sym;
-      }
-    return tag_ptr;
-  }
+    {
+      tag_ptr = hash_ptr->tag_ptr;
+      if (sym != (localsym_t *) NULL)
+       {
+         tag_ptr->basic_type = basic_type;
+         tag_ptr->ifd        = cur_file_ptr->file_index;
+         tag_ptr->sym        = sym;
+       }
+      return tag_ptr;
+    }
 
   if (hash_ptr == (shash_t *) NULL)
     {
       char *perm;
 
-      perm = xmalloc ((unsigned long) (strlen (tag) + 1));
-      strcpy (perm, tag);
+      perm = xstrdup (tag);
       hash_ptr = allocate_shash ();
       err = hash_insert (tag_hash, perm, (char *) hash_ptr);
       if (err)
-       as_fatal ("Inserting \"%s\" into tag hash table: %s",
+       as_fatal (_("inserting \"%s\" into tag hash table: %s"),
                  tag, err);
       hash_ptr->string = perm;
     }
@@ -2076,8 +2063,7 @@ get_tag (tag, sym, basic_type)
 /* Add an unknown {struct, union, enum} tag.  */
 
 static void
-add_unknown_tag (ptag)
-     tag_t     *ptag;          /* pointer to tag information */
+add_unknown_tag (tag_t *ptag /* pointer to tag information */)
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name           = hash_ptr->string;
@@ -2087,7 +2073,7 @@ add_unknown_tag (ptag)
 #ifdef ECOFF_DEBUG
   if (debug > 1)
     {
-      char *agg_type   = "{unknown aggregate type}";
+      char *agg_type = "{unknown aggregate type}";
       switch (ptag->basic_type)
        {
        case bt_Struct: agg_type = "struct";    break;
@@ -2123,14 +2109,14 @@ add_unknown_tag (ptag)
 }
 \f
 /* Add a procedure to the current file's list of procedures, and record
-   this is the current procedure.  */
+   this is the current procedure.  If AENT, then only set the requested
+   symbol's function type.  */
 
 static void
-add_procedure (func)
-     char *func;                       /* func name */
+add_procedure (char *func /* func name */, int aent)
 {
-  register varray_t *vp;
-  register proc_t *new_proc_ptr;
+  varray_t *vp;
+  proc_t *new_proc_ptr;
   symbolS *sym;
 
 #ifdef ECOFF_DEBUG
@@ -2138,8 +2124,15 @@ add_procedure (func)
     fputc ('\n', stderr);
 #endif
 
+  /* Set the BSF_FUNCTION flag for the symbol.  */
+  sym = symbol_find_or_make (func);
+  symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
+
+  if (aent)
+    return;
+
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->procs;
 
@@ -2158,10 +2151,6 @@ add_procedure (func)
   new_proc_ptr->pdr.lnLow = -1;
   new_proc_ptr->pdr.lnHigh = -1;
 
-  /* Set the BSF_FUNCTION flag for the symbol.  */
-  sym = symbol_find_or_make (func);
-  sym->bsym->flags |= BSF_FUNCTION;
-
   /* Push the start of the function.  */
   new_proc_ptr->sym = add_ecoff_symbol ((const char *) NULL, st_Proc, sc_Text,
                                        sym, (bfd_vma) 0, (symint_t) 0,
@@ -2185,19 +2174,22 @@ add_procedure (func)
       noproc_lineno = (lineno_list_t *) NULL;
     }
 }
+
+symbolS *
+ecoff_get_cur_proc_sym (void)
+{
+  return (cur_proc_ptr ? cur_proc_ptr->sym->as_sym : NULL);
+}
 \f
 /* Add a new filename, and set up all of the file relative
    virtual arrays (strings, symbols, aux syms, etc.).  Record
    where the current file structure lives.  */
 
 static void
-add_file (file_name, indx, fake)
-     const char *file_name;            /* file name */
-     int indx;
-     int fake;
+add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
 {
-  register int first_ch;
-  register efdr_t *fil_ptr;
+  int first_ch;
+  efdr_t *fil_ptr;
 
 #ifdef ECOFF_DEBUG
   if (debug)
@@ -2208,21 +2200,20 @@ add_file (file_name, indx, fake)
      want to use the actual file name.  */
   if (file_name == (const char *) NULL)
     {
-      char *file;
-
       if (first_file != (efdr_t *) NULL)
-       as_fatal ("fake .file after real one");
-      as_where (&file, (unsigned int *) NULL);
-      file_name = (const char *) file;
+       as_fatal (_("fake .file after real one"));
+      file_name = as_where ((unsigned int *) NULL);
 
       /* Automatically generate ECOFF debugging information, since I
          think that's what other ECOFF assemblers do.  We don't do
          this if we see a .file directive with a string, since that
          implies that some sort of debugging information is being
          provided.  */
-      if (! symbol_table_frozen && debug_type == DEBUG_NONE)
+      if (! symbol_table_frozen && debug_type == DEBUG_UNSPECIFIED)
        debug_type = DEBUG_ECOFF;
     }
+  else if (debug_type == DEBUG_UNSPECIFIED)
+    debug_type = DEBUG_NONE;
 
 #ifndef NO_LISTING
   if (listing)
@@ -2236,7 +2227,7 @@ add_file (file_name, indx, fake)
   if (stabs_seen)
     {
       (void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
-                              symbol_new ("L0\001", now_seg,
+                              symbol_new (FAKE_LABEL_NAME, now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
                               (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SOL));
@@ -2264,7 +2255,7 @@ add_file (file_name, indx, fake)
        fil_ptr = fil_ptr->next_file)
     {
       if (first_ch == fil_ptr->name[0]
-         && strcmp (file_name, fil_ptr->name) == 0
+         && filename_cmp (file_name, fil_ptr->name) == 0
          && fil_ptr->fdr.fMerge)
        {
          cur_file_ptr = fil_ptr;
@@ -2274,7 +2265,7 @@ add_file (file_name, indx, fake)
        }
     }
 
-  /* If this is a new file, create it. */
+  /* If this is a new file, create it.  */
   if (fil_ptr == (efdr_t *) NULL)
     {
       if (file_desc.objects_last_page == file_desc.objects_per_page)
@@ -2299,7 +2290,7 @@ add_file (file_name, indx, fake)
                  (shash_t **)0);
 
       if (strlen (file_name) > PAGE_USIZE - 2)
-       as_fatal ("Filename goes over one page boundary.");
+       as_fatal (_("filename goes over one page boundary"));
 
       /* Push the start of the filename. We assume that the filename
          will be stored at string offset 1.  */
@@ -2314,7 +2305,7 @@ add_file (file_name, indx, fake)
       last_file_ptr = &fil_ptr->next_file;
 
       /* Add void & int types to the file (void should be first to catch
-        errant 0's within the index fields).  */
+         errant 0's within the index fields).  */
       fil_ptr->void_type = add_aux_sym_tir (&void_type_info,
                                            hash_yes,
                                            &cur_file_ptr->thash_head[0]);
@@ -2330,16 +2321,15 @@ add_file (file_name, indx, fake)
    compiler output, only in hand coded assembler.  */
 
 void
-ecoff_new_file (name)
-     const char *name;
+ecoff_new_file (const char *name, int appfile ATTRIBUTE_UNUSED)
 {
-  if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0)
+  if (cur_file_ptr != NULL && filename_cmp (cur_file_ptr->name, name) == 0)
     return;
   add_file (name, 0, 0);
 
   /* This is a hand coded assembler file, so automatically turn on
      debugging information.  */
-  if (debug_type == DEBUG_NONE)
+  if (debug_type == DEBUG_UNSPECIFIED)
     debug_type = DEBUG_ECOFF;
 }
 \f
@@ -2348,10 +2338,10 @@ ecoff_new_file (name)
 /* Convert storage class to string.  */
 
 static char *
-sc_to_string(storage_class)
+sc_to_string (storage_class)
      sc_t storage_class;
 {
-  switch(storage_class)
+  switch (storage_class)
     {
     case sc_Nil:        return "Nil,";
     case sc_Text:       return "Text,";
@@ -2389,10 +2379,10 @@ sc_to_string(storage_class)
 /* Convert symbol type to string.  */
 
 static char *
-st_to_string(symbol_type)
+st_to_string (symbol_type)
      st_t symbol_type;
 {
-  switch(symbol_type)
+  switch (symbol_type)
     {
     case st_Nil:       return "Nil,";
     case st_Global:    return "Global,";
@@ -2426,34 +2416,32 @@ st_to_string(symbol_type)
    which gives the location of the start of the block.  */
 
 void
-ecoff_directive_begin (ignore)
-     int ignore;
+ecoff_directive_begin (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
-      as_warn (".begin directive without a preceding .file directive");
+      as_warn (_(".begin directive without a preceding .file directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".begin directive without a preceding .ent directive");
+      as_warn (_(".begin directive without a preceding .ent directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
   (void) add_ecoff_symbol ((const char *) NULL, st_Block, sc_Text,
                           symbol_find_or_make (name),
                           (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   /* The line number follows, but we don't use it.  */
   (void) get_absolute_expression ();
@@ -2464,8 +2452,7 @@ ecoff_directive_begin (ignore)
    which gives the location of the end of the block.  */
 
 void
-ecoff_directive_bend (ignore)
-     int ignore;
+ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2473,32 +2460,31 @@ ecoff_directive_bend (ignore)
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
-      as_warn (".bend directive without a preceding .file directive");
+      as_warn (_(".bend directive without a preceding .file directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".bend directive without a preceding .ent directive");
+      as_warn (_(".bend directive without a preceding .ent directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
   /* The value is the distance between the .bend directive and the
      corresponding symbol.  We fill in the offset when we write out
      the symbol.  */
   endsym = symbol_find (name);
   if (endsym == (symbolS *) NULL)
-    as_warn (".bend directive names unknown symbol");
+    as_warn (_(".bend directive names unknown symbol"));
   else
     (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text, endsym,
                             (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
-  *input_line_pointer = name_end;
+  restore_line_pointer (name_end);
 
   /* The line number follows, but we don't use it.  */
   (void) get_absolute_expression ();
@@ -2523,8 +2509,7 @@ static int coff_inside_enumeration;
 /* Handle a .def directive: start defining a symbol.  */
 
 void
-ecoff_directive_def (ignore)
-     int ignore;
+ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
@@ -2533,21 +2518,18 @@ ecoff_directive_def (ignore)
 
   SKIP_WHITESPACE ();
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
   if (coff_sym_name != (char *) NULL)
-    as_warn (".def pseudo-op used inside of .def/.endef; ignored");
+    as_warn (_(".def pseudo-op used inside of .def/.endef; ignored"));
   else if (*name == '\0')
-    as_warn ("Empty symbol name in .def; ignored");
+    as_warn (_("empty symbol name in .def; ignored"));
   else
     {
-      if (coff_sym_name != (char *) NULL)
-       free (coff_sym_name);
-      if (coff_tag != (char *) NULL)
-       free (coff_tag);
-      coff_sym_name = (char *) xmalloc ((unsigned long) (strlen (name) + 1));
-      strcpy (coff_sym_name, name);
+      free (coff_sym_name);
+      free (coff_tag);
+
+      coff_sym_name = xstrdup (name);
       coff_type = type_info_init;
       coff_storage_class = sc_Nil;
       coff_symbol_typ = st_Nil;
@@ -2558,7 +2540,7 @@ ecoff_directive_def (ignore)
       coff_sym_addend = 0;
     }
 
-  *input_line_pointer = name_end;
+  restore_line_pointer (name_end);
 
   demand_empty_rest_of_line ();
 }
@@ -2569,15 +2551,14 @@ ecoff_directive_def (ignore)
    more than that anyhow, so I will also make that assumption.  */
 
 void
-ecoff_directive_dim (ignore)
-     int ignore;
+ecoff_directive_dim (int ignore ATTRIBUTE_UNUSED)
 {
   int dimens[N_TQ];
   int i;
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".dim pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".dim pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2592,7 +2573,7 @@ ecoff_directive_dim (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn ("Badly formed .dim directive");
+           as_warn (_("badly formed .dim directive"));
          break;
        }
     }
@@ -2605,7 +2586,7 @@ ecoff_directive_dim (ignore)
     {
       if (coff_type.num_dims >= N_TQ)
        {
-         as_warn ("Too many .dim entries");
+         as_warn (_("too many .dim entries"));
          break;
        }
       coff_type.dimensions[coff_type.num_dims] = dimens[i];
@@ -2619,14 +2600,13 @@ ecoff_directive_dim (ignore)
    symbol.  */
 
 void
-ecoff_directive_scl (ignore)
-     int ignore;
+ecoff_directive_scl (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".scl pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".scl pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2644,15 +2624,14 @@ ecoff_directive_scl (ignore)
    never generate more than one argument.  */
 
 void
-ecoff_directive_size (ignore)
-     int ignore;
+ecoff_directive_size (int ignore ATTRIBUTE_UNUSED)
 {
   int sizes[N_TQ];
   int i;
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".size pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".size pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2667,7 +2646,7 @@ ecoff_directive_size (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn ("Badly formed .size directive");
+           as_warn (_("badly formed .size directive"));
          break;
        }
     }
@@ -2680,7 +2659,7 @@ ecoff_directive_size (ignore)
     {
       if (coff_type.num_sizes >= N_TQ)
        {
-         as_warn ("Too many .size entries");
+         as_warn (_("too many .size entries"));
          break;
        }
       coff_type.sizes[coff_type.num_sizes] = sizes[i];
@@ -2694,8 +2673,7 @@ ecoff_directive_size (ignore)
    symbol.  */
 
 void
-ecoff_directive_type (ignore)
-     int ignore;
+ecoff_directive_type (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
   tq_t *tq_ptr;
@@ -2703,7 +2681,7 @@ ecoff_directive_type (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".type pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".type pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2714,14 +2692,14 @@ ecoff_directive_type (ignore)
   coff_type.basic_type = map_coff_types[coff_type.orig_type];
 
   tq_ptr = &coff_type.type_qualifiers[N_TQ];
-  while (val &N_BTMASK)
+  while (val & ~N_BTMASK)
     {
       if (tq_ptr == &coff_type.type_qualifiers[0])
        {
          /* FIXME: We could handle this by setting the continued bit.
-             There would still be a limit: the .type argument can not
-             be infinite.  */
-         as_warn ("The type of %s is too complex; it will be simplified",
+            There would still be a limit: the .type argument can not
+            be infinite.  */
+         as_warn (_("the type of %s is too complex; it will be simplified"),
                   coff_sym_name);
          break;
        }
@@ -2732,7 +2710,7 @@ ecoff_directive_type (ignore)
       else if (ISARY (val))
        *--tq_ptr = tq_Array;
       else
-       as_fatal ("Unrecognized .type argument");
+       as_fatal (_("Unrecognized .type argument"));
 
       val = DECREF (val);
     }
@@ -2744,11 +2722,11 @@ ecoff_directive_type (ignore)
   if (tq_shft != &coff_type.type_qualifiers[0] && tq_shft[-1] == tq_Proc)
     {
       /* If this is a function, ignore it, so that we don't get two
-        entries (one from the .ent, and one for the .def that
-        precedes it).  Save the type information so that the end
-        block can properly add it after the begin block index.  For
-        MIPS knows what reason, we must strip off the function type
-        at this point.  */
+         entries (one from the .ent, and one for the .def that
+         precedes it).  Save the type information so that the end
+         block can properly add it after the begin block index.  For
+         MIPS knows what reason, we must strip off the function type
+         at this point.  */
       coff_is_function = 1;
       tq_shft[-1] = tq_Nil;
     }
@@ -2763,26 +2741,23 @@ ecoff_directive_type (ignore)
    union or enum.  */
 
 void
-ecoff_directive_tag (ignore)
-     int ignore;
+ecoff_directive_tag (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".tag pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".tag pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
-  coff_tag = (char *) xmalloc ((unsigned long) (strlen (name) + 1));
-  strcpy (coff_tag, name);
+  coff_tag = xstrdup (name);
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   demand_empty_rest_of_line ();
 }
@@ -2791,14 +2766,13 @@ ecoff_directive_tag (ignore)
    may be the name of a static or global symbol.  */
 
 void
-ecoff_directive_val (ignore)
-     int ignore;
+ecoff_directive_val (int ignore ATTRIBUTE_UNUSED)
 {
   expressionS exp;
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".val pseudo-op used outside of .def/.endef; ignored");
+      as_warn (_(".val pseudo-op used outside of .def/.endef; ignored"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2806,7 +2780,7 @@ ecoff_directive_val (ignore)
   expression (&exp);
   if (exp.X_op != O_constant && exp.X_op != O_symbol)
     {
-      as_bad (".val expression is too copmlex");
+      as_bad (_(".val expression is too complex"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -2826,8 +2800,7 @@ ecoff_directive_val (ignore)
    debugging information for a symbol.  */
 
 void
-ecoff_directive_endef (ignore)
-     int ignore;
+ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   symint_t indx;
@@ -2837,7 +2810,7 @@ ecoff_directive_endef (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
-      as_warn (".endef pseudo-op used before .def; ignored");
+      as_warn (_(".endef pseudo-op used before .def; ignored"));
       return;
     }
 
@@ -2863,13 +2836,13 @@ ecoff_directive_endef (ignore)
 
       if (coff_type.num_sizes != 1 || diff < 0)
        {
-         as_warn ("Bad COFF debugging info");
+         as_warn (_("bad COFF debugging information"));
          return;
        }
 
       /* If this is an array, make sure the same number of dimensions
-        and sizes were passed, creating extra sizes for multiply
-        dimensioned arrays if not passed.  */
+         and sizes were passed, creating extra sizes for multiply
+         dimensioned arrays if not passed.  */
       coff_type.extra_sizes = 0;
       if (diff)
        {
@@ -2893,8 +2866,8 @@ ecoff_directive_endef (ignore)
   else if (coff_symbol_typ == st_Member
           && coff_type.num_sizes - coff_type.extra_sizes == 1)
     {
-      /* Is this a bitfield?  This is indicated by a structure memeber
-        having a size field that isn't an array.  */
+      /* Is this a bitfield?  This is indicated by a structure member
+         having a size field that isn't an array.  */
       coff_type.bitfield = 1;
     }
 
@@ -2912,7 +2885,7 @@ ecoff_directive_endef (ignore)
        {
          if (coff_tag == (char *) NULL)
            {
-             as_warn ("No tag specified for %s", name);
+             as_warn (_("no tag specified for %s"), name);
              return;
            }
 
@@ -2939,12 +2912,12 @@ ecoff_directive_endef (ignore)
       break;
 
       /* For the beginning of structs, unions, and enumerations, the
-        size info needs to be passed in the value field.  */
+         size info needs to be passed in the value field.  */
     case st_Block:
       if (coff_type.num_sizes - coff_type.num_dims - coff_type.extra_sizes
          != 1)
        {
-         as_warn ("Bad COFF debugging information");
+         as_warn (_("bad COFF debugging information"));
          return;
        }
       else
@@ -2954,8 +2927,8 @@ ecoff_directive_endef (ignore)
       break;
 
       /* For the end of structs, unions, and enumerations, omit the
-        name which is always ".eos".  This needs to be done last, so
-        that any error reporting above gives the correct name.  */
+         name which is always ".eos".  This needs to be done last, so
+         that any error reporting above gives the correct name.  */
     case st_End:
       free (name);
       name = (char *) NULL;
@@ -2964,10 +2937,10 @@ ecoff_directive_endef (ignore)
       break;
 
       /* Members of structures and unions that aren't bitfields, need
-        to adjust the value from a byte offset to a bit offset.
-        Members of enumerations do not have the value adjusted, and
-        can be distinguished by indx == indexNil.  For enumerations,
-        update the maximum enumeration value.  */
+         to adjust the value from a byte offset to a bit offset.
+         Members of enumerations do not have the value adjusted, and
+         can be distinguished by indx == indexNil.  For enumerations,
+         update the maximum enumeration value.  */
     case st_Member:
       if (! coff_type.bitfield && ! coff_inside_enumeration)
        coff_value *= 8;
@@ -3006,36 +2979,32 @@ ecoff_directive_endef (ignore)
 /* Parse .end directives.  */
 
 void
-ecoff_directive_end (ignore)
-     int ignore;
+ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   char name_end;
-  register int ch;
   symbolS *ent;
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
-      as_warn (".end directive without a preceding .file directive");
+      as_warn (_(".end directive without a preceding .file directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".end directive without a preceding .ent directive");
+      as_warn (_(".end directive without a preceding .ent directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
-  ch = *name;
-  if (! is_name_beginner (ch))
+  if (name == input_line_pointer)
     {
-      as_warn (".end directive has no name");
-      *input_line_pointer = name_end;
+      as_warn (_(".end directive has no name"));
+      (void) restore_line_pointer (name_end);
       demand_empty_rest_of_line ();
       return;
     }
@@ -3046,55 +3015,55 @@ ecoff_directive_end (ignore)
      symbol.  */
   ent = symbol_find (name);
   if (ent == (symbolS *) NULL)
-    as_warn (".end directive names unknown symbol");
+    as_warn (_(".end directive names unknown symbol"));
   else
     (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
-                            symbol_new ("L0\001", now_seg,
+                            symbol_new (FAKE_LABEL_NAME, now_seg,
                                         (valueT) frag_now_fix (),
                                         frag_now),
                             (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
+
   cur_proc_ptr = (proc_t *) NULL;
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
   demand_empty_rest_of_line ();
 }
 \f
 /* Parse .ent directives.  */
 
 void
-ecoff_directive_ent (ignore)
-     int ignore;
+ecoff_directive_ent (int aent)
 {
   char *name;
   char name_end;
-  register int ch;
 
   if (cur_file_ptr == (efdr_t *) NULL)
     add_file ((const char *) NULL, 0, 1);
 
-  if (cur_proc_ptr != (proc_t *) NULL)
+  if (!aent && cur_proc_ptr != (proc_t *) NULL)
     {
-      as_warn ("second .ent directive found before .end directive");
+      as_warn (_("second .ent directive found before .end directive"));
       demand_empty_rest_of_line ();
       return;
     }
 
-  name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&name);
 
-  ch = *name;
-  if (! is_name_beginner (ch))
+  if (name == input_line_pointer)
     {
-      as_warn (".ent directive has no name");
-      *input_line_pointer = name_end;
+      as_warn (_("%s directive has no name"), aent ? ".aent" : ".ent");
+      (void) restore_line_pointer (name_end);
       demand_empty_rest_of_line ();
       return;
     }
 
-  add_procedure (name);
+  add_procedure (name, aent);
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   /* The .ent directive is sometimes followed by a number.  I'm not
      really sure what the number means.  I don't see any way to store
@@ -3106,7 +3075,8 @@ ecoff_directive_ent (ignore)
       ++input_line_pointer;
       SKIP_WHITESPACE ();
     }
-  if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+  if (ISDIGIT (*input_line_pointer)
+      || *input_line_pointer == '-')
     (void) get_absolute_expression ();
 
   demand_empty_rest_of_line ();
@@ -3115,18 +3085,16 @@ ecoff_directive_ent (ignore)
 /* Parse .extern directives.  */
 
 void
-ecoff_directive_extern (ignore)
-     int ignore;
+ecoff_directive_extern (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   int c;
   symbolS *symbolp;
   valueT size;
 
-  name = input_line_pointer;
-  c = get_symbol_end ();
+  c = get_symbol_name (&name);
   symbolp = symbol_find_or_make (name);
-  *input_line_pointer = c;
+  (void) restore_line_pointer (c);
 
   S_SET_EXTERNAL (symbolp);
 
@@ -3134,14 +3102,13 @@ ecoff_directive_extern (ignore)
     ++input_line_pointer;
   size = get_absolute_expression ();
 
-  symbolp->ecoff_extern_size = size;
+  symbol_get_obj (symbolp)->ecoff_extern_size = size;
 }
 \f
 /* Parse .file directives.  */
 
 void
-ecoff_directive_file (ignore)
-     int ignore;
+ecoff_directive_file (int ignore ATTRIBUTE_UNUSED)
 {
   int indx;
   char *name;
@@ -3149,7 +3116,7 @@ ecoff_directive_file (ignore)
 
   if (cur_proc_ptr != (proc_t *) NULL)
     {
-      as_warn ("No way to handle .file within .ent/.end section");
+      as_warn (_("no way to handle .file within .ent/.end section"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -3167,21 +3134,20 @@ ecoff_directive_file (ignore)
 /* Parse .fmask directives.  */
 
 void
-ecoff_directive_fmask (ignore)
-     int ignore;
+ecoff_directive_fmask (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".fmask outside of .ent");
+      as_warn (_(".fmask outside of .ent"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn ("Bad .fmask directive");
+      as_warn (_("bad .fmask directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3196,14 +3162,13 @@ ecoff_directive_fmask (ignore)
 /* Parse .frame directives.  */
 
 void
-ecoff_directive_frame (ignore)
-     int ignore;
+ecoff_directive_frame (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".frame outside of .ent");
+      as_warn (_(".frame outside of .ent"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -3214,7 +3179,7 @@ ecoff_directive_frame (ignore)
   if (*input_line_pointer++ != ','
       || get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn ("Bad .frame directive");
+      as_warn (_("bad .frame directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3224,33 +3189,29 @@ ecoff_directive_frame (ignore)
 
   cur_proc_ptr->pdr.pcreg = tc_get_register (0);
 
-#if 0 /* Alpha-OSF1 adds "the offset of saved $a0 from $sp", according
-        to Sandro.  I don't yet know where this value should be stored, if
-        anywhere.  */
-  demand_empty_rest_of_line ();
-#else
+  /* Alpha-OSF1 adds "the offset of saved $a0 from $sp", according to
+     Sandro.  I don't yet know where this value should be stored, if
+     anywhere.  Don't call demand_empty_rest_of_line ().  */
   s_ignore (42);
-#endif
 }
 \f
 /* Parse .mask directives.  */
 
 void
-ecoff_directive_mask (ignore)
-     int ignore;
+ecoff_directive_mask (int ignore ATTRIBUTE_UNUSED)
 {
   long val;
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
-      as_warn (".mask outside of .ent");
+      as_warn (_(".mask outside of .ent"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (get_absolute_expression_and_terminator (&val) != ',')
     {
-      as_warn ("Bad .mask directive");
+      as_warn (_("bad .mask directive"));
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3265,22 +3226,21 @@ ecoff_directive_mask (ignore)
 /* Parse .loc directives.  */
 
 void
-ecoff_directive_loc (ignore)
-     int ignore;
+ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
 {
   lineno_list_t *list;
   symint_t lineno;
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
-      as_warn (".loc before .file");
+      as_warn (_(".loc before .file"));
       demand_empty_rest_of_line ();
       return;
     }
 
   if (now_seg != text_section)
     {
-      as_warn (".loc outside of .text");
+      as_warn (_(".loc outside of .text"));
       demand_empty_rest_of_line ();
       return;
     }
@@ -3302,7 +3262,7 @@ ecoff_directive_loc (ignore)
   if (stabs_seen)
     {
       (void) add_ecoff_symbol ((char *) NULL, st_Label, sc_Text,
-                              symbol_new ("L0\001", now_seg,
+                              symbol_new (FAKE_LABEL_NAME, now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
                               (bfd_vma) 0, 0, lineno);
@@ -3346,9 +3306,7 @@ ecoff_directive_loc (ignore)
    information so that it points to the instruction after the nop.  */
 
 void
-ecoff_fix_loc (old_frag, old_frag_offset)
-     fragS *old_frag;
-     unsigned long old_frag_offset;
+ecoff_fix_loc (fragS *old_frag, unsigned long old_frag_offset)
 {
   if (last_lineno != NULL
       && last_lineno->frag == old_frag
@@ -3362,14 +3320,13 @@ ecoff_fix_loc (old_frag, old_frag_offset)
 /* Make sure the @stabs symbol is emitted.  */
 
 static void
-mark_stabs (ignore)
-     int ignore;
+mark_stabs (int ignore ATTRIBUTE_UNUSED)
 {
   if (! stabs_seen)
     {
-      /* Add a dummy @stabs dymbol. */
+      /* Add a dummy @stabs symbol.  */
       stabs_seen = 1;
-      (void) add_ecoff_symbol (stabs_symbol, stNil, scInfo,
+      (void) add_ecoff_symbol (stabs_symbol, st_Nil, sc_Info,
                               (symbolS *) NULL,
                               (bfd_vma) 0, (symint_t) -1,
                               ECOFF_MARK_STAB (0));
@@ -3377,20 +3334,19 @@ mark_stabs (ignore)
 }
 \f
 /* Parse .weakext directives.  */
-
+#ifndef TC_MIPS
+/* For TC_MIPS use the version in tc-mips.c.  */
 void
-ecoff_directive_weakext (ignore)
-     int ignore;
+ecoff_directive_weakext (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   int c;
   symbolS *symbolP;
   expressionS exp;
 
-  name = input_line_pointer;
-  c = get_symbol_end ();
+  c = get_symbol_name (&name);
   symbolP = symbol_find_or_make (name);
-  *input_line_pointer = c;
+  (void) restore_line_pointer (c);
 
   SKIP_WHITESPACE ();
 
@@ -3398,7 +3354,7 @@ ecoff_directive_weakext (ignore)
     {
       if (S_IS_DEFINED (symbolP))
        {
-         as_bad ("Ignoring attempt to redefine symbol `%s'.",
+         as_bad (_("symbol `%s' is already defined"),
                  S_GET_NAME (symbolP));
          ignore_rest_of_line ();
          return;
@@ -3411,11 +3367,11 @@ ecoff_directive_weakext (ignore)
          expression (&exp);
          if (exp.X_op != O_symbol)
            {
-             as_bad ("bad .weakext directive");
-             ignore_rest_of_line();
+             as_bad (_("bad .weakext directive"));
+             ignore_rest_of_line ();
              return;
            }
-         symbolP->sy_value = exp;
+         symbol_set_value_expression (symbolP, &exp);
        }
     }
 
@@ -3423,6 +3379,7 @@ ecoff_directive_weakext (ignore)
 
   demand_empty_rest_of_line ();
 }
+#endif /* not TC_MIPS */
 \f
 /* Handle .stabs directives.  The actual parsing routine is done by a
    generic routine.  This routine is called via OBJ_PROCESS_STAB.
@@ -3457,13 +3414,12 @@ ecoff_directive_weakext (ignore)
        value           a numeric value or an address.  */
 
 void
-ecoff_stab (sec, what, string, type, other, desc)
-     segT sec;
-     int what;
-     const char *string;
-     int type;
-     int other;
-     int desc;
+ecoff_stab (segT sec ATTRIBUTE_UNUSED,
+           int what,
+           const char *string,
+           int type,
+           int other,
+           int desc)
 {
   efdr_t *save_file_ptr = cur_file_ptr;
   symbolS *sym;
@@ -3479,7 +3435,7 @@ ecoff_stab (sec, what, string, type, other, desc)
   /* We don't handle .stabd.  */
   if (what != 's' && what != 'n')
     {
-      as_bad (".stab%c is not supported", what);
+      as_bad (_(".stab%c is not supported"), what);
       return;
     }
 
@@ -3489,7 +3445,7 @@ ecoff_stab (sec, what, string, type, other, desc)
 
   /* We ignore the other field.  */
   if (other != 0)
-    as_warn (".stab%c: ignoring non-zero other field", what);
+    as_warn (_(".stab%c: ignoring non-zero other field"), what);
 
   /* Make sure we have a current file.  */
   if (cur_file_ptr == (efdr_t *) NULL)
@@ -3523,16 +3479,14 @@ ecoff_stab (sec, what, string, type, other, desc)
       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)",
+         as_warn (_("line number (%d) for .stab%c directive cannot fit in index field (20 bits)"),
                   desc, what);
          return;
        }
 
-      name = input_line_pointer;
-      name_end = get_symbol_end ();
-
+      name_end = get_symbol_name (&name);
       sym = symbol_find_or_make (name);
-      *input_line_pointer = name_end;
+      (void) restore_line_pointer (name_end);
 
       value = 0;
       addend = 0;
@@ -3547,7 +3501,7 @@ ecoff_stab (sec, what, string, type, other, desc)
        listing_source_file (string);
 #endif
 
-      if (isdigit (*input_line_pointer)
+      if (ISDIGIT (*input_line_pointer)
          || *input_line_pointer == '-'
          || *input_line_pointer == '+')
        {
@@ -3559,7 +3513,7 @@ ecoff_stab (sec, what, string, type, other, desc)
        }
       else if (! is_name_beginner ((unsigned char) *input_line_pointer))
        {
-         as_warn ("Illegal .stab%c directive, bad character", what);
+         as_warn (_("illegal .stab%c directive, bad character"), what);
          return;
        }
       else
@@ -3597,12 +3551,12 @@ ecoff_stab (sec, what, string, type, other, desc)
      ECOFF symbol.  We want to compute the type of the ECOFF symbol
      independently.  */
   if (sym != (symbolS *) NULL)
-    hold = sym->ecoff_symbol;
+    hold = symbol_get_obj (sym)->ecoff_symbol;
 
   (void) add_ecoff_symbol (string, st, sc, sym, addend, value, indx);
 
   if (sym != (symbolS *) NULL)
-    sym->ecoff_symbol = hold;
+    symbol_get_obj (sym)->ecoff_symbol = hold;
 
   /* Restore normal file type.  */
   cur_file_ptr = save_file_ptr;
@@ -3612,8 +3566,7 @@ ecoff_stab (sec, what, string, type, other, desc)
    .scommon section rather than bfd_com_section.  */
 
 void
-ecoff_frob_symbol (sym)
-     symbolS *sym;
+ecoff_frob_symbol (symbolS *sym)
 {
   if (S_IS_COMMON (sym)
       && S_GET_VALUE (sym) > 0
@@ -3623,15 +3576,15 @@ ecoff_frob_symbol (sym)
       static asymbol scom_symbol;
 
       /* We must construct a fake section similar to bfd_com_section
-        but with the name .scommon.  */
+         but with the name .scommon.  */
       if (scom_section.name == NULL)
        {
-         scom_section = bfd_com_section;
+         scom_section = *bfd_com_section_ptr;
          scom_section.name = ".scommon";
          scom_section.output_section = &scom_section;
          scom_section.symbol = &scom_symbol;
          scom_section.symbol_ptr_ptr = &scom_section.symbol;
-         scom_symbol = *bfd_com_section.symbol;
+         scom_symbol = *bfd_com_section_ptr->symbol;
          scom_symbol.name = ".scommon";
          scom_symbol.section = &scom_section;
        }
@@ -3639,10 +3592,10 @@ ecoff_frob_symbol (sym)
     }
 
   /* Double check weak symbols.  */
-  if (sym->bsym->flags & BSF_WEAK)
+  if (S_IS_WEAK (sym))
     {
       if (S_IS_COMMON (sym))
-       as_bad ("Symbol `%s' can not be both weak and common",
+       as_bad (_("symbol `%s' can not be both weak and common"),
                S_GET_NAME (sym));
     }
 }
@@ -3650,11 +3603,10 @@ ecoff_frob_symbol (sym)
 /* Add bytes to the symbolic information buffer.  */
 
 static char *
-ecoff_add_bytes (buf, bufend, bufptr, need)
-     char **buf;
-     char **bufend;
-     char *bufptr;
-     unsigned long need;
+ecoff_add_bytes (char **buf,
+                char **bufend,
+                char *bufptr,
+                unsigned long need)
 {
   unsigned long at;
   unsigned long want;
@@ -3664,7 +3616,7 @@ ecoff_add_bytes (buf, bufend, bufptr, need)
   if (need < PAGE_SIZE)
     need = PAGE_SIZE;
   want = (*bufend - *buf) + need;
-  *buf = xrealloc (*buf, want);
+  *buf = XRESIZEVEC (char, *buf, want);
   *bufend = *buf + want;
   return *buf + at;
 }
@@ -3673,12 +3625,11 @@ ecoff_add_bytes (buf, bufend, bufptr, need)
    for the ECOFF target debugging information.  */
 
 static unsigned long
-ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     char **bufptrptr;
+ecoff_padding_adjust (const struct ecoff_debug_swap *backend,
+                     char **buf,
+                     char **bufend,
+                     unsigned long offset,
+                     char **bufptrptr)
 {
   bfd_size_type align;
 
@@ -3688,7 +3639,7 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
       unsigned long add;
 
       add = align - (offset & (align - 1));
-      if (*bufend - (*buf + offset) < add)
+      if ((unsigned long) (*bufend - (*buf + offset)) < add)
        (void) ecoff_add_bytes (buf, bufend, *buf + offset, add);
       memset (*buf + offset, 0, add);
       offset += add;
@@ -3702,15 +3653,14 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
 /* Build the line number information.  */
 
 static unsigned long
-ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     long *linecntptr;
+ecoff_build_lineno (const struct ecoff_debug_swap *backend,
+                   char **buf,
+                   char **bufend,
+                   unsigned long offset,
+                   long *linecntptr)
 {
   char *bufptr;
-  register lineno_list_t *l;
+  lineno_list_t *l;
   lineno_list_t *last;
   efdr_t *file;
   proc_t *proc;
@@ -3718,6 +3668,7 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
   long iline;
   long totcount;
   lineno_list_t first;
+  lineno_list_t *local_first_lineno = first_lineno;
 
   if (linecntptr != (long *) NULL)
     *linecntptr = 0;
@@ -3731,38 +3682,43 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
   iline = 0;
   totcount = 0;
 
+  /* FIXME?  Now that MIPS embedded-PIC is gone, it may be safe to
+     remove this code.  */
   /* For some reason the address of the first procedure is ignored
      when reading line numbers.  This doesn't matter if the address of
      the first procedure is 0, but when gcc is generating MIPS
      embedded PIC code, it will put strings in the .text section
      before the first procedure.  We cope by inserting a dummy line if
      the address of the first procedure is not 0.  Hopefully this
-     won't screw things up too badly.  */
-  if (first_proc_ptr != (proc_t *) NULL
-      && first_lineno != (lineno_list_t *) NULL
+     won't screw things up too badly.
+
+     Don't do this for ECOFF assembly source line numbers.  They work
+     without this extra attention.  */
+  if (debug_type != DEBUG_ECOFF
+      && first_proc_ptr != (proc_t *) NULL
+      && local_first_lineno != (lineno_list_t *) NULL
       && ((S_GET_VALUE (first_proc_ptr->sym->as_sym)
-          + bfd_get_section_vma (stdoutput,
-                                 S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
+          + bfd_section_vma (S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
          != 0))
     {
-      first.file = first_lineno->file;
-      first.proc = first_lineno->proc;
+      first.file = local_first_lineno->file;
+      first.proc = local_first_lineno->proc;
       first.frag = &zero_address_frag;
       first.paddr = 0;
       first.lineno = 0;
 
-      first.next = first_lineno;
-      first_lineno = &first;
+      first.next = local_first_lineno;
+      local_first_lineno = &first;
     }
 
-  for (l = first_lineno; l != (lineno_list_t *) NULL; l = l->next)
+  for (l = local_first_lineno; l != (lineno_list_t *) NULL; l = l->next)
     {
       long count;
       long delta;
 
       /* Get the offset to the memory address of the next line number
-        (in words).  Do this first, so that we can skip ahead to the
-        next useful line number entry.  */
+         (in words).  Do this first, so that we can skip ahead to the
+         next useful line number entry.  */
       if (l->next == (lineno_list_t *) NULL)
        {
          /* We want a count of zero, but it will be decremented
@@ -3927,14 +3883,13 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
 /* Build and swap out the symbols.  */
 
 static unsigned long
-ecoff_build_symbols (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_symbols (const struct ecoff_debug_swap *backend,
+                    char **buf,
+                    char **bufend,
+                    unsigned long offset)
 {
   const bfd_size_type external_sym_size = backend->external_sym_size;
-  void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR))
+  void (* const swap_sym_out) (bfd *, const SYMR *, void *)
     = backend->swap_sym_out;
   char *sym_out;
   long isym;
@@ -4002,11 +3957,11 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                      symint_t indx;
 
                      /* The value of a block start symbol is the
-                        offset from the start of the procedure.  For
-                        other symbols we just use the gas value (but
-                        we must offset it by the vma of the section,
-                        just as BFD does, because BFD will not see
-                        this value).  */
+                        offset from the start of the procedure.  For
+                        other symbols we just use the gas value (but
+                        we must offset it by the vma of the section,
+                        just as BFD does, because BFD will not see
+                        this value).  */
                      if (sym_ptr->ecoff_sym.asym.st == (int) st_Block
                          && sym_ptr->ecoff_sym.asym.sc == (int) sc_Text)
                        {
@@ -4016,15 +3971,14 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                          begin_sym = sym_ptr->proc_ptr->sym->as_sym;
                          if (S_GET_SEGMENT (as_sym)
                              != S_GET_SEGMENT (begin_sym))
-                           as_warn (".begin/.bend in different segments");
+                           as_warn (_(".begin/.bend in different segments"));
                          sym_ptr->ecoff_sym.asym.value =
                            S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
                        }
                      else
                        sym_ptr->ecoff_sym.asym.value =
                          (S_GET_VALUE (as_sym)
-                          + bfd_get_section_vma (stdoutput,
-                                                 S_GET_SEGMENT (as_sym))
+                          + bfd_section_vma (S_GET_SEGMENT (as_sym))
                           + sym_ptr->addend);
 
                      sym_ptr->ecoff_sym.weakext = S_IS_WEAK (as_sym);
@@ -4038,8 +3992,8 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        sym_ptr->ecoff_sym.asym.st = st_StaticProc;
 
                      /* Get the type and storage class based on where
-                        the symbol actually wound up.  Traditionally,
-                        N_LBRAC and N_RBRAC are *not* relocated. */
+                        the symbol actually wound up.  Traditionally,
+                        N_LBRAC and N_RBRAC are *not* relocated.  */
                      indx = sym_ptr->ecoff_sym.asym.index;
                      if (sym_ptr->ecoff_sym.asym.st == st_Nil
                          && sym_ptr->ecoff_sym.asym.sc == sc_Nil
@@ -4060,7 +4014,8 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                                  || S_IS_WEAK (as_sym)
                                  || ! S_IS_DEFINED (as_sym)))
                            {
-                             if ((as_sym->bsym->flags & BSF_FUNCTION) != 0)
+                             if ((symbol_get_bfdsym (as_sym)->flags
+                                  & BSF_FUNCTION) != 0)
                                st = st_Proc;
                              else
                                st = st_Global;
@@ -4072,18 +4027,19 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 
                          if (! S_IS_DEFINED (as_sym))
                            {
-                             if (as_sym->ecoff_extern_size == 0
-                                 || (as_sym->ecoff_extern_size
-                                     > bfd_get_gp_size (stdoutput)))
+                             valueT s;
+
+                             s = symbol_get_obj (as_sym)->ecoff_extern_size;
+                             if (s == 0
+                                 || s > bfd_get_gp_size (stdoutput))
                                sc = sc_Undefined;
                              else
                                {
                                  sc = sc_SUndefined;
-                                 sym_ptr->ecoff_sym.asym.value =
-                                   as_sym->ecoff_extern_size;
+                                 sym_ptr->ecoff_sym.asym.value = s;
                                }
 #ifdef S_SET_SIZE
-                             S_SET_SIZE (as_sym, as_sym->ecoff_extern_size);
+                             S_SET_SIZE (as_sym, s);
 #endif
                            }
                          else if (S_IS_COMMON (as_sym))
@@ -4108,13 +4064,13 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                            sc = sc_Bss;
                          else if (strcmp (segname, ".sbss") == 0)
                            sc = sc_SBss;
-                         else if (seg == &bfd_abs_section)
+                         else if (seg == bfd_abs_section_ptr)
                            sc = sc_Abs;
                          else
                            {
                              /* This must be a user named section.
-                                 This is not possible in ECOFF, but it
-                                 is in ELF.  */
+                                This is not possible in ECOFF, but it
+                                is in ELF.  */
                              sc = sc_Data;
                            }
 
@@ -4123,11 +4079,11 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        }
 
                      /* This is just an external symbol if it is
-                        outside a procedure and it has a type.
-                        FIXME: g++ will generate symbols which have
-                        different names in the debugging information
-                        than the actual symbol.  Should we handle
-                        them here?  */
+                        outside a procedure and it has a type.
+                        FIXME: g++ will generate symbols which have
+                        different names in the debugging information
+                        than the actual symbol.  Should we handle
+                        them here?  */
                      if ((S_IS_EXTERNAL (as_sym)
                           || S_IS_WEAK (as_sym)
                           || ! S_IS_DEFINED (as_sym))
@@ -4137,17 +4093,17 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        local = 0;
 
                      /* This is just an external symbol if it is a
-                         common symbol.  */
+                        common symbol.  */
                      if (S_IS_COMMON (as_sym))
                        local = 0;
 
                      /* If an st_end symbol has an associated gas
-                        symbol, then it is a local label created for
-                        a .bend or .end directive.  Stabs line
-                        numbers will have \001 in the names.  */
+                        symbol, then it is a local label created for
+                        a .bend or .end directive.  Stabs line
+                        numbers will have FAKE_LABEL_CHAR in the names.  */
                      if (local
                          && sym_ptr->ecoff_sym.asym.st != st_End
-                         && strchr (sym_ptr->name, '\001') == 0)
+                         && strchr (sym_ptr->name, FAKE_LABEL_CHAR) == 0)
                        sym_ptr->ecoff_sym.asym.iss =
                          add_string (&fil_ptr->strings,
                                      fil_ptr->str_hash,
@@ -4171,7 +4127,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        sym_ptr->ecoff_sym.asym.iss =
                          begin_ptr->ecoff_sym.asym.iss;
 
-                     begin_type = begin_ptr->ecoff_sym.asym.st;
+                     begin_type = (st_t) begin_ptr->ecoff_sym.asym.st;
                      if (begin_type == st_File
                          || begin_type == st_Block)
                        {
@@ -4192,10 +4148,10 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        }
 
                      /* The value of the symbol marking the end of a
-                        procedure is the size of the procedure.  The
-                        value of the symbol marking the end of a
-                        block is the offset from the start of the
-                        procedure to the block.  */
+                        procedure is the size of the procedure.  The
+                        value of the symbol marking the end of a
+                        block is the offset from the start of the
+                        procedure to the block.  */
                      if (begin_type == st_Proc
                          || begin_type == st_StaticProc)
                        {
@@ -4203,13 +4159,13 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                          know (begin_ptr->as_sym != (symbolS *) NULL);
                          if (S_GET_SEGMENT (as_sym)
                              != S_GET_SEGMENT (begin_ptr->as_sym))
-                           as_warn (".begin/.bend in different segments");
+                           as_warn (_(".begin/.bend in different segments"));
                          sym_ptr->ecoff_sym.asym.value =
                            (S_GET_VALUE (as_sym)
                             - S_GET_VALUE (begin_ptr->as_sym));
 
                          /* If the size is odd, this is probably a
-                             mips16 function; force it to be even.  */
+                            mips16 function; force it to be even.  */
                          if ((sym_ptr->ecoff_sym.asym.value & 1) != 0)
                            ++sym_ptr->ecoff_sym.asym.value;
 
@@ -4228,7 +4184,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                          begin_sym = sym_ptr->proc_ptr->sym->as_sym;
                          if (S_GET_SEGMENT (as_sym)
                              != S_GET_SEGMENT (begin_sym))
-                           as_warn (".begin/.bend in different segments");
+                           as_warn (_(".begin/.bend in different segments"));
                          sym_ptr->ecoff_sym.asym.value =
                            S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
                        }
@@ -4245,7 +4201,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 
                  if (local)
                    {
-                     if (*bufend - sym_out < external_sym_size)
+                     if ((bfd_size_type)(*bufend - sym_out) < external_sym_size)
                        sym_out = ecoff_add_bytes (buf, bufend,
                                                   sym_out,
                                                   external_sym_size);
@@ -4266,7 +4222,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                     case this is an external symbol.  Note that this
                     destroys the asym.index field.  */
                  if (as_sym != (symbolS *) NULL
-                     && as_sym->ecoff_symbol == sym_ptr)
+                     && symbol_get_obj (as_sym)->ecoff_symbol == sym_ptr)
                    {
                      if ((sym_ptr->ecoff_sym.asym.st == st_Proc
                           || sym_ptr->ecoff_sym.asym.st == st_StaticProc)
@@ -4275,7 +4231,7 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                      sym_ptr->ecoff_sym.ifd = fil_ptr->file_index;
 
                      /* Don't try to merge an FDR which has an
-                         external symbol attached to it.  */
+                        external symbol attached to it.  */
                      if (S_IS_EXTERNAL (as_sym) || S_IS_WEAK (as_sym))
                        fil_ptr->fdr.fMerge = 0;
                    }
@@ -4291,14 +4247,13 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 /* Swap out the procedure information.  */
 
 static unsigned long
-ecoff_build_procs (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_procs (const struct ecoff_debug_swap *backend,
+                  char **buf,
+                  char **bufend,
+                  unsigned long offset)
 {
   const bfd_size_type external_pdr_size = backend->external_pdr_size;
-  void (* const swap_pdr_out) PARAMS ((bfd *, const PDR *, PTR))
+  void (* const swap_pdr_out) (bfd *, const PDR *, void *)
     = backend->swap_pdr_out;
   char *pdr_out;
   long iproc;
@@ -4351,19 +4306,18 @@ ecoff_build_procs (backend, buf, bufend, offset)
 
                  adr_sym = proc_ptr->sym->as_sym;
                  adr = (S_GET_VALUE (adr_sym)
-                        + bfd_get_section_vma (stdoutput,
-                                               S_GET_SEGMENT (adr_sym)));
+                        + bfd_section_vma (S_GET_SEGMENT (adr_sym)));
                  if (first)
                    {
                      /* This code used to force the adr of the very
-                         first fdr to be 0.  However, the native tools
-                         don't do that, and I can't remember why it
-                         used to work that way, so I took it out.  */
+                        first fdr to be 0.  However, the native tools
+                        don't do that, and I can't remember why it
+                        used to work that way, so I took it out.  */
                      fil_ptr->fdr.adr = adr;
                      first = 0;
                    }
                  proc_ptr->pdr.adr = adr - fil_ptr->fdr.adr;
-                 if (*bufend - pdr_out < external_pdr_size)
+                 if ((bfd_size_type)(*bufend - pdr_out) < external_pdr_size)
                    pdr_out = ecoff_add_bytes (buf, bufend,
                                               pdr_out,
                                               external_pdr_size);
@@ -4382,11 +4336,10 @@ ecoff_build_procs (backend, buf, bufend, offset)
 /* Swap out the aux information.  */
 
 static unsigned long
-ecoff_build_aux (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_aux (const struct ecoff_debug_swap *backend,
+                char **buf,
+                char **bufend,
+                unsigned long offset)
 {
   int bigendian;
   union aux_ext *aux_out;
@@ -4436,7 +4389,8 @@ ecoff_build_aux (backend, buf, bufend, offset)
              aux_end = aux_ptr + aux_cnt;
              for (; aux_ptr < aux_end; aux_ptr++)
                {
-                 if (*bufend - (char *) aux_out < sizeof (union aux_ext))
+                 if ((unsigned long) (*bufend - (char *) aux_out)
+                     < sizeof (union aux_ext))
                    aux_out = ((union aux_ext *)
                               ecoff_add_bytes (buf, bufend,
                                                (char *) aux_out,
@@ -4496,11 +4450,10 @@ ecoff_build_aux (backend, buf, bufend, offset)
    bytes copied, rather than the new offset.  */
 
 static unsigned long
-ecoff_build_strings (buf, bufend, offset, vp)
-     char **buf;
-     char **bufend;
-     unsigned long offset;
-     varray_t *vp;
+ecoff_build_strings (char **buf,
+                    char **bufend,
+                    unsigned long offset,
+                    varray_t *vp)
 {
   unsigned long istr;
   char *str_out;
@@ -4521,7 +4474,7 @@ ecoff_build_strings (buf, bufend, offset, vp)
       else
        str_cnt = vp->objects_per_page;
 
-      if (*bufend - str_out < str_cnt)
+      if ((unsigned long)(*bufend - str_out) < str_cnt)
        str_out = ecoff_add_bytes (buf, bufend, str_out, str_cnt);
 
       memcpy (str_out, str_link->datum->byte, str_cnt);
@@ -4535,11 +4488,10 @@ ecoff_build_strings (buf, bufend, offset, vp)
 /* Dump out the local strings.  */
 
 static unsigned long
-ecoff_build_ss (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_ss (const struct ecoff_debug_swap *backend,
+               char **buf,
+               char **bufend,
+               unsigned long offset)
 {
   long iss;
   vlinks_t *file_link;
@@ -4579,14 +4531,13 @@ ecoff_build_ss (backend, buf, bufend, offset)
 /* Swap out the file descriptors.  */
 
 static unsigned long
-ecoff_build_fdr (backend, buf, bufend, offset)
-     const struct ecoff_debug_swap *backend;
-     char **buf;
-     char **bufend;
-     unsigned long offset;
+ecoff_build_fdr (const struct ecoff_debug_swap *backend,
+                char **buf,
+                char **bufend,
+                unsigned long offset)
 {
   const bfd_size_type external_fdr_size = backend->external_fdr_size;
-  void (* const swap_fdr_out) PARAMS ((bfd *, const FDR *, PTR))
+  void (* const swap_fdr_out) (bfd *, const FDR *, void *)
     = backend->swap_fdr_out;
   long ifile;
   char *fdr_out;
@@ -4612,7 +4563,7 @@ ecoff_build_fdr (backend, buf, bufend, offset)
       fil_end = fil_ptr + fil_cnt;
       for (; fil_ptr < fil_end; fil_ptr++)
        {
-         if (*bufend - fdr_out < external_fdr_size)
+         if ((bfd_size_type)(*bufend - fdr_out) < external_fdr_size)
            fdr_out = ecoff_add_bytes (buf, bufend, fdr_out,
                                       external_fdr_size);
          (*swap_fdr_out) (stdoutput, &fil_ptr->fdr, fdr_out);
@@ -4629,13 +4580,13 @@ ecoff_build_fdr (backend, buf, bufend, offset)
    calls a backend function to deal with it.  */
 
 static void
-ecoff_setup_ext ()
+ecoff_setup_ext (void)
 {
-  register symbolS *sym;
+  symbolS *sym;
 
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
     {
-      if (sym->ecoff_symbol == NULL)
+      if (symbol_get_obj (sym)->ecoff_symbol == NULL)
        continue;
 
       /* If this is a local symbol, then force the fields to zero.  */
@@ -4643,23 +4594,25 @@ ecoff_setup_ext ()
          && ! S_IS_WEAK (sym)
          && S_IS_DEFINED (sym))
        {
-         sym->ecoff_symbol->ecoff_sym.asym.value = 0;
-         sym->ecoff_symbol->ecoff_sym.asym.st = (int) st_Nil;
-         sym->ecoff_symbol->ecoff_sym.asym.sc = (int) sc_Nil;
-         sym->ecoff_symbol->ecoff_sym.asym.index = indexNil;
+         struct localsym *lsym;
+
+         lsym = symbol_get_obj (sym)->ecoff_symbol;
+         lsym->ecoff_sym.asym.value = 0;
+         lsym->ecoff_sym.asym.st = (int) st_Nil;
+         lsym->ecoff_sym.asym.sc = (int) sc_Nil;
+         lsym->ecoff_sym.asym.index = indexNil;
        }
 
-      obj_ecoff_set_ext (sym, &sym->ecoff_symbol->ecoff_sym);
+      obj_ecoff_set_ext (sym, &symbol_get_obj (sym)->ecoff_symbol->ecoff_sym);
     }
 }
 
 /* Build the ECOFF debugging information.  */
 
 unsigned long
-ecoff_build_debug (hdr, bufp, backend)
-     HDRR *hdr;
-     char **bufp;
-     const struct ecoff_debug_swap *backend;
+ecoff_build_debug (HDRR *hdr,
+                  char **bufp,
+                  const struct ecoff_debug_swap *backend)
 {
   const bfd_size_type external_pdr_size = backend->external_pdr_size;
   tag_t *ptag;
@@ -4667,7 +4620,7 @@ ecoff_build_debug (hdr, bufp, backend)
   efdr_t *fil_ptr;
   int end_warning;
   efdr_t *hold_file_ptr;
-  proc_t * hold_proc_ptr;
+  proc_t *hold_proc_ptr;
   symbolS *sym;
   char *buf;
   char *bufend;
@@ -4699,12 +4652,12 @@ ecoff_build_debug (hdr, bufp, backend)
   cur_proc_ptr = (proc_t *) NULL;
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
     {
-      if (sym->ecoff_symbol != NULL
-         || sym->ecoff_file == (efdr_t *) NULL
-         || (sym->bsym->flags & BSF_SECTION_SYM) != 0)
+      if (symbol_get_obj (sym)->ecoff_symbol != NULL
+         || symbol_get_obj (sym)->ecoff_file == (efdr_t *) NULL
+         || (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0)
        continue;
 
-      cur_file_ptr = sym->ecoff_file;
+      cur_file_ptr = symbol_get_obj (sym)->ecoff_file;
       add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
                        (bfd_vma) 0, S_GET_VALUE (sym), indexNil);
     }
@@ -4726,7 +4679,7 @@ ecoff_build_debug (hdr, bufp, backend)
          cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev;
          if (! end_warning && ! cur_file_ptr->fake)
            {
-             as_warn ("Missing .end or .bend at end of file");
+             as_warn (_("missing .end or .bend at end of file"));
              end_warning = 1;
            }
        }
@@ -4741,7 +4694,7 @@ ecoff_build_debug (hdr, bufp, backend)
 
   /* Build the symbolic information.  */
   offset = 0;
-  buf = xmalloc (PAGE_SIZE);
+  buf = XNEWVEC (char, PAGE_SIZE);
   bufend = buf + PAGE_SIZE;
 
   /* Build the line number information.  */
@@ -4759,7 +4712,7 @@ ecoff_build_debug (hdr, bufp, backend)
      space at this point.  */
   hdr->ipdMax = proc_cnt;
   hdr->cbPdOffset = offset;
-  if (bufend - (buf + offset) < proc_cnt * external_pdr_size)
+  if ((bfd_size_type)(bufend - (buf + offset)) < proc_cnt * external_pdr_size)
     (void) ecoff_add_bytes (&buf, &bufend, buf + offset,
                            proc_cnt * external_pdr_size);
   offset += proc_cnt * external_pdr_size;
@@ -4823,10 +4776,9 @@ ecoff_build_debug (hdr, bufp, backend)
 #ifndef MALLOC_CHECK
 
 static page_type *
-allocate_cluster (npages)
-     unsigned long npages;
+allocate_cluster (unsigned long npages)
 {
-  register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
+  page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
 
 #ifdef ECOFF_DEBUG
   if (debug > 3)
@@ -4838,7 +4790,6 @@ allocate_cluster (npages)
   return value;
 }
 
-
 static page_type *cluster_ptr = NULL;
 static unsigned long pages_left = 0;
 
@@ -4847,7 +4798,7 @@ static unsigned long pages_left = 0;
 /* Allocate one page (which is initialized to 0).  */
 
 static page_type *
-allocate_page ()
+allocate_page (void)
 {
 #ifndef MALLOC_CHECK
 
@@ -4860,7 +4811,7 @@ allocate_page ()
   pages_left--;
   return cluster_ptr++;
 
-#else  /* MALLOC_CHECK */
+#else /* MALLOC_CHECK */
 
   page_type *ptr;
 
@@ -4868,45 +4819,45 @@ allocate_page ()
   memset (ptr, 0, PAGE_USIZE);
   return ptr;
 
-#endif /* MALLOC_CHECK */
+#endif /* MALLOC_CHECK */
 }
 \f
 /* Allocate scoping information.  */
 
 static scope_t *
-allocate_scope ()
+allocate_scope (void)
 {
-  register scope_t *ptr;
+  scope_t *ptr;
   static scope_t initial_scope;
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int)alloc_type_scope].free_list.f_scope;
+  ptr = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
   if (ptr != (scope_t *) NULL)
-    alloc_counts[ (int)alloc_type_scope ].free_list.f_scope = ptr->free;
+    alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr->free;
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_scope].unallocated;
-      register page_type *cur_page     = alloc_counts[(int)alloc_type_scope].cur_page;
+      int unallocated  = alloc_counts[(int) alloc_type_scope].unallocated;
+      page_type *cur_page      = alloc_counts[(int) alloc_type_scope].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (scope_t);
-         alloc_counts[(int)alloc_type_scope].cur_page = cur_page = allocate_page ();
-         alloc_counts[(int)alloc_type_scope].total_pages++;
+         alloc_counts[(int) alloc_type_scope].cur_page = cur_page = allocate_page ();
+         alloc_counts[(int) alloc_type_scope].total_pages++;
        }
 
       ptr = &cur_page->scope[--unallocated];
-      alloc_counts[(int)alloc_type_scope].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_scope].unallocated = unallocated;
     }
 
 #else
 
-  ptr = (scope_t *) xmalloc (sizeof (scope_t));
+  ptr = XNEW (scope_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_scope].total_alloc++;
+  alloc_counts[(int) alloc_type_scope].total_alloc++;
   *ptr = initial_scope;
   return ptr;
 }
@@ -4914,49 +4865,48 @@ allocate_scope ()
 /* Free scoping information.  */
 
 static void
-free_scope (ptr)
-     scope_t *ptr;
+free_scope (scope_t *ptr)
 {
-  alloc_counts[(int)alloc_type_scope].total_free++;
+  alloc_counts[(int) alloc_type_scope].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[(int)alloc_type_scope].free_list.f_scope;
-  alloc_counts[(int)alloc_type_scope].free_list.f_scope = ptr;
+  ptr->free = alloc_counts[(int) alloc_type_scope].free_list.f_scope;
+  alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr;
 #else
-  free ((PTR) ptr);
+  free ((void *) ptr);
 #endif
 }
 \f
 /* Allocate links for pages in a virtual array.  */
 
 static vlinks_t *
-allocate_vlinks ()
+allocate_vlinks (void)
 {
-  register vlinks_t *ptr;
+  vlinks_t *ptr;
   static vlinks_t initial_vlinks;
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_vlinks].unallocated;
-  register page_type *cur_page = alloc_counts[(int)alloc_type_vlinks].cur_page;
+  int unallocated = alloc_counts[(int) alloc_type_vlinks].unallocated;
+  page_type *cur_page = alloc_counts[(int) alloc_type_vlinks].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (vlinks_t);
-      alloc_counts[(int)alloc_type_vlinks].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int)alloc_type_vlinks].total_pages++;
+      alloc_counts[(int) alloc_type_vlinks].cur_page = cur_page = allocate_page ();
+      alloc_counts[(int) alloc_type_vlinks].total_pages++;
     }
 
   ptr = &cur_page->vlinks[--unallocated];
-  alloc_counts[(int)alloc_type_vlinks].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_vlinks].unallocated = unallocated;
 
 #else
 
-  ptr = (vlinks_t *) xmalloc (sizeof (vlinks_t));
+  ptr = XNEW (vlinks_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_vlinks].total_alloc++;
+  alloc_counts[(int) alloc_type_vlinks].total_alloc++;
   *ptr = initial_vlinks;
   return ptr;
 }
@@ -4964,33 +4914,33 @@ allocate_vlinks ()
 /* Allocate string hash buckets.  */
 
 static shash_t *
-allocate_shash ()
+allocate_shash (void)
 {
-  register shash_t *ptr;
+  shash_t *ptr;
   static shash_t initial_shash;
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_shash].unallocated;
-  register page_type *cur_page = alloc_counts[(int)alloc_type_shash].cur_page;
+  int unallocated = alloc_counts[(int) alloc_type_shash].unallocated;
+  page_type *cur_page = alloc_counts[(int) alloc_type_shash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (shash_t);
-      alloc_counts[(int)alloc_type_shash].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int)alloc_type_shash].total_pages++;
+      alloc_counts[(int) alloc_type_shash].cur_page = cur_page = allocate_page ();
+      alloc_counts[(int) alloc_type_shash].total_pages++;
     }
 
   ptr = &cur_page->shash[--unallocated];
-  alloc_counts[(int)alloc_type_shash].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_shash].unallocated = unallocated;
 
 #else
 
-  ptr = (shash_t *) xmalloc (sizeof (shash_t));
+  ptr = XNEW (shash_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_shash].total_alloc++;
+  alloc_counts[(int) alloc_type_shash].total_alloc++;
   *ptr = initial_shash;
   return ptr;
 }
@@ -4998,33 +4948,33 @@ allocate_shash ()
 /* Allocate type hash buckets.  */
 
 static thash_t *
-allocate_thash ()
+allocate_thash (void)
 {
-  register thash_t *ptr;
+  thash_t *ptr;
   static thash_t initial_thash;
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_thash].unallocated;
-  register page_type *cur_page = alloc_counts[(int)alloc_type_thash].cur_page;
+  int unallocated = alloc_counts[(int) alloc_type_thash].unallocated;
+  page_type *cur_page = alloc_counts[(int) alloc_type_thash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (thash_t);
-      alloc_counts[(int)alloc_type_thash].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int)alloc_type_thash].total_pages++;
+      alloc_counts[(int) alloc_type_thash].cur_page = cur_page = allocate_page ();
+      alloc_counts[(int) alloc_type_thash].total_pages++;
     }
 
   ptr = &cur_page->thash[--unallocated];
-  alloc_counts[(int)alloc_type_thash].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_thash].unallocated = unallocated;
 
 #else
 
-  ptr = (thash_t *) xmalloc (sizeof (thash_t));
+  ptr = XNEW (thash_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_thash].total_alloc++;
+  alloc_counts[(int) alloc_type_thash].total_alloc++;
   *ptr = initial_thash;
   return ptr;
 }
@@ -5032,39 +4982,39 @@ allocate_thash ()
 /* Allocate structure, union, or enum tag information.  */
 
 static tag_t *
-allocate_tag ()
+allocate_tag (void)
 {
-  register tag_t *ptr;
+  tag_t *ptr;
   static tag_t initial_tag;
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int)alloc_type_tag].free_list.f_tag;
+  ptr = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
   if (ptr != (tag_t *) NULL)
-    alloc_counts[(int)alloc_type_tag].free_list.f_tag = ptr->free;
+    alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr->free;
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_tag].unallocated;
-      register page_type *cur_page = alloc_counts[(int)alloc_type_tag].cur_page;
+      int unallocated = alloc_counts[(int) alloc_type_tag].unallocated;
+      page_type *cur_page = alloc_counts[(int) alloc_type_tag].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (tag_t);
-         alloc_counts[(int)alloc_type_tag].cur_page = cur_page = allocate_page ();
-         alloc_counts[(int)alloc_type_tag].total_pages++;
+         alloc_counts[(int) alloc_type_tag].cur_page = cur_page = allocate_page ();
+         alloc_counts[(int) alloc_type_tag].total_pages++;
        }
 
       ptr = &cur_page->tag[--unallocated];
-      alloc_counts[(int)alloc_type_tag].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_tag].unallocated = unallocated;
     }
 
 #else
 
-  ptr = (tag_t *) xmalloc (sizeof (tag_t));
+  ptr = XNEW (tag_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_tag].total_alloc++;
+  alloc_counts[(int) alloc_type_tag].total_alloc++;
   *ptr = initial_tag;
   return ptr;
 }
@@ -5072,14 +5022,13 @@ allocate_tag ()
 /* Free scoping information.  */
 
 static void
-free_tag (ptr)
-     tag_t *ptr;
+free_tag (tag_t *ptr)
 {
-  alloc_counts[(int)alloc_type_tag].total_free++;
+  alloc_counts[(int) alloc_type_tag].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[(int)alloc_type_tag].free_list.f_tag;
-  alloc_counts[(int)alloc_type_tag].free_list.f_tag = ptr;
+  ptr->free = alloc_counts[(int) alloc_type_tag].free_list.f_tag;
+  alloc_counts[(int) alloc_type_tag].free_list.f_tag = ptr;
 #else
   free ((PTR_T) ptr);
 #endif
@@ -5088,33 +5037,33 @@ free_tag (ptr)
 /* Allocate forward reference to a yet unknown tag.  */
 
 static forward_t *
-allocate_forward ()
+allocate_forward (void)
 {
-  register forward_t *ptr;
+  forward_t *ptr;
   static forward_t initial_forward;
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_forward].unallocated;
-  register page_type *cur_page = alloc_counts[(int)alloc_type_forward].cur_page;
+  int unallocated = alloc_counts[(int) alloc_type_forward].unallocated;
+  page_type *cur_page = alloc_counts[(int) alloc_type_forward].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (forward_t);
-      alloc_counts[(int)alloc_type_forward].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int)alloc_type_forward].total_pages++;
+      alloc_counts[(int) alloc_type_forward].cur_page = cur_page = allocate_page ();
+      alloc_counts[(int) alloc_type_forward].total_pages++;
     }
 
   ptr = &cur_page->forward[--unallocated];
-  alloc_counts[(int)alloc_type_forward].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_forward].unallocated = unallocated;
 
 #else
 
-  ptr = (forward_t *) xmalloc (sizeof (forward_t));
+  ptr = XNEW (forward_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_forward].total_alloc++;
+  alloc_counts[(int) alloc_type_forward].total_alloc++;
   *ptr = initial_forward;
   return ptr;
 }
@@ -5122,39 +5071,39 @@ allocate_forward ()
 /* Allocate head of type hash list.  */
 
 static thead_t *
-allocate_thead ()
+allocate_thead (void)
 {
-  register thead_t *ptr;
+  thead_t *ptr;
   static thead_t initial_thead;
 
 #ifndef MALLOC_CHECK
 
-  ptr = alloc_counts[(int)alloc_type_thead].free_list.f_thead;
+  ptr = alloc_counts[(int) alloc_type_thead].free_list.f_thead;
   if (ptr != (thead_t *) NULL)
-    alloc_counts[ (int)alloc_type_thead ].free_list.f_thead = ptr->free;
+    alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr->free;
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_thead].unallocated;
-      register page_type *cur_page = alloc_counts[(int)alloc_type_thead].cur_page;
+      int unallocated = alloc_counts[(int) alloc_type_thead].unallocated;
+      page_type *cur_page = alloc_counts[(int) alloc_type_thead].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (thead_t);
-         alloc_counts[(int)alloc_type_thead].cur_page = cur_page = allocate_page ();
-         alloc_counts[(int)alloc_type_thead].total_pages++;
+         alloc_counts[(int) alloc_type_thead].cur_page = cur_page = allocate_page ();
+         alloc_counts[(int) alloc_type_thead].total_pages++;
        }
 
       ptr = &cur_page->thead[--unallocated];
-      alloc_counts[(int)alloc_type_thead].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_thead].unallocated = unallocated;
     }
 
 #else
 
-  ptr = (thead_t *) xmalloc (sizeof (thead_t));
+  ptr = XNEW (thead_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_thead].total_alloc++;
+  alloc_counts[(int) alloc_type_thead].total_alloc++;
   *ptr = initial_thead;
   return ptr;
 }
@@ -5162,54 +5111,52 @@ allocate_thead ()
 /* Free scoping information.  */
 
 static void
-free_thead (ptr)
-     thead_t *ptr;
+free_thead (thead_t *ptr)
 {
-  alloc_counts[(int)alloc_type_thead].total_free++;
+  alloc_counts[(int) alloc_type_thead].total_free++;
 
 #ifndef MALLOC_CHECK
-  ptr->free = (thead_t *) alloc_counts[(int)alloc_type_thead].free_list.f_thead;
-  alloc_counts[(int)alloc_type_thead].free_list.f_thead = ptr;
+  ptr->free = (thead_t *) alloc_counts[(int) alloc_type_thead].free_list.f_thead;
+  alloc_counts[(int) alloc_type_thead].free_list.f_thead = ptr;
 #else
   free ((PTR_T) ptr);
 #endif
 }
 \f
 static lineno_list_t *
-allocate_lineno_list ()
+allocate_lineno_list (void)
 {
-  register lineno_list_t *ptr;
+  lineno_list_t *ptr;
   static lineno_list_t initial_lineno_list;
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_lineno].unallocated;
-  register page_type *cur_page = alloc_counts[(int)alloc_type_lineno].cur_page;
+  int unallocated = alloc_counts[(int) alloc_type_lineno].unallocated;
+  page_type *cur_page = alloc_counts[(int) alloc_type_lineno].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (lineno_list_t);
-      alloc_counts[(int)alloc_type_lineno].cur_page = cur_page = allocate_page ();
-      alloc_counts[(int)alloc_type_lineno].total_pages++;
+      alloc_counts[(int) alloc_type_lineno].cur_page = cur_page = allocate_page ();
+      alloc_counts[(int) alloc_type_lineno].total_pages++;
     }
 
   ptr = &cur_page->lineno[--unallocated];
-  alloc_counts[(int)alloc_type_lineno].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_lineno].unallocated = unallocated;
 
 #else
 
-  ptr = (lineno_list_t *) xmalloc (sizeof (lineno_list_t));
+  ptr = XNEW (lineno_list_t);
 
 #endif
 
-  alloc_counts[(int)alloc_type_lineno].total_alloc++;
+  alloc_counts[(int) alloc_type_lineno].total_alloc++;
   *ptr = initial_lineno_list;
   return ptr;
 }
 
 void
-ecoff_set_gp_prolog_size (sz)
-     int sz;
+ecoff_set_gp_prolog_size (int sz)
 {
   if (cur_proc_ptr == 0)
     return;
@@ -5217,125 +5164,30 @@ ecoff_set_gp_prolog_size (sz)
   cur_proc_ptr->pdr.gp_prologue = sz;
   if (cur_proc_ptr->pdr.gp_prologue != sz)
     {
-      as_warn ("GP prologue size exceeds field size, using 0 instead");
+      as_warn (_("GP prologue size exceeds field size, using 0 instead"));
       cur_proc_ptr->pdr.gp_prologue = 0;
     }
 
   cur_proc_ptr->pdr.gp_used = 1;
 }
 
-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 
-ecoff_no_current_file ()
+int
+ecoff_no_current_file (void)
 {
   return cur_file_ptr == (efdr_t *) NULL;
 }
 
 void
-ecoff_generate_asm_lineno (filename, lineno)
-     const char *filename;
-     int lineno;
+ecoff_generate_asm_lineno (void)
 {
+  unsigned int lineno;
+  const char *filename;
   lineno_list_t *list;
 
-  if (current_stabs_filename == (char *)NULL
-      || strcmp (current_stabs_filename, filename))
+  filename = as_where (&lineno);
+
+  if (current_stabs_filename == (char *) NULL
+      || filename_cmp (current_stabs_filename, filename))
     add_file (filename, 0, 1);
 
   list = allocate_lineno_list ();
@@ -5359,7 +5211,7 @@ ecoff_generate_asm_lineno (filename, lineno)
 
       pl = &noproc_lineno;
       while (*pl != (lineno_list_t *) NULL)
-        pl = &(*pl)->next;
+       pl = &(*pl)->next;
       *pl = list;
     }
   else
@@ -5370,4 +5222,11 @@ ecoff_generate_asm_lineno (filename, lineno)
     }
 }
 
+#else
+
+void
+ecoff_generate_asm_lineno (void)
+{
+}
+
 #endif /* ECOFF_DEBUGGING */
This page took 0.072453 seconds and 4 git commands to generate.