* spu-tdep.c: Update for unwinder changes.
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index a3af5a41f143977447e3f66182f933418c3c029b..b7d578f956de611a828d604939ebc99f30267842 100644 (file)
@@ -1,7 +1,7 @@
 /* GDB routines for manipulating objfiles.
 
-   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -9,7 +9,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -18,9 +18,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file contains support routines for creating, manipulating, and
    destroying objfile structures. */
@@ -49,6 +47,8 @@
 #include "block.h"
 #include "dictionary.h"
 #include "source.h"
+#include "addrmap.h"
+#include "arch-utils.h"
 
 /* Prototypes for local functions */
 
@@ -188,6 +188,9 @@ allocate_objfile (bfd *abfd, int flags)
     }
   if (abfd != NULL)
     {
+      /* Look up the gdbarch associated with the BFD.  */
+      objfile->gdbarch = gdbarch_from_bfd (abfd);
+
       objfile->name = xstrdup (bfd_get_filename (abfd));
       objfile->mtime = bfd_get_mtime (abfd);
 
@@ -235,6 +238,13 @@ allocate_objfile (bfd *abfd, int flags)
   return (objfile);
 }
 
+/* Retrieve the gdbarch associated with OBJFILE.  */
+struct gdbarch *
+get_objfile_arch (struct objfile *objfile)
+{
+  return objfile->gdbarch;
+}
+
 /* Initialize entry point information for this objfile. */
 
 void
@@ -566,6 +576,9 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
          b = BLOCKVECTOR_BLOCK (bv, i);
          BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
          BLOCK_END (b) += ANOFFSET (delta, s->block_line_section);
+          if (BLOCKVECTOR_MAP (bv))
+            addrmap_relocate (BLOCKVECTOR_MAP (bv),
+                              ANOFFSET (delta, s->block_line_section));
 
          ALL_BLOCK_SYMBOLS (b, iter, sym)
            {
@@ -794,23 +807,6 @@ in_plt_section (CORE_ADDR pc, char *name)
            && strcmp (s->the_bfd_section->name, ".plt") == 0);
   return (retval);
 }
-
-/* Return nonzero if NAME is in the import list of OBJFILE.  Else
-   return zero.  */
-
-int
-is_in_import_list (char *name, struct objfile *objfile)
-{
-  int i;
-
-  if (!objfile || !name || !*name)
-    return 0;
-
-  for (i = 0; i < objfile->import_list_size; i++)
-    if (objfile->import_list[i] && DEPRECATED_STREQ (name, objfile->import_list[i]))
-      return 1;
-  return 0;
-}
 \f
 
 /* Keep a registry of per-objfile data-pointers required by other GDB
This page took 0.02968 seconds and 4 git commands to generate.