2010-05-27 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
[binutils-gdb.git] / gdb / mipsread.c
index fdd8634472e8e0137dfb5b4273eb84ac6ab23612..cb186b1292a41960a215e41bc8ede247c24a5bdf 100644 (file)
@@ -1,7 +1,7 @@
 /* Read a symbol table in MIPS' format (Third-Eye).
 
    Copyright (C) 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1998, 1999, 2000, 2001, 2003, 2004, 2007, 2008
+   1998, 1999, 2000, 2001, 2003, 2004, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    Contributed by Alessandro Forin (af@cs.cmu.edu) at CMU.  Major work
@@ -42,6 +42,8 @@
 #include "elf/internal.h"
 #include "elf/mips.h"
 
+#include "psymtab.h"
+
 static void
 read_alphacoff_dynamic_symtab (struct section_offsets *,
                               struct objfile *objfile);
@@ -67,7 +69,7 @@ mipscoff_symfile_init (struct objfile *objfile)
 /* Read a symbol file from a file.  */
 
 static void
-mipscoff_symfile_read (struct objfile *objfile, int mainline)
+mipscoff_symfile_read (struct objfile *objfile, int symfile_flags)
 {
   bfd *abfd = objfile->obfd;
   struct cleanup *back_to;
@@ -217,13 +219,13 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
   dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect);
   got_secsize = bfd_get_section_size (si.got_sect);
   sym_secptr = xmalloc (sym_secsize);
-  cleanups = make_cleanup (free, sym_secptr);
+  cleanups = make_cleanup (xfree, sym_secptr);
   str_secptr = xmalloc (str_secsize);
-  make_cleanup (free, str_secptr);
+  make_cleanup (xfree, str_secptr);
   dyninfo_secptr = xmalloc (dyninfo_secsize);
-  make_cleanup (free, dyninfo_secptr);
+  make_cleanup (xfree, dyninfo_secptr);
   got_secptr = xmalloc (got_secsize);
-  make_cleanup (free, got_secptr);
+  make_cleanup (xfree, got_secptr);
 
   if (!bfd_get_section_contents (abfd, si.sym_sect, sym_secptr,
                                 (file_ptr) 0, sym_secsize))
@@ -399,6 +401,8 @@ static struct sym_fns ecoff_sym_fns =
   default_symfile_segments,    /* sym_segments: Get segment information from
                                   a file.  */
   NULL,                         /* sym_read_linetable */
+  default_symfile_relocate,    /* sym_relocate: Relocate a debug section.  */
+  &psym_functions,
   NULL                         /* next: pointer to next struct sym_fns */
 };