/* Read HP PA/Risc object files for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "bfd.h"
#include "stabsread.h"
#include "gdb-stabs.h"
#include "complaints.h"
-#include <string.h>
+#include "gdb_string.h"
#include "demangle.h"
#include <sys/file.h>
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 *));
-
-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);
-}
-
/*
LOCAL FUNCTION
number_of_symbols = bfd_get_symcount (abfd);
buf = alloca (symsize * number_of_symbols);
- bfd_seek (abfd, obj_som_sym_filepos (abfd), L_SET);
+ bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET);
val = bfd_read (buf, symsize * number_of_symbols, 1, abfd);
if (val != symsize * number_of_symbols)
error ("Couldn't read symbol dictionary!");
stringtab = alloca (obj_som_stringtab_size (abfd));
- bfd_seek (abfd, obj_som_str_filepos (abfd), L_SET);
+ bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET);
val = bfd_read (stringtab, obj_som_stringtab_size (abfd), 1, abfd);
if (val != obj_som_stringtab_size (abfd))
error ("Can't read in HP string table.");
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);
}
}
hpread_symfile_finish (objfile);
}
-/* SOM specific initialization routine for reading symbols.
+/* SOM specific initialization routine for reading symbols. */
- Nothing SOM specific left to do anymore. */
static void
som_symfile_init (objfile)
struct objfile *objfile;
{
+ /* SOM objects may be reordered, so set OBJF_REORDERED. If we
+ find this causes a significant slowdown in gdb then we could
+ set it in the debug symbol readers only when necessary. */
+ objfile->flags |= OBJF_REORDERED;
hpread_symfile_init (objfile);
}
objfile->num_sections = SECT_OFF_MAX;
section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile -> psymbol_obstack,
- sizeof (struct section_offsets)
- + sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
+ obstack_alloc (&objfile -> psymbol_obstack, SIZEOF_SECTION_OFFSETS);
/* First see if we're a shared library. If so, get the section
offsets from the library, else get them from addr. */