Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / somread.c
index 4951f109e40e4d4f53455c9620e011303124028c..ed0fe976997ba187bddd7b980c4b36b7e46348ba 100644 (file)
@@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
-#include "som.h"
-#include "libhppa.h"
 #include <syms.h>
 #include "symtab.h"
 #include "symfile.h"
@@ -32,7 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "complaints.h"
 #include "gdb_string.h"
 #include "demangle.h"
-#include <sys/file.h>
+#include "som.h"
+#include "libhppa.h"
 
 /* Various things we might complain about... */
 
@@ -55,21 +54,16 @@ som_symtab_read PARAMS ((bfd *, struct objfile *,
 static struct section_offsets *
 som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
 
-static void
-record_minimal_symbol PARAMS ((char *, CORE_ADDR,
-                              enum minimal_symbol_type,
-                              struct objfile *));
+/* FIXME: These should really be in a common header somewhere */
 
-static void
-record_minimal_symbol (name, address, ms_type, objfile)
-     char *name;
-     CORE_ADDR address;
-     enum minimal_symbol_type ms_type;
-     struct objfile *objfile;
-{
-  name = obsavestring (name, strlen (name), &objfile -> symbol_obstack);
-  prim_record_minimal_symbol (name, address, ms_type, objfile);
-}
+extern void
+hpread_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int));
+
+extern void
+hpread_symfile_finish PARAMS ((struct objfile *));
+
+extern void
+hpread_symfile_init PARAMS ((struct objfile *));
 
 /*
 
@@ -288,11 +282,15 @@ som_symtab_read (abfd, objfile, section_offsets)
 
        /* This can happen for common symbols when -E is passed to the
           final link.  No idea _why_ that would make the linker force
-          common symbols to have an SS_UNSAT scope, but it does.  */
+          common symbols to have an SS_UNSAT scope, but it does.
+
+          This also happens for weak symbols, but their type is
+          ST_DATA.  */
        case SS_UNSAT:
          switch (bufp->symbol_type)
            {
              case ST_STORAGE:
+             case ST_DATA:
                symname = bufp->name.n_strx + stringtab;
                bufp->symbol_value += data_offset;
                ms_type = mst_data;
@@ -311,9 +309,8 @@ som_symtab_read (abfd, objfile, section_offsets)
        error ("Invalid symbol data; bad HP string table offset: %d",
               bufp->name.n_strx);
 
-      record_minimal_symbol (symname,
-                            bufp->symbol_value, ms_type, 
-                            objfile);
+      prim_record_minimal_symbol (symname, bufp->symbol_value, ms_type, 
+                                 objfile);
     }
 }
 
This page took 0.030781 seconds and 4 git commands to generate.