Add support to GDB for the Renesas rl78 architecture.
[external/binutils.git] / gdb / coffread.c
index b11dd73..c727228 100644 (file)
@@ -1,7 +1,5 @@
 /* Read coff symbol tables and convert to internal format, for GDB.
-   Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
-   2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1987-2005, 2007-2012 Free Software Foundation, Inc.
    Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
 
    This file is part of GDB.
 
 extern void _initialize_coffread (void);
 
+/* The objfile we are currently reading.  */
+
+static struct objfile *coffread_objfile;
+
 struct coff_symfile_info
   {
     file_ptr min_lineno_offset;        /* Where in file lowest line#s are.  */
@@ -355,7 +357,7 @@ coff_alloc_type (int index)
      We will fill it in later if we find out how.  */
   if (type == NULL)
     {
-      type = alloc_type (current_objfile);
+      type = alloc_type (coffread_objfile);
       *type_addr = type;
     }
   return type;
@@ -637,7 +639,7 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
                               info->stabsects,
                               info->stabstrsect->filepos, stabstrsize);
     }
-  if (dwarf2_has_info (objfile))
+  if (dwarf2_has_info (objfile, NULL))
     {
       /* DWARF2 sections.  */
       dwarf2_build_psymtabs (objfile);
@@ -745,7 +747,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
   if (val < 0)
     perror_with_name (objfile->name);
 
-  current_objfile = objfile;
+  coffread_objfile = objfile;
   nlist_bfd_global = objfile->obfd;
   nlist_nsyms_global = nsyms;
   last_source_file = NULL;
@@ -1132,7 +1134,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
   ALL_OBJFILE_SYMTABS (objfile, s)
     patch_opaque_types (s);
 
-  current_objfile = NULL;
+  coffread_objfile = NULL;
 }
 \f
 /* Routines for reading headers and symbols from executable.  */
@@ -1153,14 +1155,14 @@ read_one_sym (struct coff_symbol *cs,
   cs->c_symnum = symnum;
   bytes = bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
   if (bytes != local_symesz)
-    error (_("%s: error reading symbols"), current_objfile->name);
+    error (_("%s: error reading symbols"), coffread_objfile->name);
   bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
   cs->c_naux = sym->n_numaux & 0xff;
   if (cs->c_naux >= 1)
     {
       bytes  = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
       if (bytes != local_auxesz)
-       error (_("%s: error reading symbols"), current_objfile->name);
+       error (_("%s: error reading symbols"), coffread_objfile->name);
       bfd_coff_swap_aux_in (symfile_bfd, temp_aux,
                            sym->n_type, sym->n_sclass,
                            0, cs->c_naux, (char *) aux);
@@ -1170,7 +1172,7 @@ read_one_sym (struct coff_symbol *cs,
        {
          bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
          if (bytes != local_auxesz)
-           error (_("%s: error reading symbols"), current_objfile->name);
+           error (_("%s: error reading symbols"), coffread_objfile->name);
        }
     }
   cs->c_name = getsymname (sym);