summaryrefslogtreecommitdiffstats
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1996-07-03 05:11:40 +0000
committerMark Alexander <marka@cygnus>1996-07-03 05:11:40 +0000
commite74acce48c1b4efc29fd1e9e84639b77383aa002 (patch)
tree11d2d6bd0a7cdc15c36480e244625e817eb65e1b /gdb/symfile.c
parent7647e0dd79067a650898281d3cffc4746aa09fae (diff)
downloadppe42-binutils-e74acce48c1b4efc29fd1e9e84639b77383aa002.tar.gz
ppe42-binutils-e74acce48c1b4efc29fd1e9e84639b77383aa002.zip
* coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c,
os9kread.c: Replace identical sym_offsets functions with default_symfile_offsets. * somread.c (som_symfile_offsets): Use new SIZEOF_SECTION_OFFSETS macro to allocate section_offsets. * symfile.c (default_symfile_offsets): New function. * symfile.h: Declare default_symfile_offsets. * symtab.h: Define SIZEOF_SECTION_OFFSETS macro to simplify allocation of section_offsets.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f9a99ae49f..2850af3c54 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -34,10 +34,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "demangle.h"
#include "inferior.h" /* for write_pc */
-
+#include "gdb-stabs.h"
#include "obstack.h"
-#include <assert.h>
+#include <assert.h>
#include <sys/types.h>
#include <fcntl.h>
#include "gdb_string.h"
@@ -365,6 +365,31 @@ find_lowest_section (abfd, sect, obj)
*lowest = sect;
}
+/* Parse the user's idea of an offset for dynamic linking, into our idea
+ of how to represent it for fast symbol reading. This is the default
+ version of the sym_fns.sym_offsets function for symbol readers that
+ don't need to do anything special. It allocates a section_offsets table
+ for the objectfile OBJFILE and stuffs ADDR into all of the offsets. */
+
+struct section_offsets *
+default_symfile_offsets (objfile, addr)
+ struct objfile *objfile;
+ CORE_ADDR addr;
+{
+ struct section_offsets *section_offsets;
+ int i;
+
+ objfile->num_sections = SECT_OFF_MAX;
+ section_offsets = (struct section_offsets *)
+ obstack_alloc (&objfile -> psymbol_obstack, SIZEOF_SECTION_OFFSETS);
+
+ for (i = 0; i < SECT_OFF_MAX; i++)
+ ANOFFSET (section_offsets, i) = addr;
+
+ return section_offsets;
+}
+
+
/* Process a symbol file, as either the main file or as a dynamically
loaded file.
OpenPOWER on IntegriCloud