aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-07-04 13:59:03 +0000
committerJohn Gilmore <gnu@cygnus>1992-07-04 13:59:03 +0000
commit2670f34d21cbd859050111686f945b73f005a70d (patch)
tree3ca968e2a7f72326197808f1b991a4b29642bb32 /gdb/xcoffread.c
parent76512886f9d138f88e0c853a36681243aef32c64 (diff)
downloadgdb-2670f34d21cbd859050111686f945b73f005a70d.zip
gdb-2670f34d21cbd859050111686f945b73f005a70d.tar.gz
gdb-2670f34d21cbd859050111686f945b73f005a70d.tar.bz2
Relocate symbols using an array of section_offsets, rather than a
single `addr' or `offset'. This makes Solaris-2 support work, and permits better VxWorks (and maybe xcoff) support later. See ChangeLog.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 429fcc5..ddbf02c 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -45,6 +45,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
+#include "gdb-stabs.h"
#include "coff/internal.h" /* FIXME, internal data from BFD */
#include "libcoff.h" /* FIXME, internal data from BFD */
@@ -182,11 +183,14 @@ static void
aixcoff_new_init PARAMS ((struct objfile *));
static void
-aixcoff_symfile_read PARAMS ((struct objfile *, CORE_ADDR, int));
+aixcoff_symfile_read PARAMS ((struct objfile *, struct section_offset *, int));
static void
aixcoff_symfile_finish PARAMS ((struct objfile *));
+static struct section_offset *
+aixcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
+
static int
init_lineno PARAMS ((bfd *, long, int));
@@ -2238,9 +2242,9 @@ free_debugsection()
/* aixcoff version of symbol file read. */
static void
-aixcoff_symfile_read (objfile, addr, mainline)
+aixcoff_symfile_read (objfile, section_offset, mainline)
struct objfile *objfile;
- CORE_ADDR addr;
+ struct section_offset *section_offset;
int mainline;
{
int num_symbols; /* # of symbols */
@@ -2320,6 +2324,28 @@ aixcoff_symfile_read (objfile, addr, mainline)
select_source_symtab (0);
}
+/* XCOFF-specific parsing routine for section offsets.
+ Plain and simple for now. */
+
+static
+struct section_offsets *
+aixcoff_symfile_offsets (objfile, addr)
+ struct objfile *objfile;
+ CORE_ADDR addr;
+{
+ struct section_offsets *section_offsets;
+ int i;
+
+ section_offsets = (struct section_offsets *)
+ obstack_alloc (&objfile -> psymbol_obstack,
+ sizeof (struct section_offsets) +
+ sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
+
+ for (i = 0; i < SECT_OFF_MAX; i++)
+ ANOFFSET (section_offsets, i) = addr;
+
+ return section_offsets;
+}
/* Register our ability to parse symbols for aixcoff BFD files. */
static struct sym_fns aixcoff_sym_fns =
@@ -2330,6 +2356,7 @@ static struct sym_fns aixcoff_sym_fns =
aixcoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
aixcoff_symfile_read, /* sym_read: read a symbol file into symtab */
aixcoff_symfile_finish, /* sym_finish: finished with file, cleanup */
+ aixcoff_symfile_offsets, /* sym_offsets: xlate offsets ext->int form */
NULL /* next: pointer to next struct sym_fns */
};