Fix copyright notices
[deliverable/binutils-gdb.git] / gas / ecoff.c
index a0644066c80ef274c0f62c3dface0797ecba6c10..7863038a5d9779c92711feaaed9f48ee956a7da0 100644 (file)
@@ -1,5 +1,6 @@
 /* ECOFF debugging support.
 /* ECOFF debugging support.
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   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
    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
@@ -18,8 +19,9 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    GNU General Public License for more details.
 
    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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+   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.  */
 
 #include "as.h"
 
 
 #include "as.h"
 
    ECOFF debugging information (e.g., MIPS ECOFF, MIPS ELF, Alpha
    ECOFF).  */
 
    ECOFF debugging information (e.g., MIPS ECOFF, MIPS ELF, Alpha
    ECOFF).  */
 
+#include "ecoff.h"
+
 #ifdef ECOFF_DEBUGGING
 
 #include "coff/internal.h"
 #include "coff/symconst.h"
 #ifdef ECOFF_DEBUGGING
 
 #include "coff/internal.h"
 #include "coff/symconst.h"
-#include "ecoff.h"
 #include "aout/stab_gnu.h"
 
 #include <ctype.h>
 #include "aout/stab_gnu.h"
 
 #include <ctype.h>
                        tqFar           -- 8086 far pointers
                        tqVol           -- volatile
 
                        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.
 
    The dense number table is used in the front ends, and disappears by
    the time the .o is created.
 
 
     5) index: pointer to a local symbol or aux. entry.
 
 
     5) index: pointer to a local symbol or aux. entry.
 
-
-
    For the following program:
 
        #include <stdio.h>
    For the following program:
 
        #include <stdio.h>
@@ -725,9 +725,9 @@ typedef enum bt {
 
 /* States for whether to hash type or not.  */
 typedef enum hash_state {
 
 /* 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.  */
 } hash_state_t;
 
 /* Types of different sized allocation requests.  */
@@ -767,13 +767,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).  */
 
    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
 #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)
 
 #endif
 
 #define PAGE_USIZE ((unsigned long) PAGE_SIZE)
 
-
 #ifndef MAX_CLUSTER_PAGES      /* # pages to get from system */
 #define MAX_CLUSTER_PAGES 63
 #endif
 #ifndef MAX_CLUSTER_PAGES      /* # pages to get from system */
 #define MAX_CLUSTER_PAGES 63
 #endif
@@ -786,7 +797,6 @@ typedef struct vlinks {
   unsigned long         start_index;   /* starting index # of page */
 } vlinks_t;
 
   unsigned long         start_index;   /* starting index # of page */
 } vlinks_t;
 
-
 /* Virtual array header.  */
 typedef struct varray {
   vlinks_t     *first;                 /* first page link */
 /* Virtual array header.  */
 typedef struct varray {
   vlinks_t     *first;                 /* first page link */
@@ -812,11 +822,9 @@ typedef struct varray {
   OBJECTS_PER_PAGE (type),     /* objects_last_page */                 \
 }
 
   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;
 
 typedef unsigned long symint_t;
 
-
 /* Linked list support for nested scopes (file, block, structure, etc.).  */
 typedef struct scope {
   struct scope *prev;          /* previous scope level */
 /* Linked list support for nested scopes (file, block, structure, etc.).  */
 typedef struct scope {
   struct scope *prev;          /* previous scope level */
@@ -825,13 +833,13 @@ typedef struct scope {
   st_t          type;          /* type of the node */
 } scope_t;
 
   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.  */
 typedef struct localsym {
   const char *name;            /* symbol name */
   symbolS *as_sym;             /* symbol as seen by gas */
 /* 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.  */
 typedef struct localsym {
   const char *name;            /* symbol name */
   symbolS *as_sym;             /* symbol as seen by gas */
+  bfd_vma addend;              /* addend to as_sym value */
   struct efdr *file_ptr;       /* file pointer */
   struct ecoff_proc *proc_ptr; /* proc pointer */
   struct localsym *begin_ptr;  /* symbol at start of block */
   struct efdr *file_ptr;       /* file pointer */
   struct ecoff_proc *proc_ptr; /* proc pointer */
   struct localsym *begin_ptr;  /* symbol at start of block */
@@ -841,7 +849,6 @@ typedef struct localsym {
   EXTR ecoff_sym;              /* ECOFF debugging symbol */
 } localsym_t;
 
   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 */
 /* For aux information we keep the type and the data.  */
 typedef struct ecoff_aux {
   enum aux_type type;          /* aux type */
@@ -858,7 +865,6 @@ typedef struct ecoff_proc {
 /* Number of proc_t structures allocated.  */
 static unsigned long proc_cnt;
 
 /* 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 */
 /* Forward reference list for tags referenced, but not yet defined.  */
 typedef struct forward {
   struct forward *next;                /* next forward reference */
@@ -867,7 +873,6 @@ typedef struct forward {
   aux_t                 *index_ptr;    /* pointer to store symbol index */
 } forward_t;
 
   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 {
 /* Linked list support for tags.  The first tag in the list is always
    the current tag for that block.  */
 typedef struct tag {
@@ -881,7 +886,6 @@ typedef struct tag {
   localsym_t    *sym;          /* file's local symbols */
 } tag_t;
 
   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 */
 /* Head of a block's linked list of tags.  */
 typedef struct thead {
   struct thead *prev;          /* previous block */
@@ -889,7 +893,6 @@ typedef struct thead {
   struct tag   *first_tag;     /* first tag in block defined */
 } thead_t;
 
   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 */
 /* Union containing pointers to each the small structures which are freed up.  */
 typedef union small_free {
   scope_t      *f_scope;       /* scope structure */
@@ -898,7 +901,6 @@ typedef union small_free {
   forward_t    *f_forward;     /* forward tag reference */
 } small_free_t;
 
   forward_t    *f_forward;     /* forward tag reference */
 } small_free_t;
 
-
 /* String hash table entry.  */
 
 typedef struct shash {
 /* String hash table entry.  */
 
 typedef struct shash {
@@ -911,7 +913,6 @@ typedef struct shash {
   proc_t       *proc_ptr;      /* procedure descriptor pointer */
 } shash_t;
 
   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
 /* 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
@@ -929,13 +930,13 @@ typedef struct thash {
   symint_t      indx;          /* index within string table */
 } thash_t;
 
   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 {
   FDR           fdr;           /* File header to be written out */
   FDR          *orig_fdr;      /* original file header */
   char         *name;          /* filename */
 /* Extended file descriptor that contains all of the support necessary
    to add things to each file separately.  */
 typedef struct efdr {
   FDR           fdr;           /* File header to be written out */
   FDR          *orig_fdr;      /* original file header */
   char         *name;          /* filename */
+  int           fake;          /* whether this is faked .file */
   symint_t      void_type;     /* aux. pointer to 'void' type */
   symint_t      int_type;      /* aux. pointer to 'int' type */
   scope_t      *cur_scope;     /* current nested scopes */
   symint_t      void_type;     /* aux. pointer to 'void' type */
   symint_t      int_type;      /* aux. pointer to 'int' type */
   scope_t      *cur_scope;     /* current nested scopes */
@@ -952,8 +953,7 @@ typedef struct efdr {
 } efdr_t;
 
 /* Pre-initialized extended file structure.  */
 } 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) */
   {                    /* FDR structure */
     0,                 /* adr:         memory address of beginning of file */
     0,                 /* rss:         file name (of source, if known) */
@@ -972,13 +972,9 @@ static const efdr_t init_file =
     0,                 /* rfdBase:     index into the file indirect table */
     0,                 /* crfd:        count file indirect entries */
     langC,             /* lang:        language for this file */
     0,                 /* rfdBase:     index into the file indirect table */
     0,                 /* crfd:        count file indirect entries */
     langC,             /* lang:        language for this file */
-    0,                 /* fMerge:      whether this file can be merged */
+    1,                 /* fMerge:      whether this file can be merged */
     0,                 /* fReadin:     true if read in (not just created) */
     0,                 /* fReadin:     true if read in (not just created) */
-#ifdef TARGET_BYTES_BIG_ENDIAN
-    1,                 /* fBigendian:  if 1, compiled on big endian machine */
-#else
-    0,                 /* fBigendian:  if 1, compiled on big endian machine */
-#endif
+    TARGET_BYTES_BIG_ENDIAN,  /* fBigendian:   if 1, compiled on big endian machine */
     GLEVEL_2,          /* glevel:      level this file was compiled with */
     0,                 /* reserved:    reserved for future use */
     0,                 /* cbLineOffset: byte offset from header for this file ln's */
     GLEVEL_2,          /* glevel:      level this file was compiled with */
     0,                 /* reserved:    reserved for future use */
     0,                 /* cbLineOffset: byte offset from header for this file ln's */
@@ -987,6 +983,7 @@ static const efdr_t init_file =
 
   (FDR *)0,            /* orig_fdr:    original file header pointer */
   (char *)0,           /* name:        pointer to filename */
 
   (FDR *)0,            /* orig_fdr:    original file header pointer */
   (char *)0,           /* name:        pointer to filename */
+  0,                   /* fake:        whether this is a faked .file */
   0,                   /* void_type:   ptr to aux node for void type */
   0,                   /* int_type:    ptr to aux node for int type */
   (scope_t *)0,                /* cur_scope:   current scope being processed */
   0,                   /* void_type:   ptr to aux node for void type */
   0,                   /* int_type:    ptr to aux node for int type */
   (scope_t *)0,                /* cur_scope:   current scope being processed */
@@ -1003,11 +1000,9 @@ static const efdr_t init_file =
   { 0 },               /* thash_head:  type hash table */
 };
 
   { 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 */
 
 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 {
 /* Line number information is kept in a list until the assembly is
    finished.  */
 typedef struct lineno_list {
@@ -1020,6 +1015,7 @@ typedef struct lineno_list {
 } lineno_list_t;
 
 static lineno_list_t *first_lineno;
 } lineno_list_t;
 
 static lineno_list_t *first_lineno;
+static lineno_list_t *last_lineno;
 static lineno_list_t **last_lineno_ptr = &first_lineno;
 
 /* Sometimes there will be some .loc statements before a .ent.  We
 static lineno_list_t **last_lineno_ptr = &first_lineno;
 
 /* Sometimes there will be some .loc statements before a .ent.  We
@@ -1045,13 +1041,12 @@ typedef union page {
   forward_t    forward [ PAGE_SIZE / sizeof (forward_t)     ];
   thead_t      thead   [ PAGE_SIZE / sizeof (thead_t)       ];
   lineno_list_t        lineno  [ PAGE_SIZE / sizeof (lineno_list_t) ];
   forward_t    forward [ PAGE_SIZE / sizeof (forward_t)     ];
   thead_t      thead   [ PAGE_SIZE / sizeof (thead_t)       ];
   lineno_list_t        lineno  [ PAGE_SIZE / sizeof (lineno_list_t) ];
-} page_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) */
 
 /* Structure holding allocation information for small sized structures.  */
 typedef struct alloc_info {
   char         *alloc_name;    /* name of this allocation type (must be first) */
-  page_t       *cur_page;      /* current page being allocated from */
+  page_type    *cur_page;      /* current page being allocated from */
   small_free_t  free_list;     /* current free list if any */
   int           unallocated;   /* number of elements unallocated on page */
   int           total_alloc;   /* total number of allocations */
   small_free_t  free_list;     /* current free list if any */
   int           unallocated;   /* number of elements unallocated on page */
   int           total_alloc;   /* total number of allocations */
@@ -1059,7 +1054,6 @@ typedef struct alloc_info {
   int           total_pages;   /* total number of pages allocated */
 } alloc_info_t;
 
   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 */
 /* Type information collected together.  */
 typedef struct type_info {
   bt_t       basic_type;               /* basic type */
@@ -1117,7 +1111,7 @@ static const type_info_t type_info_init = {
 /* Global hash table for the tags table and global table for file
    descriptors.  */
 
 /* 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;
 
 
 static struct hash_control *tag_hash;
 
@@ -1130,7 +1124,6 @@ static type_info_t void_type_info;
 static type_info_t last_func_type_info;
 static symbolS *last_func_sym_value;
 
 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
 /* 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
@@ -1386,10 +1379,12 @@ static const st_t map_coff_sym_type[] = {
   st_Nil,                      /* 106: C_HIDDEN ??? */
 };
 
   st_Nil,                      /* 106: C_HIDDEN ??? */
 };
 
-
 /* Keep track of different sized allocation requests.  */
 /* 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
 \f
+/* Record whether we have seen any debugging information.  */
+int ecoff_debugging_seen = 0;
+
 /* Various statics.  */
 static efdr_t  *cur_file_ptr   = (efdr_t *) 0; /* current file desc. header */
 static proc_t  *cur_proc_ptr   = (proc_t *) 0; /* current procedure header */
 /* Various statics.  */
 static efdr_t  *cur_file_ptr   = (efdr_t *) 0; /* current file desc. header */
 static proc_t  *cur_proc_ptr   = (proc_t *) 0; /* current procedure header */
@@ -1420,7 +1415,7 @@ static symint_t add_string PARAMS ((varray_t *vp,
                                    shash_t **ret_hash));
 static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type,
                                             sc_t storage, symbolS *sym,
                                    shash_t **ret_hash));
 static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type,
                                             sc_t storage, symbolS *sym,
-                                            symint_t value,
+                                            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 indx));
 static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word));
 static symint_t add_aux_sym_rndx PARAMS ((int file_index,
@@ -1432,7 +1427,7 @@ 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));
                               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));
+static void add_file PARAMS ((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));
 #ifdef ECOFF_DEBUG
 static char *sc_to_string PARAMS ((sc_t storage_class));
 static char *st_to_string PARAMS ((st_t symbol_type));
@@ -1465,8 +1460,8 @@ 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));
   PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
           unsigned long offset));
 static void ecoff_setup_ext PARAMS ((void));
-static page_t *allocate_cluster PARAMS ((unsigned long npages));
-static page_t *allocate_page 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 scope_t *allocate_scope PARAMS ((void));
 static void free_scope PARAMS ((scope_t *ptr));
 static vlinks_t *allocate_vlinks PARAMS ((void));
@@ -1478,7 +1473,6 @@ 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 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));
 \f
 /* This function should be called when the assembler starts up.  */
 
 \f
 /* This function should be called when the assembler starts up.  */
 
@@ -1499,6 +1493,8 @@ void
 ecoff_symbol_new_hook (symbolP)
      symbolS *symbolP;
 {
 ecoff_symbol_new_hook (symbolP)
      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
   /* 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
@@ -1506,10 +1502,11 @@ ecoff_symbol_new_hook (symbolP)
      wrong.  */
   if (cur_file_ptr == (efdr_t *) NULL
       && seen_at_least_1_file ())
      wrong.  */
   if (cur_file_ptr == (efdr_t *) NULL
       && seen_at_least_1_file ())
-    add_file ((const char *) NULL, 0);
-  symbolP->ecoff_file = cur_file_ptr;
-  symbolP->ecoff_symbol = NULL;
-  symbolP->ecoff_extern_size = 0;
+    add_file ((const char *) NULL, 0, 1);
+  obj = symbol_get_obj (symbolP);
+  obj->ecoff_file = cur_file_ptr;
+  obj->ecoff_symbol = NULL;
+  obj->ecoff_extern_size = 0;
 }
 \f
 /* Add a page to a varray object.  */
 }
 \f
 /* Add a page to a varray object.  */
@@ -1522,13 +1519,13 @@ add_varray_page (vp)
 
 #ifdef MALLOC_CHECK
   if (vp->object_size > 1)
 
 #ifdef MALLOC_CHECK
   if (vp->object_size > 1)
-    new_links->datum = (page_t *) xcalloc (1, vp->object_size);
+    new_links->datum = (page_type *) xcalloc (1, vp->object_size);
   else
 #endif
     new_links->datum = allocate_page ();
 
   else
 #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;
 
   new_links->start_index = vp->num_allocated;
   vp->objects_last_page = 0;
@@ -1556,7 +1553,7 @@ add_string (vp, hash_tbl, str, ret_hash)
   register shash_t *hash_ptr;
 
   if (len >= PAGE_USIZE)
   register 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)
 
   hash_ptr = (shash_t *) hash_find (hash_tbl, str);
   if (hash_ptr == (shash_t *) NULL)
@@ -1564,11 +1561,11 @@ add_string (vp, hash_tbl, str, ret_hash)
       register const char *err;
 
       if (vp->objects_last_page + len >= PAGE_USIZE)
       register 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;
 
       hash_ptr = allocate_shash ();
       hash_ptr->indx = vp->num_allocated;
@@ -1582,7 +1579,7 @@ add_string (vp, hash_tbl, str, ret_hash)
 
       err = hash_insert (hash_tbl, str, (char *) hash_ptr);
       if (err)
 
       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);
     }
 
                  str, err);
     }
 
@@ -1595,11 +1592,12 @@ add_string (vp, hash_tbl, str, ret_hash)
 /* Add debugging information for a symbol.  */
 
 static localsym_t *
 /* Add debugging information for a symbol.  */
 
 static localsym_t *
-add_ecoff_symbol (str, type, storage, sym_value, value, indx)
+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.  */
      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 */
 {
      symint_t value;                   /* value of symbol */
      symint_t indx;                    /* index to local/aux. syms */
 {
@@ -1613,14 +1611,14 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
   shash_t *hash_ptr = (shash_t *) NULL;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   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;
 
 
   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);
 
     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);
 
   if (str == (const char *) NULL && sym_value != (symbolS *) NULL)
     psym->name = S_GET_NAME (sym_value);
@@ -1628,7 +1626,8 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
     psym->name = str;
   psym->as_sym = sym_value;
   if (sym_value != (symbolS *) NULL)
     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;
   psym->begin_ptr = (localsym_t *) NULL;
   psym->file_ptr = cur_file_ptr;
   psym->proc_ptr = cur_proc_ptr;
   psym->begin_ptr = (localsym_t *) NULL;
@@ -1685,8 +1684,8 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
        scope_delta = 1;
 
       /* For every block type except file, struct, union, or
        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 ();
       if (type != st_File && storage != sc_Info)
        {
          ptag_head = allocate_thead ();
@@ -1699,7 +1698,7 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
     case st_End:
       pscope = cur_file_ptr->cur_scope;
       if (pscope == (scope_t *) NULL)
     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;
       else
        {
          st_t begin_type = (st_t) pscope->lsym->ecoff_sym.asym.st;
@@ -1782,11 +1781,12 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
               value, depth, sc_str);
 
       if (str_start && str_end_p1 - str_start > 0)
               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);
       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
        }
     }
 #endif
@@ -1805,7 +1805,7 @@ add_aux_sym_symint (aux_word)
   register aux_t *aux_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   register 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;
 
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1819,7 +1819,6 @@ add_aux_sym_symint (aux_word)
   return vp->num_allocated++;
 }
 
   return vp->num_allocated++;
 }
 
-
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 static symint_t
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 static symint_t
@@ -1831,7 +1830,7 @@ add_aux_sym_rndx (file_index, sym_index)
   register aux_t *aux_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   register 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;
 
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1863,7 +1862,7 @@ add_aux_sym_tir (t, state, hash_tbl)
   AUXU aux;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   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;
 
 
   vp = &cur_file_ptr->aux_syms;
 
@@ -1879,9 +1878,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];
 
   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,
   /* 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
 
   if (state != hash_no
       && (t->type_qualifiers[0] == tq_Array
@@ -1931,11 +1929,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);
 
   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;
 
   aux_ptr->type = aux_tir;
   aux_ptr->data = aux;
 
@@ -1951,8 +1949,7 @@ add_aux_sym_tir (t, state, hash_tbl)
      for an enum bitfield.  */
 
   if (t->bitfield)
      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]
 
   /* Add tag information if needed.  Structure, union, and enum
      references add 2 aux symbols: a [file index, symbol index]
@@ -1963,7 +1960,7 @@ add_aux_sym_tir (t, state, hash_tbl)
       || t->basic_type == bt_Enum)
     {
       register symint_t file_index = t->tag_ptr->ifd;
       || t->basic_type == bt_Enum)
     {
       register symint_t file_index = t->tag_ptr->ifd;
-      register localsym_t *sym  = t->tag_ptr->sym;
+      register localsym_t *sym = t->tag_ptr->sym;
       register forward_t *forward_ref = allocate_forward ();
 
       if (sym != (localsym_t *) NULL)
       register forward_t *forward_ref = allocate_forward ();
 
       if (sym != (localsym_t *) NULL)
@@ -1979,11 +1976,11 @@ add_aux_sym_tir (t, state, hash_tbl)
 
       (void) add_aux_sym_rndx (ST_RFDESCAPE, indexNil);
       forward_ref->index_ptr
 
       (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
 
       (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.  */
     }
 
   /* Add information about array bounds if they exist.  */
@@ -2001,7 +1998,7 @@ add_aux_sym_tir (t, state, hash_tbl)
     };
 
   /* NOTE:  Mips documentation claims that the bitfield width goes here.
     };
 
   /* 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;
 }
 
   return ret;
 }
@@ -2019,22 +2016,22 @@ get_tag (tag, sym, basic_type)
   tag_t *tag_ptr;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   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)
 
   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)
     {
 
   if (hash_ptr == (shash_t *) NULL)
     {
@@ -2045,7 +2042,7 @@ get_tag (tag, sym, basic_type)
       hash_ptr = allocate_shash ();
       err = hash_insert (tag_hash, perm, (char *) hash_ptr);
       if (err)
       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;
     }
                  tag, err);
       hash_ptr->string = perm;
     }
@@ -2071,7 +2068,7 @@ get_tag (tag, sym, basic_type)
 
 static void
 add_unknown_tag (ptag)
 
 static void
 add_unknown_tag (ptag)
-     tag_t     *ptag;          /* pointer to tag information */
+     tag_t *ptag;              /* pointer to tag information */
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name           = hash_ptr->string;
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name           = hash_ptr->string;
@@ -2081,7 +2078,7 @@ add_unknown_tag (ptag)
 #ifdef ECOFF_DEBUG
   if (debug > 1)
     {
 #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;
       switch (ptag->basic_type)
        {
        case bt_Struct: agg_type = "struct";    break;
@@ -2099,6 +2096,7 @@ add_unknown_tag (ptag)
                          st_Block,
                          sc_Info,
                          (symbolS *) NULL,
                          st_Block,
                          sc_Info,
                          (symbolS *) NULL,
+                         (bfd_vma) 0,
                          (symint_t) 0,
                          (symint_t) 0);
 
                          (symint_t) 0,
                          (symint_t) 0);
 
@@ -2106,6 +2104,7 @@ add_unknown_tag (ptag)
                           st_End,
                           sc_Info,
                           (symbolS *) NULL,
                           st_End,
                           sc_Info,
                           (symbolS *) NULL,
+                          (bfd_vma) 0,
                           (symint_t) 0,
                           (symint_t) 0);
 
                           (symint_t) 0,
                           (symint_t) 0);
 
@@ -2123,6 +2122,7 @@ add_procedure (func)
 {
   register varray_t *vp;
   register proc_t *new_proc_ptr;
 {
   register varray_t *vp;
   register proc_t *new_proc_ptr;
+  symbolS *sym;
 
 #ifdef ECOFF_DEBUG
   if (debug)
 
 #ifdef ECOFF_DEBUG
   if (debug)
@@ -2130,7 +2130,7 @@ add_procedure (func)
 #endif
 
   if (cur_file_ptr == (efdr_t *) NULL)
 #endif
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    as_fatal ("no current file pointer");
+    as_fatal (_("no current file pointer"));
 
   vp = &cur_file_ptr->procs;
 
 
   vp = &cur_file_ptr->procs;
 
@@ -2149,10 +2149,14 @@ add_procedure (func)
   new_proc_ptr->pdr.lnLow = -1;
   new_proc_ptr->pdr.lnHigh = -1;
 
   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);
+  symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION;
+
   /* Push the start of the function.  */
   new_proc_ptr->sym = add_ecoff_symbol ((const char *) NULL, st_Proc, sc_Text,
   /* Push the start of the function.  */
   new_proc_ptr->sym = add_ecoff_symbol ((const char *) NULL, st_Proc, sc_Text,
-                                       symbol_find_or_make (func),
-                                       (symint_t) 0, (symint_t) 0);
+                                       sym, (bfd_vma) 0, (symint_t) 0,
+                                       (symint_t) 0);
 
   ++proc_cnt;
 
 
   ++proc_cnt;
 
@@ -2165,19 +2169,29 @@ add_procedure (func)
        l->proc = new_proc_ptr;
       *last_lineno_ptr = noproc_lineno;
       while (*last_lineno_ptr != NULL)
        l->proc = new_proc_ptr;
       *last_lineno_ptr = noproc_lineno;
       while (*last_lineno_ptr != NULL)
-       last_lineno_ptr = &(*last_lineno_ptr)->next;
+       {
+         last_lineno = *last_lineno_ptr;
+         last_lineno_ptr = &last_lineno->next;
+       }
       noproc_lineno = (lineno_list_t *) NULL;
     }
 }
       noproc_lineno = (lineno_list_t *) NULL;
     }
 }
+
+symbolS *
+ecoff_get_cur_proc_sym ()
+{
+  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
 \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)
+add_file (file_name, indx, fake)
      const char *file_name;            /* file name */
      int indx;
      const char *file_name;            /* file name */
      int indx;
+     int fake;
 {
   register int first_ch;
   register efdr_t *fil_ptr;
 {
   register int first_ch;
   register efdr_t *fil_ptr;
@@ -2194,15 +2208,20 @@ add_file (file_name, indx)
       char *file;
 
       if (first_file != (efdr_t *) NULL)
       char *file;
 
       if (first_file != (efdr_t *) NULL)
-       as_fatal ("fake .file after real one");
+       as_fatal (_("fake .file after real one"));
       as_where (&file, (unsigned int *) NULL);
       file_name = (const char *) file;
 
       as_where (&file, (unsigned int *) NULL);
       file_name = (const char *) file;
 
-      if (! symbol_table_frozen)
-       generate_asm_lineno = 1;
+      /* 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_UNSPECIFIED)
+       debug_type = DEBUG_ECOFF;
     }
   else
     }
   else
-      generate_asm_lineno = 0;
+    debug_type = DEBUG_NONE;
 
 #ifndef NO_LISTING
   if (listing)
 
 #ifndef NO_LISTING
   if (listing)
@@ -2219,26 +2238,42 @@ add_file (file_name, indx)
                               symbol_new ("L0\001", now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
                               symbol_new ("L0\001", now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
-                              0, ECOFF_MARK_STAB (N_SOL));
+                              (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SOL));
       return;
     }
 
   first_ch = *file_name;
 
       return;
     }
 
   first_ch = *file_name;
 
+  /* FIXME: We can't safely merge files which have line number
+     information (fMerge will be zero in this case).  Otherwise, we
+     get incorrect line number debugging info.  See for instance
+     ecoff_build_lineno, which will end up setting all file->fdr.*
+     fields multiple times, resulting in incorrect debug info.  In
+     order to make this work right, all line number and symbol info
+     for the same source file has to be adjacent in the object file,
+     so that a single file descriptor can be used to point to them.
+     This would require maintaining file specific lists of line
+     numbers and symbols for each file, so that they can be merged
+     together (or output together) when two .file pseudo-ops are
+     merged into one file descriptor.  */
+
   /* See if the file has already been created.  */
   for (fil_ptr = first_file;
        fil_ptr != (efdr_t *) NULL;
        fil_ptr = fil_ptr->next_file)
     {
       if (first_ch == fil_ptr->name[0]
   /* See if the file has already been created.  */
   for (fil_ptr = first_file;
        fil_ptr != (efdr_t *) NULL;
        fil_ptr = fil_ptr->next_file)
     {
       if (first_ch == fil_ptr->name[0]
-         && strcmp (file_name, fil_ptr->name) == 0)
+         && strcmp (file_name, fil_ptr->name) == 0
+         && fil_ptr->fdr.fMerge)
        {
          cur_file_ptr = fil_ptr;
        {
          cur_file_ptr = fil_ptr;
+         if (! fake)
+           cur_file_ptr->fake = 0;
          break;
        }
     }
 
          break;
        }
     }
 
-  /* 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)
   if (fil_ptr == (efdr_t *) NULL)
     {
       if (file_desc.objects_last_page == file_desc.objects_per_page)
@@ -2251,6 +2286,8 @@ add_file (file_name, indx)
       fil_ptr->file_index = current_file_idx++;
       ++file_desc.num_allocated;
 
       fil_ptr->file_index = current_file_idx++;
       ++file_desc.num_allocated;
 
+      fil_ptr->fake = fake;
+
       /* Allocate the string hash table.  */
       fil_ptr->str_hash = hash_new ();
 
       /* Allocate the string hash table.  */
       fil_ptr->str_hash = hash_new ();
 
@@ -2261,12 +2298,12 @@ add_file (file_name, indx)
                  (shash_t **)0);
 
       if (strlen (file_name) > PAGE_USIZE - 2)
                  (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.  */
       (void) add_ecoff_symbol (file_name, st_File, sc_Text,
 
       /* Push the start of the filename. We assume that the filename
          will be stored at string offset 1.  */
       (void) add_ecoff_symbol (file_name, st_File, sc_Text,
-                              (symbolS *) NULL,
+                              (symbolS *) NULL, (bfd_vma) 0,
                               (symint_t) 0, (symint_t) 0);
       fil_ptr->fdr.rss = 1;
       fil_ptr->name = &fil_ptr->strings.last->datum->byte[1];
                               (symint_t) 0, (symint_t) 0);
       fil_ptr->fdr.rss = 1;
       fil_ptr->name = &fil_ptr->strings.last->datum->byte[1];
@@ -2276,7 +2313,7 @@ add_file (file_name, indx)
       last_file_ptr = &fil_ptr->next_file;
 
       /* Add void & int types to the file (void should be first to catch
       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]);
       fil_ptr->void_type = add_aux_sym_tir (&void_type_info,
                                            hash_yes,
                                            &cur_file_ptr->thash_head[0]);
@@ -2284,35 +2321,36 @@ add_file (file_name, indx)
       fil_ptr->int_type = add_aux_sym_tir (&int_type_info,
                                           hash_yes,
                                           &cur_file_ptr->thash_head[0]);
       fil_ptr->int_type = add_aux_sym_tir (&int_type_info,
                                           hash_yes,
                                           &cur_file_ptr->thash_head[0]);
-      /* gas used to have a bug that if the file does not have any
-        symbol, it either will abort or will not build the file,
-        the following is to get around that problem. ---kung*/
-#if 0
-      if (generate_asm_lineno)
-       {
-         mark_stabs (0);
-          (void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
-                                  symbol_new ("L0\001", now_seg,
-                                              (valueT) frag_now_fix (),
-                                              frag_now),
-                                  0, ECOFF_MARK_STAB (N_SO));
-          (void) add_ecoff_symbol ("void:t1=1", st_Nil, sc_Nil,
-                                  (symbolS *) NULL, 0,
-                                  ECOFF_MARK_STAB (N_LSYM));
-       }
-#endif
     }
 }
     }
 }
+
+/* This function is called when the assembler notices a preprocessor
+   directive switching to a new file.  This will not happen in
+   compiler output, only in hand coded assembler.  */
+
+void
+ecoff_new_file (name)
+     const char *name;
+{
+  if (cur_file_ptr != NULL && strcmp (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_UNSPECIFIED)
+    debug_type = DEBUG_ECOFF;
+}
 \f
 #ifdef ECOFF_DEBUG
 
 /* Convert storage class to string.  */
 
 static char *
 \f
 #ifdef ECOFF_DEBUG
 
 /* Convert storage class to string.  */
 
 static char *
-sc_to_string(storage_class)
+sc_to_string (storage_class)
      sc_t storage_class;
 {
      sc_t storage_class;
 {
-  switch(storage_class)
+  switch (storage_class)
     {
     case sc_Nil:        return "Nil,";
     case sc_Text:       return "Text,";
     {
     case sc_Nil:        return "Nil,";
     case sc_Text:       return "Text,";
@@ -2350,10 +2388,10 @@ sc_to_string(storage_class)
 /* Convert symbol type to string.  */
 
 static char *
 /* Convert symbol type to string.  */
 
 static char *
-st_to_string(symbol_type)
+st_to_string (symbol_type)
      st_t symbol_type;
 {
      st_t symbol_type;
 {
-  switch(symbol_type)
+  switch (symbol_type)
     {
     case st_Nil:       return "Nil,";
     case st_Global:    return "Global,";
     {
     case st_Nil:       return "Nil,";
     case st_Global:    return "Global,";
@@ -2395,14 +2433,14 @@ ecoff_directive_begin (ignore)
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
 
   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)
     {
       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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2412,7 +2450,7 @@ ecoff_directive_begin (ignore)
 
   (void) add_ecoff_symbol ((const char *) NULL, st_Block, sc_Text,
                           symbol_find_or_make (name),
 
   (void) add_ecoff_symbol ((const char *) NULL, st_Block, sc_Text,
                           symbol_find_or_make (name),
-                          (symint_t) 0, (symint_t) 0);
+                          (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
   *input_line_pointer = name_end;
 
 
   *input_line_pointer = name_end;
 
@@ -2434,14 +2472,14 @@ ecoff_directive_bend (ignore)
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
 
   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)
     {
       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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2454,10 +2492,10 @@ ecoff_directive_bend (ignore)
      the symbol.  */
   endsym = symbol_find (name);
   if (endsym == (symbolS *) NULL)
      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,
   else
     (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text, endsym,
-                            (symint_t) 0, (symint_t) 0);
+                            (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
   *input_line_pointer = name_end;
 
 
   *input_line_pointer = name_end;
 
@@ -2477,7 +2515,8 @@ static st_t coff_symbol_typ;
 static int coff_is_function;
 static char *coff_tag;
 static valueT coff_value;
 static int coff_is_function;
 static char *coff_tag;
 static valueT coff_value;
-symbolS *coff_sym_value;
+static symbolS *coff_sym_value;
+static bfd_vma coff_sym_addend;
 static int coff_inside_enumeration;
 
 /* Handle a .def directive: start defining a symbol.  */
 static int coff_inside_enumeration;
 
 /* Handle a .def directive: start defining a symbol.  */
@@ -2489,15 +2528,17 @@ ecoff_directive_def (ignore)
   char *name;
   char name_end;
 
   char *name;
   char name_end;
 
+  ecoff_debugging_seen = 1;
+
   SKIP_WHITESPACE ();
 
   name = input_line_pointer;
   name_end = get_symbol_end ();
 
   if (coff_sym_name != (char *) NULL)
   SKIP_WHITESPACE ();
 
   name = input_line_pointer;
   name_end = get_symbol_end ();
 
   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')
   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)
   else
     {
       if (coff_sym_name != (char *) NULL)
@@ -2513,6 +2554,7 @@ ecoff_directive_def (ignore)
       coff_tag = (char *) NULL;
       coff_value = 0;
       coff_sym_value = (symbolS *) NULL;
       coff_tag = (char *) NULL;
       coff_value = 0;
       coff_sym_value = (symbolS *) NULL;
+      coff_sym_addend = 0;
     }
 
   *input_line_pointer = name_end;
     }
 
   *input_line_pointer = name_end;
@@ -2534,7 +2576,7 @@ ecoff_directive_dim (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2549,7 +2591,7 @@ ecoff_directive_dim (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn ("Badly formed .dim directive");
+           as_warn (_("Badly formed .dim directive"));
          break;
        }
     }
          break;
        }
     }
@@ -2562,7 +2604,7 @@ ecoff_directive_dim (ignore)
     {
       if (coff_type.num_dims >= N_TQ)
        {
     {
       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];
          break;
        }
       coff_type.dimensions[coff_type.num_dims] = dimens[i];
@@ -2583,7 +2625,7 @@ ecoff_directive_scl (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2609,7 +2651,7 @@ ecoff_directive_size (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2624,7 +2666,7 @@ ecoff_directive_size (ignore)
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
        {
          if (*input_line_pointer != '\n'
              && *input_line_pointer != ';')
-           as_warn ("Badly formed .size directive");
+           as_warn (_("Badly formed .size directive"));
          break;
        }
     }
          break;
        }
     }
@@ -2637,7 +2679,7 @@ ecoff_directive_size (ignore)
     {
       if (coff_type.num_sizes >= N_TQ)
        {
     {
       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];
          break;
        }
       coff_type.sizes[coff_type.num_sizes] = sizes[i];
@@ -2660,7 +2702,7 @@ ecoff_directive_type (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2671,11 +2713,15 @@ ecoff_directive_type (ignore)
   coff_type.basic_type = map_coff_types[coff_type.orig_type];
 
   tq_ptr = &coff_type.type_qualifiers[N_TQ];
   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])
        {
     {
       if (tq_ptr == &coff_type.type_qualifiers[0])
        {
-         as_warn ("Too derived values in .type argument");
+         /* 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"),
+                  coff_sym_name);
          break;
        }
       if (ISPTR (val))
          break;
        }
       if (ISPTR (val))
@@ -2685,7 +2731,7 @@ ecoff_directive_type (ignore)
       else if (ISARY (val))
        *--tq_ptr = tq_Array;
       else
       else if (ISARY (val))
        *--tq_ptr = tq_Array;
       else
-       as_fatal ("Unrecognized .type argument");
+       as_fatal (_("Unrecognized .type argument"));
 
       val = DECREF (val);
     }
 
       val = DECREF (val);
     }
@@ -2697,11 +2743,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
   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;
     }
       coff_is_function = 1;
       tq_shft[-1] = tq_Nil;
     }
@@ -2724,7 +2770,7 @@ ecoff_directive_tag (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2747,33 +2793,29 @@ void
 ecoff_directive_val (ignore)
      int ignore;
 {
 ecoff_directive_val (ignore)
      int ignore;
 {
+  expressionS exp;
+
   if (coff_sym_name == (char *) NULL)
     {
   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;
     }
 
       demand_empty_rest_of_line ();
       return;
     }
 
-  if (! is_name_beginner ((unsigned char) *input_line_pointer))
-    coff_value = get_absolute_expression ();
-  else
+  expression (&exp);
+  if (exp.X_op != O_constant && exp.X_op != O_symbol)
     {
     {
-      char *name;
-      char name_end;
-
-      name = input_line_pointer;
-      name_end = get_symbol_end ();
-
-      if (strcmp (name, ".") == 0)
-       as_warn ("`.val .' not supported");
-      else
-       coff_sym_value = symbol_find_or_make (name);
-
-      *input_line_pointer = name_end;
+      as_bad (_(".val expression is too copmlex"));
+      demand_empty_rest_of_line ();
+      return;
+    }
 
 
-      /* FIXME: gcc can generate address expressions here in unusual
-        cases (search for "obscure" in sdbout.c), although this is
-        very unlikely for a MIPS chip.  */
+  if (exp.X_op == O_constant)
+    coff_value = exp.X_add_number;
+  else
+    {
+      coff_sym_value = exp.X_add_symbol;
+      coff_sym_addend = exp.X_add_number;
     }
 
   demand_empty_rest_of_line ();
     }
 
   demand_empty_rest_of_line ();
@@ -2794,7 +2836,7 @@ ecoff_directive_endef (ignore)
 
   if (coff_sym_name == (char *) NULL)
     {
 
   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;
     }
 
       return;
     }
 
@@ -2820,13 +2862,13 @@ ecoff_directive_endef (ignore)
 
       if (coff_type.num_sizes != 1 || diff < 0)
        {
 
       if (coff_type.num_sizes != 1 || diff < 0)
        {
-         as_warn ("Bad COFF debugging info");
+         as_warn (_("Bad COFF debugging info"));
          return;
        }
 
       /* If this is an array, make sure the same number of dimensions
          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)
        {
       coff_type.extra_sizes = 0;
       if (diff)
        {
@@ -2841,15 +2883,17 @@ ecoff_directive_endef (ignore)
 
          coff_type.num_sizes = i + 1;
          for (i--; i >= 0; i--)
 
          coff_type.num_sizes = i + 1;
          for (i--; i >= 0; i--)
-           coff_type.sizes[i] = (coff_type.sizes[i + 1]
-                                 / coff_type.dimensions[i + 1]);
+           coff_type.sizes[i] = (coff_type.dimensions[i + 1] == 0
+                                 ? 0
+                                 : (coff_type.sizes[i + 1]
+                                    / coff_type.dimensions[i + 1]));
        }
     }
   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
        }
     }
   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.  */
+         having a size field that isn't an array.  */
       coff_type.bitfield = 1;
     }
 
       coff_type.bitfield = 1;
     }
 
@@ -2867,7 +2911,7 @@ ecoff_directive_endef (ignore)
        {
          if (coff_tag == (char *) NULL)
            {
        {
          if (coff_tag == (char *) NULL)
            {
-             as_warn ("No tag specified for %s", name);
+             as_warn (_("No tag specified for %s"), name);
              return;
            }
 
              return;
            }
 
@@ -2894,12 +2938,12 @@ ecoff_directive_endef (ignore)
       break;
 
       /* For the beginning of structs, unions, and enumerations, the
       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)
        {
     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
          return;
        }
       else
@@ -2909,8 +2953,8 @@ ecoff_directive_endef (ignore)
       break;
 
       /* For the end of structs, unions, and enumerations, omit the
       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;
     case st_End:
       free (name);
       name = (char *) NULL;
@@ -2919,10 +2963,10 @@ ecoff_directive_endef (ignore)
       break;
 
       /* Members of structures and unions that aren't bitfields, need
       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;
     case st_Member:
       if (! coff_type.bitfield && ! coff_inside_enumeration)
        coff_value *= 8;
@@ -2935,6 +2979,7 @@ ecoff_directive_endef (ignore)
                          coff_symbol_typ,
                          coff_storage_class,
                          coff_sym_value,
                          coff_symbol_typ,
                          coff_storage_class,
                          coff_sym_value,
+                         coff_sym_addend,
                          (symint_t) coff_value,
                          indx);
 
                          (symint_t) coff_value,
                          indx);
 
@@ -2970,14 +3015,14 @@ ecoff_directive_end (ignore)
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
 
   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)
     {
       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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -2988,7 +3033,7 @@ ecoff_directive_end (ignore)
   ch = *name;
   if (! is_name_beginner (ch))
     {
   ch = *name;
   if (! is_name_beginner (ch))
     {
-      as_warn (".end directive has no name");
+      as_warn (_(".end directive has no name"));
       *input_line_pointer = name_end;
       demand_empty_rest_of_line ();
       return;
       *input_line_pointer = name_end;
       demand_empty_rest_of_line ();
       return;
@@ -3000,26 +3045,13 @@ ecoff_directive_end (ignore)
      symbol.  */
   ent = symbol_find (name);
   if (ent == (symbolS *) NULL)
      symbol.  */
   ent = symbol_find (name);
   if (ent == (symbolS *) NULL)
-    as_warn (".end directive names unknown symbol");
+    as_warn (_(".end directive names unknown symbol"));
   else
   else
-    {
-      (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
+    (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
                             symbol_new ("L0\001", now_seg,
                                         (valueT) frag_now_fix (),
                                         frag_now),
                             symbol_new ("L0\001", now_seg,
                                         (valueT) frag_now_fix (),
                                         frag_now),
-                            (symint_t) 0, (symint_t) 0);
-
-      if (stabs_seen && generate_asm_lineno)
-       {
-       char *n;
-
-         n = xmalloc (strlen (name) + 4);
-         strcpy (n, name);
-         strcat (n, ":F1");
-         (void) add_ecoff_symbol ((const char *) n, stGlobal, scText, 
-                               ent, 0, ECOFF_MARK_STAB (N_FUN));
-       }
-    }
+                            (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
 
   cur_proc_ptr = (proc_t *) NULL;
 
 
   cur_proc_ptr = (proc_t *) NULL;
 
@@ -3038,11 +3070,11 @@ ecoff_directive_ent (ignore)
   register int ch;
 
   if (cur_file_ptr == (efdr_t *) NULL)
   register int ch;
 
   if (cur_file_ptr == (efdr_t *) NULL)
-    add_file ((const char *) NULL, 0);
+    add_file ((const char *) NULL, 0, 1);
 
   if (cur_proc_ptr != (proc_t *) NULL)
     {
 
   if (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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -3053,7 +3085,7 @@ ecoff_directive_ent (ignore)
   ch = *name;
   if (! is_name_beginner (ch))
     {
   ch = *name;
   if (! is_name_beginner (ch))
     {
-      as_warn (".ent directive has no name");
+      as_warn (_(".ent directive has no name"));
       *input_line_pointer = name_end;
       demand_empty_rest_of_line ();
       return;
       *input_line_pointer = name_end;
       demand_empty_rest_of_line ();
       return;
@@ -3073,12 +3105,38 @@ ecoff_directive_ent (ignore)
       ++input_line_pointer;
       SKIP_WHITESPACE ();
     }
       ++input_line_pointer;
       SKIP_WHITESPACE ();
     }
-  if (isdigit (*input_line_pointer) || *input_line_pointer == '-')
+  if (isdigit ((unsigned char) *input_line_pointer)
+      || *input_line_pointer == '-')
     (void) get_absolute_expression ();
 
   demand_empty_rest_of_line ();
 }
 \f
     (void) get_absolute_expression ();
 
   demand_empty_rest_of_line ();
 }
 \f
+/* Parse .extern directives.  */
+
+void
+ecoff_directive_extern (ignore)
+     int ignore;
+{
+  char *name;
+  int c;
+  symbolS *symbolp;
+  valueT size;
+
+  name = input_line_pointer;
+  c = get_symbol_end ();
+  symbolp = symbol_find_or_make (name);
+  *input_line_pointer = c;
+
+  S_SET_EXTERNAL (symbolp);
+
+  if (*input_line_pointer == ',')
+    ++input_line_pointer;
+  size = get_absolute_expression ();
+
+  symbol_get_obj (symbolp)->ecoff_extern_size = size;
+}
+\f
 /* Parse .file directives.  */
 
 void
 /* Parse .file directives.  */
 
 void
@@ -3091,7 +3149,7 @@ ecoff_directive_file (ignore)
 
   if (cur_proc_ptr != (proc_t *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -3101,7 +3159,7 @@ ecoff_directive_file (ignore)
   /* FIXME: we don't have to save the name here.  */
   name = demand_copy_C_string (&len);
 
   /* FIXME: we don't have to save the name here.  */
   name = demand_copy_C_string (&len);
 
-  add_file (name, indx - 1);
+  add_file (name, indx - 1, 0);
 
   demand_empty_rest_of_line ();
 }
 
   demand_empty_rest_of_line ();
 }
@@ -3116,14 +3174,14 @@ ecoff_directive_fmask (ignore)
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
 
   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) != ',')
     {
       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;
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3145,7 +3203,7 @@ ecoff_directive_frame (ignore)
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
 
   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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -3156,7 +3214,7 @@ ecoff_directive_frame (ignore)
   if (*input_line_pointer++ != ','
       || get_absolute_expression_and_terminator (&val) != ',')
     {
   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;
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3166,9 +3224,10 @@ ecoff_directive_frame (ignore)
 
   cur_proc_ptr->pdr.pcreg = tc_get_register (0);
 
 
   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.  */
+#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
   s_ignore (42);
   demand_empty_rest_of_line ();
 #else
   s_ignore (42);
@@ -3185,14 +3244,14 @@ ecoff_directive_mask (ignore)
 
   if (cur_proc_ptr == (proc_t *) NULL)
     {
 
   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) != ',')
     {
       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;
       --input_line_pointer;
       demand_empty_rest_of_line ();
       return;
@@ -3215,14 +3274,14 @@ ecoff_directive_loc (ignore)
 
   if (cur_file_ptr == (efdr_t *) NULL)
     {
 
   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)
     {
       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;
     }
       demand_empty_rest_of_line ();
       return;
     }
@@ -3247,7 +3306,7 @@ ecoff_directive_loc (ignore)
                               symbol_new ("L0\001", now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
                               symbol_new ("L0\001", now_seg,
                                           (valueT) frag_now_fix (),
                                           frag_now),
-                              0, lineno);
+                              (bfd_vma) 0, 0, lineno);
       return;
     }
 
       return;
     }
 
@@ -3260,6 +3319,9 @@ ecoff_directive_loc (ignore)
   list->paddr = frag_now_fix ();
   list->lineno = lineno;
 
   list->paddr = frag_now_fix ();
   list->lineno = lineno;
 
+  /* We don't want to merge files which have line numbers.  */
+  cur_file_ptr->fdr.fMerge = 0;
+
   /* A .loc directive will sometimes appear before a .ent directive,
      which means that cur_proc_ptr will be NULL here.  Arrange to
      patch this up.  */
   /* A .loc directive will sometimes appear before a .ent directive,
      which means that cur_proc_ptr will be NULL here.  Arrange to
      patch this up.  */
@@ -3274,10 +3336,29 @@ ecoff_directive_loc (ignore)
     }
   else
     {
     }
   else
     {
+      last_lineno = list;
       *last_lineno_ptr = list;
       last_lineno_ptr = &list->next;
     }
 }
       *last_lineno_ptr = list;
       last_lineno_ptr = &list->next;
     }
 }
+
+/* The MIPS assembler sometimes inserts nop instructions in the
+   instruction stream.  When this happens, we must patch up the .loc
+   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;
+{
+  if (last_lineno != NULL
+      && last_lineno->frag == old_frag
+      && last_lineno->paddr == old_frag_offset)
+    {
+      last_lineno->frag = frag_now;
+      last_lineno->paddr = frag_now_fix ();
+    }
+}
 \f
 /* Make sure the @stabs symbol is emitted.  */
 
 \f
 /* Make sure the @stabs symbol is emitted.  */
 
@@ -3287,14 +3368,65 @@ mark_stabs (ignore)
 {
   if (! stabs_seen)
     {
 {
   if (! stabs_seen)
     {
-      /* Add a dummy @stabs dymbol. */
+      /* Add a dummy @stabs dymbol.  */
       stabs_seen = 1;
       (void) add_ecoff_symbol (stabs_symbol, stNil, scInfo,
                               (symbolS *) NULL,
       stabs_seen = 1;
       (void) add_ecoff_symbol (stabs_symbol, stNil, scInfo,
                               (symbolS *) NULL,
-                              (symint_t) -1, ECOFF_MARK_STAB (0));
+                              (bfd_vma) 0, (symint_t) -1,
+                              ECOFF_MARK_STAB (0));
     }
 }
 \f
     }
 }
 \f
+/* Parse .weakext directives.  */
+#ifndef TC_MIPS
+/* For TC_MIPS use the version in tc-mips.c.  */
+void
+ecoff_directive_weakext (ignore)
+     int ignore;
+{
+  char *name;
+  int c;
+  symbolS *symbolP;
+  expressionS exp;
+
+  name = input_line_pointer;
+  c = get_symbol_end ();
+  symbolP = symbol_find_or_make (name);
+  *input_line_pointer = c;
+
+  SKIP_WHITESPACE ();
+
+  if (*input_line_pointer == ',')
+    {
+      if (S_IS_DEFINED (symbolP))
+       {
+         as_bad (_("Ignoring attempt to redefine symbol `%s'."),
+                 S_GET_NAME (symbolP));
+         ignore_rest_of_line ();
+         return;
+       }
+
+      ++input_line_pointer;
+      SKIP_WHITESPACE ();
+      if (! is_end_of_line[(unsigned char) *input_line_pointer])
+       {
+         expression (&exp);
+         if (exp.X_op != O_symbol)
+           {
+             as_bad (_("bad .weakext directive"));
+             ignore_rest_of_line ();
+             return;
+           }
+         symbol_set_value_expression (symbolP, &exp);
+       }
+    }
+
+  S_SET_WEAK (symbolP);
+
+  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.
    When this is called, input_line_pointer will be pointing at the
 /* Handle .stabs directives.  The actual parsing routine is done by a
    generic routine.  This routine is called via OBJ_PROCESS_STAB.
    When this is called, input_line_pointer will be pointing at the
@@ -3328,7 +3460,8 @@ mark_stabs (ignore)
        value           a numeric value or an address.  */
 
 void
        value           a numeric value or an address.  */
 
 void
-ecoff_stab (what, string, type, other, desc)
+ecoff_stab (sec, what, string, type, other, desc)
+     segT sec;
      int what;
      const char *string;
      int type;
      int what;
      const char *string;
      int type;
@@ -3338,15 +3471,18 @@ ecoff_stab (what, string, type, other, desc)
   efdr_t *save_file_ptr = cur_file_ptr;
   symbolS *sym;
   symint_t value;
   efdr_t *save_file_ptr = cur_file_ptr;
   symbolS *sym;
   symint_t value;
+  bfd_vma addend;
   st_t st;
   sc_t sc;
   symint_t indx;
   localsym_t *hold = NULL;
 
   st_t st;
   sc_t sc;
   symint_t indx;
   localsym_t *hold = NULL;
 
+  ecoff_debugging_seen = 1;
+
   /* We don't handle .stabd.  */
   if (what != 's' && what != 'n')
     {
   /* 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;
     }
 
       return;
     }
 
@@ -3356,12 +3492,12 @@ ecoff_stab (what, string, type, other, desc)
 
   /* We ignore the other field.  */
   if (other != 0)
 
   /* 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)
     {
 
   /* Make sure we have a current file.  */
   if (cur_file_ptr == (efdr_t *) NULL)
     {
-      add_file ((const char *) NULL, 0);
+      add_file ((const char *) NULL, 0, 1);
       save_file_ptr = cur_file_ptr;
     }
 
       save_file_ptr = cur_file_ptr;
     }
 
@@ -3390,7 +3526,7 @@ ecoff_stab (what, string, type, other, desc)
       dummy_symr.index = desc;
       if (dummy_symr.index != 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;
        }
                   desc, what);
          return;
        }
@@ -3402,6 +3538,7 @@ ecoff_stab (what, string, type, other, desc)
       *input_line_pointer = name_end;
 
       value = 0;
       *input_line_pointer = name_end;
 
       value = 0;
+      addend = 0;
       st = st_Label;
       sc = sc_Text;
       indx = desc;
       st = st_Label;
       sc = sc_Text;
       indx = desc;
@@ -3413,7 +3550,7 @@ ecoff_stab (what, string, type, other, desc)
        listing_source_file (string);
 #endif
 
        listing_source_file (string);
 #endif
 
-      if (isdigit (*input_line_pointer)
+      if (isdigit ((unsigned char) *input_line_pointer)
          || *input_line_pointer == '-'
          || *input_line_pointer == '+')
        {
          || *input_line_pointer == '-'
          || *input_line_pointer == '+')
        {
@@ -3421,33 +3558,38 @@ ecoff_stab (what, string, type, other, desc)
          sc = sc_Nil;
          sym = (symbolS *) NULL;
          value = get_absolute_expression ();
          sc = sc_Nil;
          sym = (symbolS *) NULL;
          value = get_absolute_expression ();
+         addend = 0;
        }
       else if (! is_name_beginner ((unsigned char) *input_line_pointer))
        {
        }
       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
        {
          return;
        }
       else
        {
-         char *name;
-         char name_end;
-
-         name = input_line_pointer;
-         name_end = get_symbol_end ();
-
-         sym = symbol_find_or_make (name);
+         expressionS exp;
 
          sc = sc_Nil;
          st = st_Nil;
 
          sc = sc_Nil;
          st = st_Nil;
-         value = 0;
 
 
-         *input_line_pointer = name_end;
-         if (name_end == '+' || name_end == '-')
+         expression (&exp);
+         if (exp.X_op == O_constant)
+           {
+             sym = NULL;
+             value = exp.X_add_number;
+             addend = 0;
+           }
+         else if (exp.X_op == O_symbol)
+           {
+             sym = exp.X_add_symbol;
+             value = 0;
+             addend = exp.X_add_number;
+           }
+         else
            {
            {
-             ++input_line_pointer;
-             value = get_absolute_expression ();
-             if (name_end == '-')
-               value = - value;
+             sym = make_expr_symbol (&exp);
+             value = 0;
+             addend = 0;
            }
        }
 
            }
        }
 
@@ -3458,12 +3600,12 @@ ecoff_stab (what, string, type, other, desc)
      ECOFF symbol.  We want to compute the type of the ECOFF symbol
      independently.  */
   if (sym != (symbolS *) NULL)
      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, value, indx);
+  (void) add_ecoff_symbol (string, st, sc, sym, addend, value, indx);
 
   if (sym != (symbolS *) NULL)
 
   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;
 
   /* Restore normal file type.  */
   cur_file_ptr = save_file_ptr;
@@ -3477,14 +3619,14 @@ ecoff_frob_symbol (sym)
      symbolS *sym;
 {
   if (S_IS_COMMON (sym)
      symbolS *sym;
 {
   if (S_IS_COMMON (sym)
-          && S_GET_VALUE (sym) > 0
-          && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput))
+      && S_GET_VALUE (sym) > 0
+      && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput))
     {
       static asection scom_section;
       static asymbol scom_symbol;
 
       /* We must construct a fake section similar to bfd_com_section
     {
       static asection scom_section;
       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;
       if (scom_section.name == NULL)
        {
          scom_section = bfd_com_section;
@@ -3498,6 +3640,14 @@ ecoff_frob_symbol (sym)
        }
       S_SET_SEGMENT (sym, &scom_section);
     }
        }
       S_SET_SEGMENT (sym, &scom_section);
     }
+
+  /* Double check weak symbols.  */
+  if (S_IS_WEAK (sym))
+    {
+      if (S_IS_COMMON (sym))
+       as_bad (_("Symbol `%s' can not be both weak and common"),
+               S_GET_NAME (sym));
+    }
 }
 \f
 /* Add bytes to the symbolic information buffer.  */
 }
 \f
 /* Add bytes to the symbolic information buffer.  */
@@ -3571,6 +3721,7 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
   long iline;
   long totcount;
   lineno_list_t first;
   long iline;
   long totcount;
   lineno_list_t first;
+  lineno_list_t *local_first_lineno = first_lineno;
 
   if (linecntptr != (long *) NULL)
     *linecntptr = 0;
 
   if (linecntptr != (long *) NULL)
     *linecntptr = 0;
@@ -3590,48 +3741,53 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
      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
      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)))
          != 0))
     {
       && ((S_GET_VALUE (first_proc_ptr->sym->as_sym)
           + bfd_get_section_vma (stdoutput,
                                  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.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
     {
       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
             before it is used.  */
          count = 1;
        }
       if (l->next == (lineno_list_t *) NULL)
        {
          /* We want a count of zero, but it will be decremented
             before it is used.  */
          count = 1;
        }
-      else
+      else if (l->next->frag->fr_address + l->next->paddr
+              > l->frag->fr_address + l->paddr)
        {
          count = ((l->next->frag->fr_address + l->next->paddr
                    - (l->frag->fr_address + l->paddr))
                   >> 2);
        {
          count = ((l->next->frag->fr_address + l->next->paddr
                    - (l->frag->fr_address + l->paddr))
                   >> 2);
-         if (count <= 0)
-           {
-             /* Don't change last, so we still get the right delta.  */
-             continue;
-           }
+       }
+      else
+       {
+         /* Don't change last, so we still get the right delta.  */
+         continue;
        }
 
       if (l->file != file || l->proc != proc)
        }
 
       if (l->file != file || l->proc != proc)
@@ -3641,8 +3797,6 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
          if (l->file != file && file != (efdr_t *) NULL)
            {
              file->fdr.cbLine = c - file->fdr.cbLineOffset;
          if (l->file != file && file != (efdr_t *) NULL)
            {
              file->fdr.cbLine = c - file->fdr.cbLineOffset;
-             /* The cline field is ill-documented.  This is a guess
-                at the right value.  */
              file->fdr.cline = totcount + count;
              if (linecntptr != (long *) NULL)
                *linecntptr += totcount + count;
              file->fdr.cline = totcount + count;
              if (linecntptr != (long *) NULL)
                *linecntptr += totcount + count;
@@ -3651,8 +3805,14 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
 
          if (l->file != file)
            {
 
          if (l->file != file)
            {
+             efdr_t *last_file = file;
+
              file = l->file;
              file = l->file;
-             file->fdr.ilineBase = iline;
+             if (last_file != (efdr_t *) NULL)
+               file->fdr.ilineBase
+                 = last_file->fdr.ilineBase + last_file->fdr.cline;
+             else
+               file->fdr.ilineBase = 0;
              file->fdr.cbLineOffset = c;
            }
          if (l->proc != proc)
              file->fdr.cbLineOffset = c;
            }
          if (l->proc != proc)
@@ -3662,8 +3822,6 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
                {
                  proc->pdr.lnLow = l->lineno;
                  proc->pdr.cbLineOffset = c - file->fdr.cbLineOffset;
                {
                  proc->pdr.lnLow = l->lineno;
                  proc->pdr.cbLineOffset = c - file->fdr.cbLineOffset;
-                 /* The iline field is ill-documented.  This is a
-                    guess at the right value.  */
                  proc->pdr.iline = totcount;
                }
            }
                  proc->pdr.iline = totcount;
                }
            }
@@ -3852,11 +4010,11 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                      symint_t indx;
 
                      /* The value of a block start symbol is the
                      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)
                        {
                      if (sym_ptr->ecoff_sym.asym.st == (int) st_Block
                          && sym_ptr->ecoff_sym.asym.sc == (int) sc_Text)
                        {
@@ -3866,7 +4024,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))
                          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);
                        }
                          sym_ptr->ecoff_sym.asym.value =
                            S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
                        }
@@ -3874,18 +4032,22 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        sym_ptr->ecoff_sym.asym.value =
                          (S_GET_VALUE (as_sym)
                           + bfd_get_section_vma (stdoutput,
                        sym_ptr->ecoff_sym.asym.value =
                          (S_GET_VALUE (as_sym)
                           + bfd_get_section_vma (stdoutput,
-                                                 S_GET_SEGMENT (as_sym)));
+                                                 S_GET_SEGMENT (as_sym))
+                          + sym_ptr->addend);
+
+                     sym_ptr->ecoff_sym.weakext = S_IS_WEAK (as_sym);
 
                      /* Set st_Proc to st_StaticProc for local
                         functions.  */
                      if (sym_ptr->ecoff_sym.asym.st == st_Proc
                          && S_IS_DEFINED (as_sym)
 
                      /* Set st_Proc to st_StaticProc for local
                         functions.  */
                      if (sym_ptr->ecoff_sym.asym.st == st_Proc
                          && S_IS_DEFINED (as_sym)
-                         && ! S_IS_EXTERNAL (as_sym))
+                         && ! S_IS_EXTERNAL (as_sym)
+                         && ! S_IS_WEAK (as_sym))
                        sym_ptr->ecoff_sym.asym.st = st_StaticProc;
 
                      /* Get the type and storage class based on where
                        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
                      indx = sym_ptr->ecoff_sym.asym.index;
                      if (sym_ptr->ecoff_sym.asym.st == st_Nil
                          && sym_ptr->ecoff_sym.asym.sc == sc_Nil
@@ -3903,9 +4065,11 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 
                          if (! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym)
                              && (S_IS_EXTERNAL (as_sym)
 
                          if (! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym)
                              && (S_IS_EXTERNAL (as_sym)
+                                 || S_IS_WEAK (as_sym)
                                  || ! S_IS_DEFINED (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;
                                st = st_Proc;
                              else
                                st = st_Global;
@@ -3917,16 +4081,20 @@ ecoff_build_symbols (backend, buf, bufend, offset)
 
                          if (! S_IS_DEFINED (as_sym))
                            {
 
                          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;
                                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, s);
+#endif
                            }
                          else if (S_IS_COMMON (as_sym))
                            {
                            }
                          else if (S_IS_COMMON (as_sym))
                            {
@@ -3953,29 +4121,40 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                          else if (seg == &bfd_abs_section)
                            sc = sc_Abs;
                          else
                          else if (seg == &bfd_abs_section)
                            sc = sc_Abs;
                          else
-                           abort ();
+                           {
+                             /* This must be a user named section.
+                                This is not possible in ECOFF, but it
+                                is in ELF.  */
+                             sc = sc_Data;
+                           }
 
                          sym_ptr->ecoff_sym.asym.st = (int) st;
                          sym_ptr->ecoff_sym.asym.sc = (int) sc;
                        }
 
                      /* This is just an external symbol if it is
 
                          sym_ptr->ecoff_sym.asym.st = (int) st;
                          sym_ptr->ecoff_sym.asym.sc = (int) sc;
                        }
 
                      /* 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)
                      if ((S_IS_EXTERNAL (as_sym)
+                          || S_IS_WEAK (as_sym)
                           || ! S_IS_DEFINED (as_sym))
                          && sym_ptr->proc_ptr == (proc_t *) NULL
                          && sym_ptr->ecoff_sym.asym.st != (int) st_Nil
                          && ! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym))
                        local = 0;
 
                           || ! S_IS_DEFINED (as_sym))
                          && sym_ptr->proc_ptr == (proc_t *) NULL
                          && sym_ptr->ecoff_sym.asym.st != (int) st_Nil
                          && ! ECOFF_IS_STAB (&sym_ptr->ecoff_sym.asym))
                        local = 0;
 
+                     /* This is just an external symbol if it is a
+                        common symbol.  */
+                     if (S_IS_COMMON (as_sym))
+                       local = 0;
+
                      /* If an st_end symbol has an associated gas
                      /* 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 \001 in the names.  */
                      if (local
                          && sym_ptr->ecoff_sym.asym.st != st_End
                          && strchr (sym_ptr->name, '\001') == 0)
                      if (local
                          && sym_ptr->ecoff_sym.asym.st != st_End
                          && strchr (sym_ptr->name, '\001') == 0)
@@ -4023,10 +4202,10 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                        }
 
                      /* The value of the symbol marking the end of a
                        }
 
                      /* 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)
                        {
                      if (begin_type == st_Proc
                          || begin_type == st_StaticProc)
                        {
@@ -4034,10 +4213,20 @@ 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))
                          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));
                          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.  */
+                         if ((sym_ptr->ecoff_sym.asym.value & 1) != 0)
+                           ++sym_ptr->ecoff_sym.asym.value;
+
+#ifdef S_SET_SIZE
+                         S_SET_SIZE (begin_ptr->as_sym,
+                                     sym_ptr->ecoff_sym.asym.value);
+#endif
                        }
                      else if (begin_type == st_Block
                               && sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
                        }
                      else if (begin_type == st_Block
                               && sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
@@ -4049,7 +4238,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))
                          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);
                        }
                          sym_ptr->ecoff_sym.asym.value =
                            S_GET_VALUE (as_sym) - S_GET_VALUE (begin_sym);
                        }
@@ -4087,13 +4276,18 @@ 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
                     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)
                          && local)
                        sym_ptr->ecoff_sym.asym.index = isym - ifilesym - 1;
                      sym_ptr->ecoff_sym.ifd = fil_ptr->file_index;
                    {
                      if ((sym_ptr->ecoff_sym.asym.st == st_Proc
                           || sym_ptr->ecoff_sym.asym.st == st_StaticProc)
                          && local)
                        sym_ptr->ecoff_sym.asym.index = isym - ifilesym - 1;
                      sym_ptr->ecoff_sym.ifd = fil_ptr->file_index;
+
+                     /* Don't try to merge an FDR which has an
+                        external symbol attached to it.  */
+                     if (S_IS_EXTERNAL (as_sym) || S_IS_WEAK (as_sym))
+                       fil_ptr->fdr.fMerge = 0;
                    }
                }
            }
                    }
                }
            }
@@ -4172,9 +4366,9 @@ ecoff_build_procs (backend, buf, bufend, offset)
                  if (first)
                    {
                      /* This code used to force the adr of the very
                  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;
                    }
                      fil_ptr->fdr.adr = adr;
                      first = 0;
                    }
@@ -4209,7 +4403,7 @@ ecoff_build_aux (backend, buf, bufend, offset)
   long iaux;
   vlinks_t *file_link;
 
   long iaux;
   vlinks_t *file_link;
 
-  bigendian = stdoutput->xvec->header_byteorder_big_p;
+  bigendian = bfd_big_endian (stdoutput);
 
   aux_out = (union aux_ext *) (*buf + offset);
 
 
   aux_out = (union aux_ext *) (*buf + offset);
 
@@ -4451,24 +4645,28 @@ ecoff_setup_ext ()
 
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (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.  */
       if (! S_IS_EXTERNAL (sym)
        continue;
 
       /* If this is a local symbol, then force the fields to zero.  */
       if (! S_IS_EXTERNAL (sym)
+         && ! S_IS_WEAK (sym)
          && S_IS_DEFINED (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 dbeugging information.  */
+/* Build the ECOFF debugging information.  */
 
 unsigned long
 ecoff_build_debug (hdr, bufp, backend)
 
 unsigned long
 ecoff_build_debug (hdr, bufp, backend)
@@ -4482,7 +4680,7 @@ ecoff_build_debug (hdr, bufp, backend)
   efdr_t *fil_ptr;
   int end_warning;
   efdr_t *hold_file_ptr;
   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;
   symbolS *sym;
   char *buf;
   char *bufend;
@@ -4490,7 +4688,7 @@ ecoff_build_debug (hdr, bufp, backend)
 
   /* Make sure we have a file.  */
   if (first_file == (efdr_t *) NULL)
 
   /* Make sure we have a file.  */
   if (first_file == (efdr_t *) NULL)
-    add_file ((const char *) NULL, 0);
+    add_file ((const char *) NULL, 0, 1);
 
   /* Handle any top level tags.  */
   for (ptag = top_tag_head->first_tag;
 
   /* Handle any top level tags.  */
   for (ptag = top_tag_head->first_tag;
@@ -4514,14 +4712,14 @@ ecoff_build_debug (hdr, bufp, backend)
   cur_proc_ptr = (proc_t *) NULL;
   for (sym = symbol_rootP; sym != (symbolS *) NULL; sym = symbol_next (sym))
     {
   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;
 
        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,
       add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
-                       S_GET_VALUE (sym), indexNil);
+                       (bfd_vma) 0, S_GET_VALUE (sym), indexNil);
     }
   cur_proc_ptr = hold_proc_ptr;
   cur_file_ptr = hold_file_ptr;
     }
   cur_proc_ptr = hold_proc_ptr;
   cur_file_ptr = hold_file_ptr;
@@ -4535,20 +4733,23 @@ ecoff_build_debug (hdr, bufp, backend)
        fil_ptr = fil_ptr->next_file)
     {
       cur_file_ptr = fil_ptr;
        fil_ptr = fil_ptr->next_file)
     {
       cur_file_ptr = fil_ptr;
-      while (cur_file_ptr->cur_scope->prev != (scope_t *) NULL)
+      while (cur_file_ptr->cur_scope != (scope_t *) NULL
+            && cur_file_ptr->cur_scope->prev != (scope_t *) NULL)
        {
          cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev;
        {
          cur_file_ptr->cur_scope = cur_file_ptr->cur_scope->prev;
-         if (! end_warning)
+         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;
            }
        }
              end_warning = 1;
            }
        }
-      (void) add_ecoff_symbol ((const char *) NULL,
-                              st_End, sc_Text,
-                              (symbolS *) NULL,
-                              (symint_t) 0,
-                              (symint_t) 0);
+      if (cur_file_ptr->cur_scope != (scope_t *) NULL)
+       (void) add_ecoff_symbol ((const char *) NULL,
+                                st_End, sc_Text,
+                                (symbolS *) NULL,
+                                (bfd_vma) 0,
+                                (symint_t) 0,
+                                (symint_t) 0);
     }
 
   /* Build the symbolic information.  */
     }
 
   /* Build the symbolic information.  */
@@ -4634,11 +4835,11 @@ ecoff_build_debug (hdr, bufp, backend)
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-static page_t *
+static page_type *
 allocate_cluster (npages)
      unsigned long npages;
 {
 allocate_cluster (npages)
      unsigned long npages;
 {
-  register page_t *value = (page_t *) xmalloc (npages * PAGE_USIZE);
+  register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
 
 #ifdef ECOFF_DEBUG
   if (debug > 3)
 
 #ifdef ECOFF_DEBUG
   if (debug > 3)
@@ -4650,15 +4851,14 @@ allocate_cluster (npages)
   return value;
 }
 
   return value;
 }
 
-
-static page_t *cluster_ptr = NULL;
+static page_type *cluster_ptr = NULL;
 static unsigned long pages_left = 0;
 
 #endif /* MALLOC_CHECK */
 
 /* Allocate one page (which is initialized to 0).  */
 
 static unsigned long pages_left = 0;
 
 #endif /* MALLOC_CHECK */
 
 /* Allocate one page (which is initialized to 0).  */
 
-static page_t *
+static page_type *
 allocate_page ()
 {
 #ifndef MALLOC_CHECK
 allocate_page ()
 {
 #ifndef MALLOC_CHECK
@@ -4672,15 +4872,15 @@ allocate_page ()
   pages_left--;
   return cluster_ptr++;
 
   pages_left--;
   return cluster_ptr++;
 
-#else  /* MALLOC_CHECK */
+#else /* MALLOC_CHECK */
 
 
-  page_t *ptr;
+  page_type *ptr;
 
   ptr = xmalloc (PAGE_USIZE);
   memset (ptr, 0, PAGE_USIZE);
   return ptr;
 
 
   ptr = xmalloc (PAGE_USIZE);
   memset (ptr, 0, PAGE_USIZE);
   return ptr;
 
-#endif /* MALLOC_CHECK */
+#endif /* MALLOC_CHECK */
 }
 \f
 /* Allocate scoping information.  */
 }
 \f
 /* Allocate scoping information.  */
@@ -4693,23 +4893,23 @@ allocate_scope ()
 
 #ifndef MALLOC_CHECK
 
 
 #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)
   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
     {
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_scope].unallocated;
-      register page_t *cur_page        = alloc_counts[(int)alloc_type_scope].cur_page;
+      register int unallocated = alloc_counts[(int) alloc_type_scope].unallocated;
+      register page_type *cur_page     = alloc_counts[(int) alloc_type_scope].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (scope_t);
 
       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];
        }
 
       ptr = &cur_page->scope[--unallocated];
-      alloc_counts[(int)alloc_type_scope].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_scope].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
@@ -4718,7 +4918,7 @@ allocate_scope ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_scope].total_alloc++;
+  alloc_counts[(int) alloc_type_scope].total_alloc++;
   *ptr = initial_scope;
   return ptr;
 }
   *ptr = initial_scope;
   return ptr;
 }
@@ -4729,11 +4929,11 @@ static void
 free_scope (ptr)
      scope_t *ptr;
 {
 free_scope (ptr)
      scope_t *ptr;
 {
-  alloc_counts[(int)alloc_type_scope].total_free++;
+  alloc_counts[(int) alloc_type_scope].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #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);
 #endif
 #else
   free ((PTR) ptr);
 #endif
@@ -4749,18 +4949,18 @@ allocate_vlinks ()
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_vlinks].unallocated;
-  register page_t *cur_page = alloc_counts[(int)alloc_type_vlinks].cur_page;
+  register int unallocated = alloc_counts[(int) alloc_type_vlinks].unallocated;
+  register page_type *cur_page = alloc_counts[(int) alloc_type_vlinks].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (vlinks_t);
 
   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];
     }
 
   ptr = &cur_page->vlinks[--unallocated];
-  alloc_counts[(int)alloc_type_vlinks].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_vlinks].unallocated = unallocated;
 
 #else
 
 
 #else
 
@@ -4768,7 +4968,7 @@ allocate_vlinks ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_vlinks].total_alloc++;
+  alloc_counts[(int) alloc_type_vlinks].total_alloc++;
   *ptr = initial_vlinks;
   return ptr;
 }
   *ptr = initial_vlinks;
   return ptr;
 }
@@ -4783,18 +4983,18 @@ allocate_shash ()
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_shash].unallocated;
-  register page_t *cur_page = alloc_counts[(int)alloc_type_shash].cur_page;
+  register int unallocated = alloc_counts[(int) alloc_type_shash].unallocated;
+  register page_type *cur_page = alloc_counts[(int) alloc_type_shash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (shash_t);
 
   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];
     }
 
   ptr = &cur_page->shash[--unallocated];
-  alloc_counts[(int)alloc_type_shash].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_shash].unallocated = unallocated;
 
 #else
 
 
 #else
 
@@ -4802,7 +5002,7 @@ allocate_shash ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_shash].total_alloc++;
+  alloc_counts[(int) alloc_type_shash].total_alloc++;
   *ptr = initial_shash;
   return ptr;
 }
   *ptr = initial_shash;
   return ptr;
 }
@@ -4817,18 +5017,18 @@ allocate_thash ()
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_thash].unallocated;
-  register page_t *cur_page = alloc_counts[(int)alloc_type_thash].cur_page;
+  register int unallocated = alloc_counts[(int) alloc_type_thash].unallocated;
+  register page_type *cur_page = alloc_counts[(int) alloc_type_thash].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (thash_t);
 
   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];
     }
 
   ptr = &cur_page->thash[--unallocated];
-  alloc_counts[(int)alloc_type_thash].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_thash].unallocated = unallocated;
 
 #else
 
 
 #else
 
@@ -4836,7 +5036,7 @@ allocate_thash ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_thash].total_alloc++;
+  alloc_counts[(int) alloc_type_thash].total_alloc++;
   *ptr = initial_thash;
   return ptr;
 }
   *ptr = initial_thash;
   return ptr;
 }
@@ -4851,23 +5051,23 @@ allocate_tag ()
 
 #ifndef MALLOC_CHECK
 
 
 #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)
   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
     {
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_tag].unallocated;
-      register page_t *cur_page = alloc_counts[(int)alloc_type_tag].cur_page;
+      register int unallocated = alloc_counts[(int) alloc_type_tag].unallocated;
+      register page_type *cur_page = alloc_counts[(int) alloc_type_tag].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (tag_t);
 
       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];
        }
 
       ptr = &cur_page->tag[--unallocated];
-      alloc_counts[(int)alloc_type_tag].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_tag].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
@@ -4876,7 +5076,7 @@ allocate_tag ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_tag].total_alloc++;
+  alloc_counts[(int) alloc_type_tag].total_alloc++;
   *ptr = initial_tag;
   return ptr;
 }
   *ptr = initial_tag;
   return ptr;
 }
@@ -4887,11 +5087,11 @@ static void
 free_tag (ptr)
      tag_t *ptr;
 {
 free_tag (ptr)
      tag_t *ptr;
 {
-  alloc_counts[(int)alloc_type_tag].total_free++;
+  alloc_counts[(int) alloc_type_tag].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #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
 #else
   free ((PTR_T) ptr);
 #endif
@@ -4907,18 +5107,18 @@ allocate_forward ()
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_forward].unallocated;
-  register page_t *cur_page = alloc_counts[(int)alloc_type_forward].cur_page;
+  register int unallocated = alloc_counts[(int) alloc_type_forward].unallocated;
+  register page_type *cur_page = alloc_counts[(int) alloc_type_forward].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (forward_t);
 
   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];
     }
 
   ptr = &cur_page->forward[--unallocated];
-  alloc_counts[(int)alloc_type_forward].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_forward].unallocated = unallocated;
 
 #else
 
 
 #else
 
@@ -4926,7 +5126,7 @@ allocate_forward ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_forward].total_alloc++;
+  alloc_counts[(int) alloc_type_forward].total_alloc++;
   *ptr = initial_forward;
   return ptr;
 }
   *ptr = initial_forward;
   return ptr;
 }
@@ -4941,23 +5141,23 @@ allocate_thead ()
 
 #ifndef MALLOC_CHECK
 
 
 #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)
   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
     {
   else
     {
-      register int unallocated = alloc_counts[(int)alloc_type_thead].unallocated;
-      register page_t *cur_page = alloc_counts[(int)alloc_type_thead].cur_page;
+      register int unallocated = alloc_counts[(int) alloc_type_thead].unallocated;
+      register page_type *cur_page = alloc_counts[(int) alloc_type_thead].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (thead_t);
 
       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];
        }
 
       ptr = &cur_page->thead[--unallocated];
-      alloc_counts[(int)alloc_type_thead].unallocated = unallocated;
+      alloc_counts[(int) alloc_type_thead].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
@@ -4966,7 +5166,7 @@ allocate_thead ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_thead].total_alloc++;
+  alloc_counts[(int) alloc_type_thead].total_alloc++;
   *ptr = initial_thead;
   return ptr;
 }
   *ptr = initial_thead;
   return ptr;
 }
@@ -4977,11 +5177,11 @@ static void
 free_thead (ptr)
      thead_t *ptr;
 {
 free_thead (ptr)
      thead_t *ptr;
 {
-  alloc_counts[(int)alloc_type_thead].total_free++;
+  alloc_counts[(int) alloc_type_thead].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #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
 #else
   free ((PTR_T) ptr);
 #endif
@@ -4995,18 +5195,18 @@ allocate_lineno_list ()
 
 #ifndef MALLOC_CHECK
 
 
 #ifndef MALLOC_CHECK
 
-  register int unallocated = alloc_counts[(int)alloc_type_lineno].unallocated;
-  register page_t *cur_page = alloc_counts[(int)alloc_type_lineno].cur_page;
+  register int unallocated = alloc_counts[(int) alloc_type_lineno].unallocated;
+  register page_type *cur_page = alloc_counts[(int) alloc_type_lineno].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (lineno_list_t);
 
   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];
     }
 
   ptr = &cur_page->lineno[--unallocated];
-  alloc_counts[(int)alloc_type_lineno].unallocated = unallocated;
+  alloc_counts[(int) alloc_type_lineno].unallocated = unallocated;
 
 #else
 
 
 #else
 
@@ -5014,7 +5214,7 @@ allocate_lineno_list ()
 
 #endif
 
 
 #endif
 
-  alloc_counts[(int)alloc_type_lineno].total_alloc++;
+  alloc_counts[(int) alloc_type_lineno].total_alloc++;
   *ptr = initial_lineno_list;
   return ptr;
 }
   *ptr = initial_lineno_list;
   return ptr;
 }
@@ -5024,140 +5224,36 @@ ecoff_set_gp_prolog_size (sz)
      int sz;
 {
   if (cur_proc_ptr == 0)
      int sz;
 {
   if (cur_proc_ptr == 0)
-    abort ();
+    return;
 
   cur_proc_ptr->pdr.gp_prologue = sz;
   if (cur_proc_ptr->pdr.gp_prologue != 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;
 }
 
       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);
-      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, value, indx);
-
-  if (sym != (symbolS *) NULL)
-    sym->ecoff_symbol = hold;
-
-  /* Restore normal file type.  */
-  cur_file_ptr = save_file_ptr;
-}
-
-int 
+int
 ecoff_no_current_file ()
 {
   return cur_file_ptr == (efdr_t *) NULL;
 }
 
 void
 ecoff_no_current_file ()
 {
   return cur_file_ptr == (efdr_t *) NULL;
 }
 
 void
-ecoff_generate_asm_lineno (filename, lineno)
-    char *filename;
-    int lineno;
+ecoff_generate_asm_lineno ()
 {
 {
+  unsigned int lineno;
+  char *filename;
   lineno_list_t *list;
 
   lineno_list_t *list;
 
-  /* this potential can cause problem, when we start to see stab half the 
-     way thru the file */
-/*
-  if (stabs_seen)
-    ecoff_generate_asm_line_stab(filename, lineno);
-*/
+  as_where (&filename, &lineno);
 
 
-  if (strcmp (current_stabs_filename, filename))
-    {
-      add_file (filename, 0);
-      generate_asm_lineno = 1;
-    }
+  if (current_stabs_filename == (char *) NULL
+      || strcmp (current_stabs_filename, filename))
+    add_file (filename, 0, 1);
 
   list = allocate_lineno_list ();
 
 
   list = allocate_lineno_list ();
 
@@ -5168,6 +5264,9 @@ ecoff_generate_asm_lineno (filename, lineno)
   list->paddr = frag_now_fix ();
   list->lineno = lineno;
 
   list->paddr = frag_now_fix ();
   list->lineno = lineno;
 
+  /* We don't want to merge files which have line numbers.  */
+  cur_file_ptr->fdr.fMerge = 0;
+
   /* A .loc directive will sometimes appear before a .ent directive,
      which means that cur_proc_ptr will be NULL here.  Arrange to
      patch this up.  */
   /* A .loc directive will sometimes appear before a .ent directive,
      which means that cur_proc_ptr will be NULL here.  Arrange to
      patch this up.  */
@@ -5177,39 +5276,22 @@ ecoff_generate_asm_lineno (filename, lineno)
 
       pl = &noproc_lineno;
       while (*pl != (lineno_list_t *) NULL)
 
       pl = &noproc_lineno;
       while (*pl != (lineno_list_t *) NULL)
-        pl = &(*pl)->next;
+       pl = &(*pl)->next;
       *pl = list;
     }
   else
     {
       *pl = list;
     }
   else
     {
+      last_lineno = list;
       *last_lineno_ptr = list;
       last_lineno_ptr = &list->next;
     }
 }
 
       *last_lineno_ptr = list;
       last_lineno_ptr = &list->next;
     }
 }
 
-static int line_label_cnt = 0;
+#else
+
 void
 void
-ecoff_generate_asm_line_stab (filename, lineno)
-    char *filename;
-    int lineno;
+ecoff_generate_asm_lineno ()
 {
 {
-  char *ll;
-
-  if (strcmp (current_stabs_filename, filename)) 
-    {
-      add_file (filename, 0);
-      generate_asm_lineno = 1;
-    }
-
-  line_label_cnt++;
-  /* generate local label $LMnn */
-  ll = xmalloc(10);
-  sprintf(ll, "$LM%d", line_label_cnt);
-  colon (ll);
-
-  /* generate stab for the line */
-  generate_ecoff_stab ('n', ll, N_SLINE, 0, lineno); 
-
 }
 
 #endif /* ECOFF_DEBUGGING */
 }
 
 #endif /* ECOFF_DEBUGGING */
This page took 0.063453 seconds and 4 git commands to generate.