* solib-svr4.c (svr4_truncate_ptr): New function.
[deliverable/binutils-gdb.git] / gdb / elfread.c
index 2a5e536a498e0c802d564f0d04778dfa94a86ffa..7d0fd03f8840dcd8c34c3cfc0461fd89a0b24d4a 100644 (file)
@@ -1,5 +1,7 @@
 /* Read ELF (Executable and Linking Format) object files for GDB.
-   Copyright 1991, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002
+   Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
    This file is part of GDB.
@@ -74,7 +76,7 @@ static void elf_symfile_finish (struct objfile *);
 
 static void elf_symtab_read (struct objfile *, int);
 
-static void free_elfinfo (void *);
+static void free_elfinfo (PTR);
 
 static struct minimal_symbol *record_minimal_symbol_and_info (char *,
                                                              CORE_ADDR,
@@ -86,7 +88,7 @@ static struct minimal_symbol *record_minimal_symbol_and_info (char *,
                                                              struct objfile
                                                              *);
 
-static void elf_locate_sections (bfd *, asection *, void *);
+static void elf_locate_sections (bfd *, asection *, PTR);
 
 /* We are called once per section from elf_symfile_read.  We
    need to examine each section we are passed, check to see
@@ -171,10 +173,8 @@ record_minimal_symbol_and_info (char *name, CORE_ADDR address,
                                enum minimal_symbol_type ms_type, char *info,   /* FIXME, is this really char *? */
                                asection *bfd_section, struct objfile *objfile)
 {
-#ifdef SMASH_TEXT_ADDRESS
   if (ms_type == mst_text || ms_type == mst_file_text)
-    SMASH_TEXT_ADDRESS (address);
-#endif
+    address = SMASH_TEXT_ADDRESS (address);
 
   return prim_record_minimal_symbol_and_info
     (name, address, ms_type, info, bfd_section->index, bfd_section, objfile);
@@ -464,7 +464,8 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
                                }
                            }
                          else
-                           internal_error ("Section index uninitialized.");
+                           internal_error (__FILE__, __LINE__,
+                                           "Section index uninitialized.");
                          /* Bfd symbols are section relative. */
                          symaddr = sym->value + sym->section->vma;
                          /* Relocate non-absolute symbols by the section offset. */
@@ -475,7 +476,8 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
                          if (index != -1)
                            sectinfo->sections[index] = symaddr;
                          else
-                           internal_error ("Section index uninitialized.");
+                           internal_error (__FILE__, __LINE__,
+                                           "Section index uninitialized.");
                          /* The special local symbols don't go in the
                             minimal symbol table, so ignore this one. */
                          continue;
@@ -652,6 +654,9 @@ elf_symfile_read (struct objfile *objfile, int mainline)
                            ei.lnoffset, ei.lnsize);
     }
 
+  if (DWARF2_BUILD_FRAME_INFO_P ())
+    DWARF2_BUILD_FRAME_INFO(objfile);
+
   /* Install any minimal symbols that have been collected as the current
      minimal symbols for this objfile. */
 
@@ -674,7 +679,7 @@ free_elfinfo (PTR objp)
   while (ssi)
     {
       nssi = ssi->next;
-      mfree (objfile->md, ssi);
+      xmfree (objfile->md, ssi);
       ssi = nssi;
     }
 
@@ -705,7 +710,7 @@ elf_symfile_finish (struct objfile *objfile)
 {
   if (objfile->sym_stab_info != NULL)
     {
-      mfree (objfile->md, objfile->sym_stab_info);
+      xmfree (objfile->md, objfile->sym_stab_info);
     }
 }
 
This page took 0.024919 seconds and 4 git commands to generate.