This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

please help test section offsets change


Hi,

I'm in the process of cleaning up the use of section offsets in gdb.
My previous changes in this area were mostly just mechanical
transformations that did not change the actual functionality.  With my
latest patch, included below, there are some actual changes in the way
gdb stores and uses the section offsets.  In particular, psymtabs no
longer have their own pointer to section offsets that is simply a
pointer to the objfile section offsets array except apparently in one
very special case.

It is this special case I'm concerned about.  It's not completely
clear to me from the comments in the code, but I believe that the
case where the psymtab section offsets are not the same as the
objfile section offsets is when processing Suns implementation of
stabs-in-elf.  Right now my patches simply trigger an abort when
then run into the special case, and obviously this needs to be
fixed.

Note that the ChangeLog entry is incomplete at this time, pending
finalization of the changes.  This patch is not intended to be
something that is ready to be checked in, since it contains the
abort() for the code that apparently needed individual psymtab section
offsets, contains #if 0 ... #endif code that needs to be removed, and
has a couple of other changes that make it easier to uncover potential
problems but are not strictly necessary.

Thanks!

-Fred

Index: ChangeLog
===================================================================
RCS file: /cvs/gdb/gdb/gdb/ChangeLog,v
retrieving revision 1.1.1.22
diff -c -p -r1.1.1.22 ChangeLog
*** ChangeLog	1999/08/31 01:04:11	1.1.1.22
--- ChangeLog	1999/09/07 04:09:00
***************
*** 1,3 ****
--- 1,59 ----
+ 1999-08-15  Fred Fish  <fnf@cygnus.com>
+ 
+ 	* objfiles.c (objfile_relocate): Use SIZEOF_SECTION_OFFSETS when
+ 	allocating section_offsets array.
+ 	* remote-os9k.c (rombug_wait): Ditto.
+ 	* remote-vx.c (vx_add_symbols): Ditto.
+ 	* remote.c (get_offsets): Ditto.
+ 	(remote_cisco_objfile_relocate): Ditto.
+ 	* rs6000-nat.c (vmap_symtab): Ditto.
+ 
+ 	* dstread.c (dst_symfile_offsets): Set section_offsets directly instead
+ 	of returning a pointer to section offsets.
+ 	* somread.c (som_symfile_offsets): Ditto.
+ 	* xcoffread.c (xcoff_symfile_offsets): Ditto.
+ 	* symfile.c (default_symfile_offsets): Ditto.
+ 	(syms_from_objfile): The sym_offsets function has already set section
+ 	offsets and no longer returns a value.
+ 
+ 	* xcoffread.c (scan_xcoff_symtab): Eliminate section_offsets passed
+ 	separate from objfile.
+ 	(xcoff_start_psymtab): Ditto.
+ 	(START_PSYMTAB): Ditto.
+ 	* os9kread.c (read_minimal_symbols): Ditto.
+ 	(read_os9k_psymtab): Ditto.
+ 	(os9k_start_psymtab): Ditto.
+ 	(record_minimal_symbol): Ditto.
+ 	* dbxread.c (START_PSYMTAB): Ditto.
+ 	(start_psymtab): Ditto.
+ 	* mdebugread.c (START_PSYMTAB): Ditto.
+ 	(elfmdebug_build_psymtabs): Ditto.
+ 	(mdebug_build_psymtabs): Ditto.
+ 	(parse_partial_symbols): Ditto.
+ 	(new_psymtab): Ditto.
+ 	* dwarfread.c (dwarf_build_psymtabs): Ditto.
+ 	* partial-stab.h (START_PSYMTAB): Ditto.
+ 	* stabsread.h (start_psymtab): Ditto.
+ 	* dwarf2read.c (dwarf2_build_psymtabs): Ditto.
+ 	(dwarf2_build_psymtabs_easy): Ditto.
+ 	(dwarf2_build_psymtabs_hard): Ditto.
+ 	* hp-psymtab-read.c (hpread_build_psymtabs): Ditto.
+ 	(hpread_quick_traverse): Ditto.
+ 	(hpread_start_psymtab): Ditto.
+ 	(scan_procs): Ditto.
+ 	* hpread.c (hpread_build_psymtabs): Ditto.
+ 	* symfile.h (dwarf2_build_psymtabs): Ditto.
+ 
+ 	* dbxread.c (read_dbx_symtab): Use ANOFFSET to access section
+ 	offsets.
+ 	* coffread.c (enter_linenos): Pass objfile instead of section
+ 	offsets.
+ 
+ 	* dbxread.c (dbx_symfile_read): No need to explicitly pass
+ 	text addr and size.  Let read_dbx_symtab find them.
+ 	(read_dbx_symtab): Get text addr and size from objfile.
+ 	(dbx_symfile_read): Remove dead code (call to strlen);
+ 
  1999-08-30  Stan Shebs  <shebs@andros.cygnus.com>
  
  	* infrun.c (prepare_to_wait): New function, broken out from the
Index: coffread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/coffread.c,v
retrieving revision 1.1.1.8
diff -c -p -r1.1.1.8 coffread.c
*** coffread.c	1999/08/16 19:52:09	1.1.1.8
--- coffread.c	1999/09/07 04:09:21
*************** static void patch_opaque_types PARAMS ((
*** 201,207 ****
  
  static void patch_type PARAMS ((struct type *, struct type *));
  
! static void enter_linenos PARAMS ((long, int, int, struct section_offsets *));
  
  static void free_linetab PARAMS ((void));
  
--- 201,207 ----
  
  static void patch_type PARAMS ((struct type *, struct type *));
  
! static void enter_linenos PARAMS ((long, int, int, struct objfile *));
  
  static void free_linetab PARAMS ((void));
  
*************** coff_symtab_read (symtab_offset, nsyms, 
*** 1081,1087 ****
  			     fcn_first_line_addr);
  	      else
  		enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
! 			       objfile->section_offsets);
  
  	      finish_block (new->name, &local_symbols, new->old_blocks,
  			    new->start_addr,
--- 1081,1087 ----
  			     fcn_first_line_addr);
  	      else
  		enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
! 			       objfile);
  
  	      finish_block (new->name, &local_symbols, new->old_blocks,
  			    new->start_addr,
*************** free_linetab ()
*** 1389,1399 ****
  #endif
  
  static void
! enter_linenos (file_offset, first_line, last_line, section_offsets)
       long file_offset;
       register int first_line;
       register int last_line;
!      struct section_offsets *section_offsets;
  {
    register char *rawptr;
    struct internal_lineno lptr;
--- 1389,1399 ----
  #endif
  
  static void
! enter_linenos (file_offset, first_line, last_line, objfile)
       long file_offset;
       register int first_line;
       register int last_line;
!      struct objfile *objfile;
  {
    register char *rawptr;
    struct internal_lineno lptr;
*************** enter_linenos (file_offset, first_line, 
*** 1423,1429 ****
        if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
  	record_line (current_subfile, first_line + L_LNNO32 (&lptr),
  		     lptr.l_addr.l_paddr
! 		     + ANOFFSET (section_offsets, SECT_OFF_TEXT));
        else
  	break;
      }
--- 1423,1429 ----
        if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
  	record_line (current_subfile, first_line + L_LNNO32 (&lptr),
  		     lptr.l_addr.l_paddr
! 		     + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT));
        else
  	break;
      }
Index: dbxread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dbxread.c,v
retrieving revision 1.1.1.6
diff -c -p -r1.1.1.6 dbxread.c
*** dbxread.c	1999/08/09 21:33:22	1.1.1.6
--- dbxread.c	1999/09/07 04:09:51
*************** static void
*** 289,295 ****
  read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile));
  
  static void
! read_dbx_symtab PARAMS ((struct objfile *, CORE_ADDR, int));
  
  static void
  free_bincl_list PARAMS ((struct objfile *));
--- 289,295 ----
  read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile));
  
  static void
! read_dbx_symtab PARAMS ((struct objfile *));
  
  static void
  free_bincl_list PARAMS ((struct objfile *));
*************** add_old_header_file PARAMS ((char *, int
*** 333,338 ****
--- 333,342 ----
  static void
  add_this_object_header_file PARAMS ((int));
  
+ static struct partial_symtab *
+ start_psymtab PARAMS ((struct objfile *, char *, CORE_ADDR, int,
+ 		       struct partial_symbol **, struct partial_symbol **));
+ 
  /* Free up old header file tables */
  
  static void
*************** record_minimal_symbol (name, address, ty
*** 571,578 ****
     put all the relevant info into a "struct dbx_symfile_info",
     hung off the objfile structure.
  
-    SECTION_OFFSETS contains offsets relative to which the symbols in the
-    various sections are (depending where the sections were actually loaded).
     MAINLINE is true if we are reading the main symbol
     table (as opposed to a shared lib or dynamically loaded file).  */
  
--- 575,580 ----
*************** dbx_symfile_read (objfile, mainline)
*** 585,592 ****
    int val;
    struct cleanup *back_to;
  
-   val = strlen (objfile->name);
- 
    sym_bfd = objfile->obfd;
  
    /* .o and .nlm files are relocatables with text, data and bss segs based at
--- 587,592 ----
*************** dbx_symfile_read (objfile, mainline)
*** 625,636 ****
    init_minimal_symbol_collection ();
    make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
  
!   /* Now that the symbol table data of the executable file are all in core,
!      process them and define symbols accordingly.  */
  
!   read_dbx_symtab (objfile,
! 		   DBX_TEXT_ADDR (objfile),
! 		   DBX_TEXT_SIZE (objfile));
  
    /* Add the dynamic symbols.  */
  
--- 625,633 ----
    init_minimal_symbol_collection ();
    make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
  
!   /* Read stabs data from executable file and define symbols. */
  
!   read_dbx_symtab (objfile);
  
    /* Add the dynamic symbols.  */
  
*************** read_dbx_dynamic_symtab (objfile)
*** 1239,1259 ****
    do_cleanups (back_to);
  }
  
! /* Given pointers to an a.out symbol table in core containing dbx
!    style data, setup partial_symtab's describing each source file for
!    which debugging information is available.
!    SYMFILE_NAME is the name of the file we are reading from
!    and SECTION_OFFSETS is the set of offsets for the various sections
!    of the file (a set of zeros if the mainline program).  */
  
  static void
! read_dbx_symtab (objfile, text_addr, text_size)
       struct objfile *objfile;
-      CORE_ADDR text_addr;
-      int text_size;
  {
    register struct external_nlist *bufp = 0;	/* =0 avoids gcc -Wall glitch */
    struct internal_nlist nlist;
  
    register char *namestring;
    int nsl;
--- 1236,1252 ----
    do_cleanups (back_to);
  }
  
! /* Setup partial_symtab's describing each source file for which
!    debugging information is available. */
  
  static void
! read_dbx_symtab (objfile)
       struct objfile *objfile;
  {
    register struct external_nlist *bufp = 0;	/* =0 avoids gcc -Wall glitch */
    struct internal_nlist nlist;
+   CORE_ADDR text_addr;
+   int text_size;
  
    register char *namestring;
    int nsl;
*************** read_dbx_symtab (objfile, text_addr, tex
*** 1276,1281 ****
--- 1269,1277 ----
    struct partial_symtab **dependency_list;
    int dependencies_used, dependencies_allocated;
  
+   text_addr = DBX_TEXT_ADDR (objfile);
+   text_size = DBX_TEXT_SIZE (objfile);
+ 
    /* FIXME.  We probably want to change stringtab_global rather than add this
       while processing every symbol entry.  FIXME.  */
    file_string_table_offset = 0;
*************** read_dbx_symtab (objfile, text_addr, tex
*** 1361,1368 ****
  #define CUR_SYMBOL_VALUE nlist.n_value
  #define CUR_SYMBOL_STRX nlist.n_strx
  #define DBXREAD_ONLY
! #define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
!   start_psymtab(ofile, secoff, fname, low, symoff, global_syms, static_syms)
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
    end_psymtab(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)
  
--- 1357,1364 ----
  #define CUR_SYMBOL_VALUE nlist.n_value
  #define CUR_SYMBOL_STRX nlist.n_strx
  #define DBXREAD_ONLY
! #define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms)\
!   start_psymtab(ofile, fname, low, symoff, global_syms, static_syms)
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
    end_psymtab(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)
  
*************** read_dbx_symtab (objfile, text_addr, tex
*** 1385,1391 ****
        /* Don't set pst->texthigh lower than it already is.  */
        CORE_ADDR text_end =
        (lowest_text_address == (CORE_ADDR) -1
!        ? (text_addr + objfile->section_offsets->offsets[SECT_OFF_TEXT])
         : lowest_text_address)
        + text_size;
  
--- 1381,1387 ----
        /* Don't set pst->texthigh lower than it already is.  */
        CORE_ADDR text_end =
        (lowest_text_address == (CORE_ADDR) -1
!        ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT))
         : lowest_text_address)
        + text_size;
  
*************** read_dbx_symtab (objfile, text_addr, tex
*** 1406,1416 ****
     (normal). */
  
  
! struct partial_symtab *
! start_psymtab (objfile, section_offsets,
! 	       filename, textlow, ldsymoff, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
--- 1402,1410 ----
     (normal). */
  
  
! static struct partial_symtab *
! start_psymtab (objfile, filename, textlow, ldsymoff, global_syms, static_syms)
       struct objfile *objfile;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
*************** start_psymtab (objfile, section_offsets,
*** 1418,1425 ****
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, section_offsets,
! 			filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
--- 1412,1418 ----
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
*************** end_psymtab (pst, include_list, num_incl
*** 1563,1569 ****
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
!       subpst->section_offsets = pst->section_offsets;
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
--- 1556,1564 ----
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
! #if 0
!       subpst->psymtab_section_offsets = pst->psymtab_section_offsets;
! #endif
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
*************** read_ofile_symtab (pst)
*** 1736,1749 ****
    int sym_size;			/* Size of symbols to read */
    CORE_ADDR text_offset;	/* Start of text segment for symbols */
    int text_size;		/* Size of text segment for symbols */
-   struct section_offsets *section_offsets;
  
    objfile = pst->objfile;
    sym_offset = LDSYMOFF (pst);
    sym_size = LDSYMLEN (pst);
    text_offset = pst->textlow;
    text_size = pst->texthigh - pst->textlow;
-   section_offsets = pst->section_offsets;
  
    current_objfile = objfile;
    subfile_stack = NULL;
--- 1731,1742 ----
*************** read_ofile_symtab (pst)
*** 1832,1838 ****
        if (type & N_STAB)
  	{
  	  process_one_symbol (type, nlist.n_desc, nlist.n_value,
! 			      namestring, section_offsets, objfile);
  	}
        /* We skip checking for a new .o or -l file; that should never
           happen in this routine. */
--- 1825,1831 ----
        if (type & N_STAB)
  	{
  	  process_one_symbol (type, nlist.n_desc, nlist.n_value,
! 			      namestring, objfile);
  	}
        /* We skip checking for a new .o or -l file; that should never
           happen in this routine. */
*************** read_ofile_symtab (pst)
*** 1902,1920 ****
     DESC is the desc field of the ".stab" entry.
     VALU is the value field of the ".stab" entry.
     NAME is the symbol name, in our address space.
-    SECTION_OFFSETS is a set of amounts by which the sections of this object
-    file were relocated when it was loaded into memory.
-    All symbols that refer
-    to memory locations need to be offset by these amounts.
     OBJFILE is the object file from which we are reading symbols.
     It is used in end_symtab.  */
  
  void
! process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       int type, desc;
       CORE_ADDR valu;
       char *name;
-      struct section_offsets *section_offsets;
       struct objfile *objfile;
  {
  #ifdef SUN_FIXED_LBRAC_BUG
--- 1895,1908 ----
     DESC is the desc field of the ".stab" entry.
     VALU is the value field of the ".stab" entry.
     NAME is the symbol name, in our address space.
     OBJFILE is the object file from which we are reading symbols.
     It is used in end_symtab.  */
  
  void
! process_one_symbol (type, desc, valu, name, objfile)
       int type, desc;
       CORE_ADDR valu;
       char *name;
       struct objfile *objfile;
  {
  #ifdef SUN_FIXED_LBRAC_BUG
*************** process_one_symbol (type, desc, valu, na
*** 1947,1953 ****
    if (!block_address_function_relative)
      /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
         function start address, so just use the text offset.  */
!     function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
  
    /* Something is wrong if we see real data before
       seeing a source file name.  */
--- 1935,1941 ----
    if (!block_address_function_relative)
      /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
         function start address, so just use the text offset.  */
!     function_start_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  
    /* Something is wrong if we see real data before
       seeing a source file name.  */
*************** process_one_symbol (type, desc, valu, na
*** 1987,1993 ****
  	}
  
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  #ifdef SMASH_TEXT_ADDRESS
        SMASH_TEXT_ADDRESS (valu);
  #endif
--- 1975,1981 ----
  	}
  
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  #ifdef SMASH_TEXT_ADDRESS
        SMASH_TEXT_ADDRESS (valu);
  #endif
*************** process_one_symbol (type, desc, valu, na
*** 2095,2101 ****
      case N_FN_SEQ:
        /* This kind of symbol indicates the start of an object file.  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        break;
  
      case N_SO:
--- 2083,2089 ----
      case N_FN_SEQ:
        /* This kind of symbol indicates the start of an object file.  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        break;
  
      case N_SO:
*************** process_one_symbol (type, desc, valu, na
*** 2104,2110 ****
           Finish the symbol table of the previous source file
           (if any) and start accumulating a new symbol table.  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  
        n_opt_found = 0;
  
--- 2092,2098 ----
           Finish the symbol table of the previous source file
           (if any) and start accumulating a new symbol table.  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  
        n_opt_found = 0;
  
*************** process_one_symbol (type, desc, valu, na
*** 2154,2160 ****
           included in the compilation of the main source file
           (whose name was given in the N_SO symbol.)  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        start_subfile (name, current_subfile->dirname);
        break;
  
--- 2142,2148 ----
           included in the compilation of the main source file
           (whose name was given in the N_SO symbol.)  */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        start_subfile (name, current_subfile->dirname);
        break;
  
*************** process_one_symbol (type, desc, valu, na
*** 2232,2238 ****
  		   elfstab_offset_sections ever starts dealing with the
  		   text offset, and we still need to do this, we need to
  		   invent a SECT_OFF_ADDR_KLUDGE or something.  */
! 		valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  		goto define_a_symbol;
  	      }
  	  }
--- 2220,2226 ----
  		   elfstab_offset_sections ever starts dealing with the
  		   text offset, and we still need to do this, we need to
  		   invent a SECT_OFF_ADDR_KLUDGE or something.  */
! 		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  		goto define_a_symbol;
  	      }
  	  }
*************** process_one_symbol (type, desc, valu, na
*** 2252,2273 ****
  
      case_N_STSYM:		/* Static symbol in data seg */
      case N_DSLINE:		/* Source line number, data seg */
!       valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
        goto define_a_symbol;
  
      case_N_LCSYM:		/* Static symbol in BSS seg */
      case N_BSLINE:		/* Source line number, bss seg */
        /*   N_BROWS:       overlaps with N_BSLINE */
!       valu += ANOFFSET (section_offsets, SECT_OFF_BSS);
        goto define_a_symbol;
  
      case_N_ROSYM:		/* Static symbol in Read-only data seg */
!       valu += ANOFFSET (section_offsets, SECT_OFF_RODATA);
        goto define_a_symbol;
  
      case N_ENTRY:		/* Alternate entry point */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        goto define_a_symbol;
  
        /* The following symbol types we don't know how to process.  Handle
--- 2240,2261 ----
  
      case_N_STSYM:		/* Static symbol in data seg */
      case N_DSLINE:		/* Source line number, data seg */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
        goto define_a_symbol;
  
      case_N_LCSYM:		/* Static symbol in BSS seg */
      case N_BSLINE:		/* Source line number, bss seg */
        /*   N_BROWS:       overlaps with N_BSLINE */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
        goto define_a_symbol;
  
      case_N_ROSYM:		/* Static symbol in Read-only data seg */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_RODATA);
        goto define_a_symbol;
  
      case N_ENTRY:		/* Alternate entry point */
        /* Relocate for dynamic loading */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        goto define_a_symbol;
  
        /* The following symbol types we don't know how to process.  Handle
*************** process_one_symbol (type, desc, valu, na
*** 2319,2325 ****
  	      /* Deal with the SunPRO 3.0 compiler which omits the address
  	         from N_FUN symbols.  */
  	      if (type == N_FUN
! 		  && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT))
  		{
  		  struct minimal_symbol *msym;
  		  char *p;
--- 2307,2313 ----
  	      /* Deal with the SunPRO 3.0 compiler which omits the address
  	         from N_FUN symbols.  */
  	      if (type == N_FUN
! 		  && valu == ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT))
  		{
  		  struct minimal_symbol *msym;
  		  char *p;
Index: dstread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dstread.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 dstread.c
*** dstread.c	1999/08/09 21:33:23	1.1.1.3
--- dstread.c	1999/09/07 04:10:01
*************** init_dst_sections (chan)
*** 1638,1650 ****
  struct section_offsets dst_symfile_faker =
  {0};
  
! struct section_offsets *
  dst_symfile_offsets (objfile, addr)
       struct objfile *objfile;
       CORE_ADDR addr;
  {
    objfile->num_sections = 1;
!   return &dst_symfile_faker;
  }
  
  /* Register our ability to parse symbols for DST BFD files */
--- 1638,1650 ----
  struct section_offsets dst_symfile_faker =
  {0};
  
! void
  dst_symfile_offsets (objfile, addr)
       struct objfile *objfile;
       CORE_ADDR addr;
  {
    objfile->num_sections = 1;
!   objfile->section_offsets = &dst_symfile_faker;
  }
  
  /* Register our ability to parse symbols for DST BFD files */
Index: dwarf2read.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dwarf2read.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 dwarf2read.c
*** dwarf2read.c	1999/08/09 21:33:23	1.1.1.5
--- dwarf2read.c	1999/09/07 04:11:39
*************** extern int info_verbose;	/* From main.c;
*** 563,576 ****
  static void dwarf2_locate_sections PARAMS ((bfd *, asection *, PTR));
  
  #if 0
! static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *,
! 						struct section_offsets *,
! 						int));
  #endif
  
! static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *,
! 						struct section_offsets *,
! 						int));
  
  static char *scan_partial_symbols PARAMS ((char *, struct objfile *,
  					   CORE_ADDR *, CORE_ADDR *));
--- 563,572 ----
  static void dwarf2_locate_sections PARAMS ((bfd *, asection *, PTR));
  
  #if 0
! static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *, int));
  #endif
  
! static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *, int));
  
  static char *scan_partial_symbols PARAMS ((char *, struct objfile *,
  					   CORE_ADDR *, CORE_ADDR *));
*************** dwarf2_locate_sections (ignore_abfd, sec
*** 840,848 ****
  /* Build a partial symbol table.  */
  
  void
! dwarf2_build_psymtabs (objfile, section_offsets, mainline)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
  {
  
--- 836,843 ----
  /* Build a partial symbol table.  */
  
  void
! dwarf2_build_psymtabs (objfile, mainline)
       struct objfile *objfile;
       int mainline;
  {
  
*************** dwarf2_build_psymtabs (objfile, section_
*** 867,883 ****
  #if 0
    if (dwarf_aranges_offset && dwarf_pubnames_offset)
      {
!       /* Things are significanlty easier if we have .debug_aranges and
           .debug_pubnames sections */
  
!       dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline);
      }
    else
  #endif
      /* only test this case for now */
      {
        /* In this case we have to work a bit harder */
!       dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline);
      }
  }
  
--- 862,878 ----
  #if 0
    if (dwarf_aranges_offset && dwarf_pubnames_offset)
      {
!       /* Things are significantly easier if we have .debug_aranges and
           .debug_pubnames sections */
  
!       dwarf2_build_psymtabs_easy (objfile, mainline);
      }
    else
  #endif
      /* only test this case for now */
      {
        /* In this case we have to work a bit harder */
!       dwarf2_build_psymtabs_hard (objfile, mainline);
      }
  }
  
*************** dwarf2_build_psymtabs (objfile, section_
*** 886,894 ****
     .debug_pubnames and .debug_aranges sections.  */
  
  static void
! dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
  {
    bfd *abfd = objfile->obfd;
--- 881,888 ----
     .debug_pubnames and .debug_aranges sections.  */
  
  static void
! dwarf2_build_psymtabs_easy (objfile, mainline)
       struct objfile *objfile;
       int mainline;
  {
    bfd *abfd = objfile->obfd;
*************** dwarf2_build_psymtabs_easy (objfile, sec
*** 923,931 ****
     .debug_info and .debug_abbrev sections.  */
  
  static void
! dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
  {
    /* Instead of reading this into a big buffer, we should probably use
--- 917,924 ----
     .debug_info and .debug_abbrev sections.  */
  
  static void
! dwarf2_build_psymtabs_hard (objfile, mainline)
       struct objfile *objfile;
       int mainline;
  {
    /* Instead of reading this into a big buffer, we should probably use
*************** dwarf2_build_psymtabs_hard (objfile, sec
*** 1002,1008 ****
        set_cu_language (comp_unit_die.language);
  
        /* Allocate a new partial symbol table structure */
!       pst = start_psymtab_common (objfile, section_offsets,
  				  comp_unit_die.name ? comp_unit_die.name : "",
  				  comp_unit_die.lowpc,
  				  objfile->global_psymbols.next,
--- 995,1001 ----
        set_cu_language (comp_unit_die.language);
  
        /* Allocate a new partial symbol table structure */
!       pst = start_psymtab_common (objfile,
  				  comp_unit_die.name ? comp_unit_die.name : "",
  				  comp_unit_die.lowpc,
  				  objfile->global_psymbols.next,
*************** dwarf2_build_psymtabs_hard (objfile, sec
*** 1016,1022 ****
        DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
        DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
        DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
!       baseaddr = ANOFFSET (section_offsets, 0);
  
        /* Store the function that reads in the rest of the symbol table */
        pst->read_symtab = dwarf2_psymtab_to_symtab;
--- 1009,1015 ----
        DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
        DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
        DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
!       baseaddr = ANOFFSET (objfile->section_offsets, 0);
  
        /* Store the function that reads in the rest of the symbol table */
        pst->read_symtab = dwarf2_psymtab_to_symtab;
*************** psymtab_to_symtab_1 (pst)
*** 1319,1325 ****
    dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst);
    dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst);
    dwarf_line_buffer = DWARF_LINE_BUFFER (pst);
!   baseaddr = ANOFFSET (pst->section_offsets, 0);
    cu_header_offset = offset;
    info_ptr = dwarf_info_buffer + offset;
  
--- 1312,1318 ----
    dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst);
    dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst);
    dwarf_line_buffer = DWARF_LINE_BUFFER (pst);
!   baseaddr = ANOFFSET (objfile->section_offsets, 0);
    cu_header_offset = offset;
    info_ptr = dwarf_info_buffer + offset;
  
Index: dwarfread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dwarfread.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 dwarfread.c
*** dwarfread.c	1999/08/02 23:45:24	1.1.1.4
--- dwarfread.c	1999/09/07 04:12:15
*************** static char *lnbase;		/* Base pointer to
*** 347,356 ****
     pass the appropriate section number to end_symtab).  */
  static CORE_ADDR baseaddr;	/* Add to each symbol value */
  
- /* The section offsets used in the current psymtab or symtab.  FIXME,
-    only used to pass one value (baseaddr) at the moment.  */
- static struct section_offsets *base_section_offsets;
- 
  /* We put a pointer to this structure in the read_symtab_private field
     of the psymtab.  */
  
--- 347,352 ----
*************** set_cu_language (dip)
*** 704,710 ****
     SYNOPSIS
  
     void dwarf_build_psymtabs (struct objfile *objfile,
-    struct section_offsets *section_offsets,
     int mainline, file_ptr dbfoff, unsigned int dbfsize,
     file_ptr lnoffset, unsigned int lnsize)
  
--- 700,705 ----
*************** set_cu_language (dip)
*** 728,737 ****
   */
  
  void
! dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
  		      lnoffset, lnsize)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
       file_ptr dbfoff;
       unsigned int dbfsize;
--- 723,731 ----
   */
  
  void
! dwarf_build_psymtabs (objfile, mainline, dbfoff, dbfsize,
  		      lnoffset, lnsize)
       struct objfile *objfile;
       int mainline;
       file_ptr dbfoff;
       unsigned int dbfsize;
*************** dwarf_build_psymtabs (objfile, section_o
*** 765,772 ****
  
    /* Save the relocation factor where everybody can see it.  */
  
!   base_section_offsets = section_offsets;
!   baseaddr = ANOFFSET (section_offsets, 0);
  
    /* Follow the compilation unit sibling chain, building a partial symbol
       table entry for each one.  Save enough information about each compilation
--- 759,765 ----
  
    /* Save the relocation factor where everybody can see it.  */
  
!   baseaddr = ANOFFSET (objfile->section_offsets, 0);
  
    /* Follow the compilation unit sibling chain, building a partial symbol
       table entry for each one.  Save enough information about each compilation
*************** read_ofile_symtab (pst)
*** 2358,2365 ****
    dbbase = xmalloc (dbsize);
    dbroff = DBROFF (pst);
    foffset = DBFOFF (pst) + dbroff;
!   base_section_offsets = pst->section_offsets;
!   baseaddr = ANOFFSET (pst->section_offsets, 0);
    if (bfd_seek (abfd, foffset, SEEK_SET) ||
        (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
      {
--- 2351,2357 ----
    dbbase = xmalloc (dbsize);
    dbroff = DBROFF (pst);
    foffset = DBFOFF (pst) + dbroff;
!   baseaddr = ANOFFSET (pst->objfile->section_offsets, 0);
    if (bfd_seek (abfd, foffset, SEEK_SET) ||
        (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
      {
*************** scan_compilation_units (thisdie, enddie,
*** 2896,2902 ****
  
  	  /* First allocate a new partial symbol table structure */
  
! 	  pst = start_psymtab_common (objfile, base_section_offsets,
  				      di.at_name, di.at_low_pc,
  				      objfile->global_psymbols.next,
  				      objfile->static_psymbols.next);
--- 2888,2894 ----
  
  	  /* First allocate a new partial symbol table structure */
  
! 	  pst = start_psymtab_common (objfile,
  				      di.at_name, di.at_low_pc,
  				      objfile->global_psymbols.next,
  				      objfile->static_psymbols.next);
Index: elfread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/elfread.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 elfread.c
*** elfread.c	1999/08/09 21:33:25	1.1.1.4
--- elfread.c	1999/09/07 04:12:22
*************** elf_symtab_read (abfd, addr, objfile, dy
*** 491,497 ****
  				    (char *) filesym->name;
  				}
  			    }
! 			  if (sectinfo->sections[index] != 0)
  			    {
  			      complain (&section_info_dup_complaint,
  					sectinfo->filename);
--- 491,497 ----
  				    (char *) filesym->name;
  				}
  			    }
! 			  if (sectinfo->stabs_section_offsets[index] != 0)
  			    {
  			      complain (&section_info_dup_complaint,
  					sectinfo->filename);
*************** elf_symtab_read (abfd, addr, objfile, dy
*** 503,509 ****
  			    {
  			      symaddr += addr;
  			    }
! 			  sectinfo->sections[index] = symaddr;
  			  /* The special local symbols don't go in the
  			     minimal symbol table, so ignore this one. */
  			  continue;
--- 503,509 ----
  			    {
  			      symaddr += addr;
  			    }
! 			  sectinfo->stabs_section_offsets[index] = symaddr;
  			  /* The special local symbols don't go in the
  			     minimal symbol table, so ignore this one. */
  			  continue;
*************** elf_symfile_read (objfile, mainline)
*** 651,658 ****
           information.  */
        swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
        if (swap)
! 	elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect,
! 				  objfile->section_offsets);
      }
    if (ei.stabsect)
      {
--- 651,657 ----
           information.  */
        swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
        if (swap)
! 	elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect);
      }
    if (ei.stabsect)
      {
*************** elf_symfile_read (objfile, mainline)
*** 674,686 ****
    if (dwarf2_has_info (abfd))
      {
        /* DWARF 2 sections */
!       dwarf2_build_psymtabs (objfile, objfile->section_offsets, mainline);
      }
    else if (ei.dboffset && ei.lnoffset)
      {
        /* DWARF sections */
        dwarf_build_psymtabs (objfile,
! 			    objfile->section_offsets, mainline,
  			    ei.dboffset, ei.dbsize,
  			    ei.lnoffset, ei.lnsize);
      }
--- 673,685 ----
    if (dwarf2_has_info (abfd))
      {
        /* DWARF 2 sections */
!       dwarf2_build_psymtabs (objfile, mainline);
      }
    else if (ei.dboffset && ei.lnoffset)
      {
        /* DWARF sections */
        dwarf_build_psymtabs (objfile,
! 			    mainline,
  			    ei.dboffset, ei.dbsize,
  			    ei.lnoffset, ei.lnsize);
      }
*************** elfstab_offset_sections (objfile, pst)
*** 813,825 ****
  
    if (maybe)
      {
        /* Found it!  Allocate a new psymtab struct, and fill it in.  */
        maybe->found++;
!       pst->section_offsets = (struct section_offsets *)
  	obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
        for (i = 0; i < SECT_OFF_MAX; i++)
! 	ANOFFSET (pst->section_offsets, i) = maybe->sections[i];
        return;
      }
  
    /* We were unable to find any offsets for this file.  Complain.  */
--- 812,828 ----
  
    if (maybe)
      {
+ #if 0
        /* Found it!  Allocate a new psymtab struct, and fill it in.  */
        maybe->found++;
!       pst->psymtab_section_offsets = (struct section_offsets *)
  	obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
        for (i = 0; i < SECT_OFF_MAX; i++)
! 	ANOFFSET (pst->psymtab_section_offsets, i) = maybe->stabs_section_offsets[i];
        return;
+ #else
+       abort ();
+ #endif
      }
  
    /* We were unable to find any offsets for this file.  Complain.  */
Index: gdb-stabs.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/gdb-stabs.h,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 gdb-stabs.h
*** gdb-stabs.h	1999/07/07 20:06:11	1.1.1.2
--- gdb-stabs.h	1999/09/07 04:12:23
***************
*** 47,53 ****
  struct stab_section_info
    {
      char *filename;
!     CORE_ADDR sections[SECT_OFF_MAX];
      struct stab_section_info *next;
      int found;			/* Count of times it's found in searching */
    };
--- 47,53 ----
  struct stab_section_info
    {
      char *filename;
!     CORE_ADDR stabs_section_offsets[SECT_OFF_MAX];
      struct stab_section_info *next;
      int found;			/* Count of times it's found in searching */
    };
Index: hp-psymtab-read.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/hp-psymtab-read.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 hp-psymtab-read.c
*** hp-psymtab-read.c	1999/08/31 01:05:04	1.1.1.4
--- hp-psymtab-read.c	1999/09/07 04:13:02
*************** void
*** 45,51 ****
  do_pxdb PARAMS ((bfd *));
  
  void hpread_build_psymtabs
!   PARAMS ((struct objfile *, struct section_offsets *, int));
  
  void hpread_symfile_finish
    PARAMS ((struct objfile *));
--- 45,51 ----
  do_pxdb PARAMS ((bfd *));
  
  void hpread_build_psymtabs
!   PARAMS ((struct objfile *, int));
  
  void hpread_symfile_finish
    PARAMS ((struct objfile *));
*************** static unsigned long hpread_get_textlow
*** 57,63 ****
    PARAMS ((int, int, struct objfile *, int));
  
  static struct partial_symtab *hpread_start_psymtab
!   PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  static struct partial_symtab *hpread_end_psymtab
--- 57,63 ----
    PARAMS ((int, int, struct objfile *, int));
  
  static struct partial_symtab *hpread_start_psymtab
!   PARAMS ((struct objfile *, char *, CORE_ADDR, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  static struct partial_symtab *hpread_end_psymtab
*************** find_next_module_isym (index, qMD, curr_
*** 516,522 ****
     organized in a separate routine, although it does take lots of arguments. pai/1997-10-08 */
  
  static int
! scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile, section_offsets)
       int *curr_pd_p;		/* pointer to current proc index */
       quick_procedure_entry *qPD;	/* the procedure quick lookup table */
       int max_procs;		/* number of entries in proc. table */
--- 516,522 ----
     organized in a separate routine, although it does take lots of arguments. pai/1997-10-08 */
  
  static int
! scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile)
       int *curr_pd_p;		/* pointer to current proc index */
       quick_procedure_entry *qPD;	/* the procedure quick lookup table */
       int max_procs;		/* number of entries in proc. table */
*************** scan_procs (curr_pd_p, qPD, max_procs, s
*** 525,531 ****
       struct partial_symtab *pst;	/* current psymtab */
       char *vt_bits;		/* strings table of SOM debug space */
       struct objfile *objfile;	/* current object file */
-      struct section_offsets *section_offsets;	/* not really used for HP-UX currently */
  {
    union dnttentry *dn_bufp;
    int symbol_count = 0;		/* Total number of symbols in this psymtab */
--- 525,530 ----
*************** scan_procs (curr_pd_p, qPD, max_procs, s
*** 602,608 ****
  					   LOC_BLOCK,	/* "I am a routine"        */
  					   &objfile->global_psymbols,
  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
! 				 ANOFFSET (section_offsets, SECT_OFF_TEXT)),
  					   0,	/* core addr?? */
  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
  					   objfile);
--- 601,607 ----
  					   LOC_BLOCK,	/* "I am a routine"        */
  					   &objfile->global_psymbols,
  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
! 				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
  					   0,	/* core addr?? */
  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
  					   objfile);
*************** scan_procs (curr_pd_p, qPD, max_procs, s
*** 615,621 ****
  					   LOC_BLOCK,	/* "I am a routine"        */
  					   &objfile->static_psymbols,
  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
! 				 ANOFFSET (section_offsets, SECT_OFF_TEXT)),
  					   0,	/* core addr?? */
  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
  					   objfile);
--- 614,620 ----
  					   LOC_BLOCK,	/* "I am a routine"        */
  					   &objfile->static_psymbols,
  					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
! 				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
  					   0,	/* core addr?? */
  		      trans_lang ((enum hp_language) qPD[curr_pd].language),
  					   objfile);
*************** scan_procs (curr_pd_p, qPD, max_procs, s
*** 647,655 ****
     entry for it, so in such cases we create a psymtab for the file.  */
  
  int
! hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header_p)
       struct objfile *objfile;	/* The object file descriptor */
-      struct section_offsets *section_offsets;	/* ?? Null for HP */
       char *gntt_bits;		/* GNTT entries, loaded in from the file */
       char *vt_bits;		/* VT (string) entries ditto. */
       PXDB_header_ptr pxdb_header_p;	/* Pointer to pxdb header ditto */
--- 646,653 ----
     entry for it, so in such cases we create a psymtab for the file.  */
  
  int
! hpread_quick_traverse (objfile, gntt_bits, vt_bits, pxdb_header_p)
       struct objfile *objfile;	/* The object file descriptor */
       char *gntt_bits;		/* GNTT entries, loaded in from the file */
       char *vt_bits;		/* VT (string) entries ditto. */
       PXDB_header_ptr pxdb_header_p;	/* Pointer to pxdb header ditto */
*************** hpread_quick_traverse (objfile, section_
*** 862,868 ****
  	     might help.  */
  
  	  pst = hpread_start_psymtab (objfile,
- 				      section_offsets,	/* ?? */
  				      mod_name_string,
  				      CURR_MODULE_START,	/* Low text address: bogus! */
  		       (CURR_MODULE_ISYM * sizeof (struct dntt_type_block)),
--- 860,865 ----
*************** hpread_quick_traverse (objfile, section_
*** 964,970 ****
  	         And it's not even the right byte offset, as we're using
  	         the size of a union! FIXME!  */
  	      pst = hpread_start_psymtab (objfile,
- 					  section_offsets,	/* ?? */
  					  full_name_string,
  					  start_adr,	/* Low text address */
  			      (start_sym * sizeof (struct dntt_type_block)),
--- 961,966 ----
*************** hpread_quick_traverse (objfile, section_
*** 980,987 ****
  	         file, based on the starting addresses. */
  
  	      syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 					start_adr, end_adr,
! 				    pst, vt_bits, objfile, section_offsets);
  
  	      /* Get ending symbol offset */
  
--- 976,982 ----
  	         file, based on the starting addresses. */
  
  	      syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 					start_adr, end_adr, pst, vt_bits, objfile);
  
  	      /* Get ending symbol offset */
  
*************** hpread_quick_traverse (objfile, section_
*** 1194,1200 ****
  	         And it's not even the right byte offset, as we're using
  	         the size of a union! FIXME!  */
  	      pst = hpread_start_psymtab (objfile,
- 					  section_offsets,	/* ?? */
  					  full_name_string,
  					  start_adr,	/* Low text address */
  			      (start_sym * sizeof (struct dntt_type_block)),
--- 1189,1194 ----
*************** hpread_quick_traverse (objfile, section_
*** 1210,1217 ****
  	         module, based on the starting addresses. */
  
  	      syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 					start_adr, end_adr,
! 				    pst, vt_bits, objfile, section_offsets);
  
  	      /* Get ending symbol offset */
  
--- 1204,1210 ----
  	         module, based on the starting addresses. */
  
  	      syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 					start_adr, end_adr, pst, vt_bits, objfile);
  
  	      /* Get ending symbol offset */
  
*************** hpread_quick_traverse (objfile, section_
*** 1308,1314 ****
  	}
  #endif
        pst = hpread_start_psymtab (objfile,
- 				  section_offsets,	/* ?? */
  				  "orphans",
  				  start_adr,	/* Low text address */
  			 (CURR_PROC_ISYM * sizeof (struct dntt_type_block)),
--- 1301,1306 ----
*************** hpread_quick_traverse (objfile, section_
*** 1317,1324 ****
  				  static_syms);
  
        scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 		  start_adr, end_adr,
! 		  pst, vt_bits, objfile, section_offsets);
  
        pst = hpread_end_psymtab (pst,
  				NULL,	/* psymtab_include_list */
--- 1309,1315 ----
  				  static_syms);
  
        scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
! 		  start_adr, end_adr, pst, vt_bits, objfile);
  
        pst = hpread_end_psymtab (pst,
  				NULL,	/* psymtab_include_list */
*************** hpread_quick_traverse (objfile, section_
*** 1340,1346 ****
       If null psts were kept on the chain, this would be
       a solution.  FIXME */
    pst = hpread_start_psymtab (objfile,
- 			      section_offsets,
  			      "globals",
  			      0,
  			      (pxdb_header_p->globals
--- 1331,1336 ----
*************** hpread_symfile_init (objfile)
*** 1578,1591 ****
     We assume hpread_symfile_init has been called to initialize the
     symbol reader's private data structures.
  
-    SECTION_OFFSETS contains offsets relative to which the symbols in the
-    various sections are (depending where the sections were actually loaded).
     MAINLINE is true if we are reading the main symbol table (as
     opposed to a shared lib or dynamically loaded file). */
  void
! hpread_build_psymtabs (objfile, section_offsets, mainline)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
  {
  
--- 1568,1579 ----
     We assume hpread_symfile_init has been called to initialize the
     symbol reader's private data structures.
  
     MAINLINE is true if we are reading the main symbol table (as
     opposed to a shared lib or dynamically loaded file). */
+ 
  void
! hpread_build_psymtabs (objfile, mainline)
       struct objfile *objfile;
       int mainline;
  {
  
*************** hpread_build_psymtabs (objfile, section_
*** 1679,1685 ****
  	   not found we give up on the quick table stuff, 
  	   and fall back on the slower method  */
  	found_modules_in_program = hpread_quick_traverse (objfile,
- 							  section_offsets,
  							  GNTT (objfile),
  							  VT (objfile),
  							  &pxdb_header);
--- 1667,1672 ----
*************** hpread_build_psymtabs (objfile, section_
*** 1829,1836 ****
  		  past_first_source_file = 1;
  
  		valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
! 		valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
! 		pst = hpread_start_psymtab (objfile, section_offsets,
  					    namestring, valu,
  					    (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 1816,1823 ----
  		  past_first_source_file = 1;
  
  		valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
! 		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
! 		pst = hpread_start_psymtab (objfile,
  					    namestring, valu,
  					    (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 1863,1872 ****
  	      /* Now begin a new module and a new psymtab for it */
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
! 	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile, section_offsets,
  					      namestring, valu,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 1850,1859 ----
  	      /* Now begin a new module and a new psymtab for it */
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
! 	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile,
  					      namestring, valu,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 1881,1892 ****
  	    case DNTT_TYPE_ENTRY:
  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
  	         a secondary entry point.  */
! 	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
  						       SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->dfunc.lowaddr +
! 		ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (dn_bufp->dfunc.global)
  		add_psymbol_to_list (namestring, strlen (namestring),
--- 1868,1879 ----
  	    case DNTT_TYPE_ENTRY:
  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
  	         a secondary entry point.  */
! 	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
  						       SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->dfunc.lowaddr +
! 		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (dn_bufp->dfunc.global)
  		add_psymbol_to_list (namestring, strlen (namestring),
*************** hpread_build_psymtabs (objfile, section_
*** 1902,1913 ****
  	      continue;
  
  	    case DNTT_TYPE_DOC_FUNCTION:
! 	      valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (section_offsets,
  							  SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->ddocfunc.lowaddr +
! 		ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (dn_bufp->ddocfunc.global)
  		add_psymbol_to_list (namestring, strlen (namestring),
--- 1889,1900 ----
  	      continue;
  
  	    case DNTT_TYPE_DOC_FUNCTION:
! 	      valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (objfile->section_offsets,
  							  SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->ddocfunc.lowaddr +
! 		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (dn_bufp->ddocfunc.global)
  		add_psymbol_to_list (namestring, strlen (namestring),
*************** hpread_build_psymtabs (objfile, section_
*** 1985,1991 ****
  		SET_NAMESTRING (dn_bufp, &namestring, objfile);
  		if (!pst)
  		  {
! 		    pst = hpread_start_psymtab (objfile, section_offsets,
  						"globals", 0,
  						(hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 1972,1978 ----
  		SET_NAMESTRING (dn_bufp, &namestring, objfile);
  		if (!pst)
  		  {
! 		    pst = hpread_start_psymtab (objfile,
  						"globals", 0,
  						(hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 1997,2003 ****
  		valu = dn_bufp->dsvar.location;
  		/* Relocate in case it's in a shared library */
  		if (storage == LOC_STATIC)
! 		  valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
  
  		/* Luckily, dvar, svar, typedef, and tagdef all
  		   have their "global" bit in the same place, so it works
--- 1984,1990 ----
  		valu = dn_bufp->dsvar.location;
  		/* Relocate in case it's in a shared library */
  		if (storage == LOC_STATIC)
! 		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  
  		/* Luckily, dvar, svar, typedef, and tagdef all
  		   have their "global" bit in the same place, so it works
*************** hpread_build_psymtabs (objfile, section_
*** 2069,2075 ****
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile, section_offsets,
  					      "globals", 0,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 2056,2062 ----
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile,
  					      "globals", 0,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_get_textlow (global, index, objfi
*** 2212,2232 ****
     (normal). */
  
  static struct partial_symtab *
! hpread_start_psymtab (objfile, section_offsets,
  		      filename, textlow, ldsymoff, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
       struct partial_symbol **global_syms;
       struct partial_symbol **static_syms;
  {
!   int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
    extern void hpread_psymtab_to_symtab ();
    struct partial_symtab *result =
!   start_psymtab_common (objfile, section_offsets,
! 			filename, textlow, global_syms, static_syms);
  
    result->textlow += offset;
    result->read_symtab_private = (char *)
--- 2199,2217 ----
     (normal). */
  
  static struct partial_symtab *
! hpread_start_psymtab (objfile,
  		      filename, textlow, ldsymoff, global_syms, static_syms)
       struct objfile *objfile;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
       struct partial_symbol **global_syms;
       struct partial_symbol **static_syms;
  {
!   int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
    extern void hpread_psymtab_to_symtab ();
    struct partial_symtab *result =
!   start_psymtab_common (objfile, filename, textlow, global_syms, static_syms);
  
    result->textlow += offset;
    result->read_symtab_private = (char *)
*************** hpread_end_psymtab (pst, include_list, n
*** 2260,2266 ****
  {
    int i;
    struct objfile *objfile = pst->objfile;
!   int offset = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT);
  
  #ifdef DUMPING
    /* Turn on to see what kind of a psymtab we've built. */
--- 2245,2251 ----
  {
    int i;
    struct objfile *objfile = pst->objfile;
!   int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  
  #ifdef DUMPING
    /* Turn on to see what kind of a psymtab we've built. */
*************** hpread_end_psymtab (pst, include_list, n
*** 2308,2314 ****
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
!       subpst->section_offsets = pst->section_offsets;
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
--- 2293,2301 ----
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
! #if 0
!       subpst->psymtab_section_offsets = pst->psymtab_section_offsets;
! #endif
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
Index: hp-symtab-read.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/hp-symtab-read.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 hp-symtab-read.c
*** hp-symtab-read.c	1999/08/16 19:52:47	1.1.1.3
--- hp-symtab-read.c	1999/09/07 04:14:09
*************** void hpread_psymtab_to_symtab
*** 99,106 ****
    PARAMS ((struct partial_symtab *));
  
  static struct symtab *hpread_expand_symtab
!   PARAMS ((struct objfile *, int, int, CORE_ADDR, int,
! 	   struct section_offsets *, char *));
  
  static int hpread_type_translate
    PARAMS ((dnttpointer));
--- 99,105 ----
    PARAMS ((struct partial_symtab *));
  
  static struct symtab *hpread_expand_symtab
!   PARAMS ((struct objfile *, int, int, CORE_ADDR, int, char *));
  
  static int hpread_type_translate
    PARAMS ((dnttpointer));
*************** static sltpointer hpread_record_lines
*** 146,152 ****
  	   struct objfile *, CORE_ADDR));
  
  static void hpread_process_one_debug_symbol
!   PARAMS ((union dnttentry *, char *, struct section_offsets *,
  	   struct objfile *, CORE_ADDR, int, char *, int, int *));
  
  static int hpread_get_scope_depth
--- 145,151 ----
  	   struct objfile *, CORE_ADDR));
  
  static void hpread_process_one_debug_symbol
!   PARAMS ((union dnttentry *, char *,
  	   struct objfile *, CORE_ADDR, int, char *, int, int *));
  
  static int hpread_get_scope_depth
*************** hpread_psymtab_to_symtab_1 (pst)
*** 369,375 ****
        pst->symtab =
  	hpread_expand_symtab (pst->objfile, LDSYMOFF (pst), LDSYMLEN (pst),
  			      pst->textlow, pst->texthigh - pst->textlow,
! 			      pst->section_offsets, pst->filename);
        sort_symtab_syms (pst->symtab);
  
        do_cleanups (old_chain);
--- 368,374 ----
        pst->symtab =
  	hpread_expand_symtab (pst->objfile, LDSYMOFF (pst), LDSYMLEN (pst),
  			      pst->textlow, pst->texthigh - pst->textlow,
! 			      pst->filename);
        sort_symtab_syms (pst->symtab);
  
        do_cleanups (old_chain);
*************** hpread_psymtab_to_symtab (pst)
*** 435,452 ****
     the beginning of the symbols we want to read
     SYM_SIZE is the size of the symbol info to read in.
     TEXT_OFFSET is the beginning of the text segment we are reading symbols for
!    TEXT_SIZE is the size of the text segment read in.
!    SECTION_OFFSETS are the relocation offsets which get added to each symbol. */
  
  static struct symtab *
  hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
! 		      section_offsets, filename)
       struct objfile *objfile;
       int sym_offset;
       int sym_size;
       CORE_ADDR text_offset;
       int text_size;
-      struct section_offsets *section_offsets;
       char *filename;
  {
    char *namestring;
--- 434,449 ----
     the beginning of the symbols we want to read
     SYM_SIZE is the size of the symbol info to read in.
     TEXT_OFFSET is the beginning of the text segment we are reading symbols for
!    TEXT_SIZE is the size of the text segment read in. */
  
  static struct symtab *
  hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
! 		      filename)
       struct objfile *objfile;
       int sym_offset;
       int sym_size;
       CORE_ADDR text_offset;
       int text_size;
       char *filename;
  {
    char *namestring;
*************** hpread_expand_symtab (objfile, sym_offse
*** 511,517 ****
        /* Yow!  We call SET_NAMESTRING on things without names!  */
        SET_NAMESTRING (dn_bufp, &namestring, objfile);
  
!       hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
  				       objfile, text_offset, text_size,
  				       filename, symnum + sym_index,
  				       &at_module_boundary
--- 508,514 ----
        /* Yow!  We call SET_NAMESTRING on things without names!  */
        SET_NAMESTRING (dn_bufp, &namestring, objfile);
  
!       hpread_process_one_debug_symbol (dn_bufp, namestring,
  				       objfile, text_offset, text_size,
  				       filename, symnum + sym_index,
  				       &at_module_boundary
*************** class_of (functype)
*** 2796,2802 ****
   * Arguments:
   *   dn_bufp: 
   *   name: 
-  *   section_offsets:
   *   objfile:
   *   text_offset: 
   *   text_size: 
--- 2793,2798 ----
*************** class_of (functype)
*** 2806,2818 ****
   */
  
  static void
! hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
  				 text_offset, text_size, filename,
  				 index, at_module_boundary_p
  )
       union dnttentry *dn_bufp;
       char *name;
-      struct section_offsets *section_offsets;
       struct objfile *objfile;
       CORE_ADDR text_offset;
       int text_size;
--- 2802,2813 ----
   */
  
  static void
! hpread_process_one_debug_symbol (dn_bufp, name, objfile,
  				 text_offset, text_size, filename,
  				 index, at_module_boundary_p
  )
       union dnttentry *dn_bufp;
       char *name;
       struct objfile *objfile;
       CORE_ADDR text_offset;
       int text_size;
*************** hpread_process_one_debug_symbol (dn_bufp
*** 2823,2830 ****
    unsigned long desc;
    int type;
    CORE_ADDR valu;
!   int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
!   int data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA);
    union dnttentry *dn_temp;
    dnttpointer hp_type;
    struct symbol *sym;
--- 2818,2825 ----
    unsigned long desc;
    int type;
    CORE_ADDR valu;
!   int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
!   int data_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
    union dnttentry *dn_temp;
    dnttpointer hp_type;
    struct symbol *sym;
Index: hpread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/hpread.c,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 hpread.c
*** hpread.c	1999/07/07 20:06:51	1.1.1.2
--- hpread.c	1999/09/07 04:14:27
*************** static struct type *hpread_read_struct_t
*** 159,170 ****
    PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
  
  void hpread_build_psymtabs
!   PARAMS ((struct objfile *, struct section_offsets *, int));
  
  void hpread_symfile_finish PARAMS ((struct objfile *));
  
  static struct partial_symtab *hpread_start_psymtab
!   PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  static struct partial_symtab *hpread_end_psymtab
--- 159,170 ----
    PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
  
  void hpread_build_psymtabs
!   PARAMS ((struct objfile *, int));
  
  void hpread_symfile_finish PARAMS ((struct objfile *));
  
  static struct partial_symtab *hpread_start_psymtab
!   PARAMS ((struct objfile *, char *, CORE_ADDR, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  static struct partial_symtab *hpread_end_psymtab
*************** static struct partial_symtab *hpread_end
*** 172,182 ****
  	   struct partial_symtab **, int));
  
  static struct symtab *hpread_expand_symtab
!   PARAMS ((struct objfile *, int, int, CORE_ADDR, int,
! 	   struct section_offsets *, char *));
  
  static void hpread_process_one_debug_symbol
!   PARAMS ((union dnttentry *, char *, struct section_offsets *,
  	   struct objfile *, CORE_ADDR, int, char *, int));
  
  static sltpointer hpread_record_lines
--- 172,181 ----
  	   struct partial_symtab **, int));
  
  static struct symtab *hpread_expand_symtab
!   PARAMS ((struct objfile *, int, int, CORE_ADDR, int, char *));
  
  static void hpread_process_one_debug_symbol
!   PARAMS ((union dnttentry *, char *,
  	   struct objfile *, CORE_ADDR, int, char *, int));
  
  static sltpointer hpread_record_lines
*************** hpread_symfile_init (objfile)
*** 305,319 ****
     We assume hpread_symfile_init has been called to initialize the
     symbol reader's private data structures.
  
-    SECTION_OFFSETS contains offsets relative to which the symbols in the
-    various sections are (depending where the sections were actually loaded).
     MAINLINE is true if we are reading the main symbol
     table (as opposed to a shared lib or dynamically loaded file).  */
  
  void
! hpread_build_psymtabs (objfile, section_offsets, mainline)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       int mainline;
  {
    char *namestring;
--- 304,315 ----
     We assume hpread_symfile_init has been called to initialize the
     symbol reader's private data structures.
  
     MAINLINE is true if we are reading the main symbol
     table (as opposed to a shared lib or dynamically loaded file).  */
  
  void
! hpread_build_psymtabs (objfile, mainline)
       struct objfile *objfile;
       int mainline;
  {
    char *namestring;
*************** hpread_build_psymtabs (objfile, section_
*** 469,476 ****
  		  past_first_source_file = 1;
  
  		valu = hpread_get_textlow (i, hp_symnum, objfile);
! 		valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
! 		pst = hpread_start_psymtab (objfile, section_offsets,
  					    namestring, valu,
  					    (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 465,472 ----
  		  past_first_source_file = 1;
  
  		valu = hpread_get_textlow (i, hp_symnum, objfile);
! 		valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
! 		pst = hpread_start_psymtab (objfile,
  					    namestring, valu,
  					    (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 487,496 ****
  	         is supposed to be.  */
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      valu = hpread_get_textlow (i, hp_symnum, objfile);
! 	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile, section_offsets,
  					      namestring, valu,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 483,492 ----
  	         is supposed to be.  */
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      valu = hpread_get_textlow (i, hp_symnum, objfile);
! 	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile,
  					      namestring, valu,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 504,515 ****
  	    case DNTT_TYPE_ENTRY:
  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
  	         a secondary entry point.  */
! 	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
  						       SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->dfunc.lowaddr +
! 		ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      add_psymbol_to_list (namestring, strlen (namestring),
  				   VAR_NAMESPACE, LOC_BLOCK,
--- 500,511 ----
  	    case DNTT_TYPE_ENTRY:
  	      /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
  	         a secondary entry point.  */
! 	      valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
  						       SECT_OFF_TEXT);
  	      if (valu > texthigh)
  		texthigh = valu;
  	      valu = dn_bufp->dfunc.lowaddr +
! 		ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      add_psymbol_to_list (namestring, strlen (namestring),
  				   VAR_NAMESPACE, LOC_BLOCK,
*************** hpread_build_psymtabs (objfile, section_
*** 571,577 ****
  		SET_NAMESTRING (dn_bufp, &namestring, objfile);
  		if (!pst)
  		  {
! 		    pst = hpread_start_psymtab (objfile, section_offsets,
  						"globals", 0,
  						(hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 567,573 ----
  		SET_NAMESTRING (dn_bufp, &namestring, objfile);
  		if (!pst)
  		  {
! 		    pst = hpread_start_psymtab (objfile,
  						"globals", 0,
  						(hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_build_psymtabs (objfile, section_
*** 602,608 ****
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile, section_offsets,
  					      "globals", 0,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 598,604 ----
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile,
  					      "globals", 0,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
*************** hpread_has_name (kind)
*** 826,835 ****
     (normal). */
  
  static struct partial_symtab *
! hpread_start_psymtab (objfile, section_offsets,
! 		      filename, textlow, ldsymoff, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
--- 822,830 ----
     (normal). */
  
  static struct partial_symtab *
! hpread_start_psymtab (objfile, filename, textlow, ldsymoff, global_syms,
! 		      static_syms)
       struct objfile *objfile;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
*************** hpread_start_psymtab (objfile, section_o
*** 837,844 ****
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, section_offsets,
! 			filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
--- 832,838 ----
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
*************** hpread_end_psymtab (pst, include_list, n
*** 894,900 ****
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
!       subpst->section_offsets = pst->section_offsets;
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
--- 888,896 ----
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
! #if 0
!       subpst->psymtab_section_offsets = pst->psymtab_section_offsets;
! #endif
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
*************** hpread_psymtab_to_symtab_1 (pst)
*** 999,1005 ****
        pst->symtab =
  	hpread_expand_symtab (pst->objfile, LDSYMOFF (pst), LDSYMLEN (pst),
  			      pst->textlow, pst->texthigh - pst->textlow,
! 			      pst->section_offsets, pst->filename);
        sort_symtab_syms (pst->symtab);
  
        do_cleanups (old_chain);
--- 995,1001 ----
        pst->symtab =
  	hpread_expand_symtab (pst->objfile, LDSYMOFF (pst), LDSYMLEN (pst),
  			      pst->textlow, pst->texthigh - pst->textlow,
! 			      pst->filename);
        sort_symtab_syms (pst->symtab);
  
        do_cleanups (old_chain);
*************** hpread_psymtab_to_symtab (pst)
*** 1056,1073 ****
     the beginning of the symbols we want to read
     SYM_SIZE is the size of the symbol info to read in.
     TEXT_OFFSET is the beginning of the text segment we are reading symbols for
!    TEXT_SIZE is the size of the text segment read in.
!    SECTION_OFFSETS are the relocation offsets which get added to each symbol. */
  
  static struct symtab *
  hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
! 		      section_offsets, filename)
       struct objfile *objfile;
       int sym_offset;
       int sym_size;
       CORE_ADDR text_offset;
       int text_size;
-      struct section_offsets *section_offsets;
       char *filename;
  {
    char *namestring;
--- 1052,1067 ----
     the beginning of the symbols we want to read
     SYM_SIZE is the size of the symbol info to read in.
     TEXT_OFFSET is the beginning of the text segment we are reading symbols for
!    TEXT_SIZE is the size of the text segment read in. */
  
  static struct symtab *
  hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
! 		      filename)
       struct objfile *objfile;
       int sym_offset;
       int sym_size;
       CORE_ADDR text_offset;
       int text_size;
       char *filename;
  {
    char *namestring;
*************** hpread_expand_symtab (objfile, sym_offse
*** 1105,1111 ****
        /* Yow!  We call SET_NAMESTRING on things without names!  */
        SET_NAMESTRING (dn_bufp, &namestring, objfile);
  
!       hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
  				       objfile, text_offset, text_size,
  				       filename, symnum + sym_index);
      }
--- 1099,1105 ----
        /* Yow!  We call SET_NAMESTRING on things without names!  */
        SET_NAMESTRING (dn_bufp, &namestring, objfile);
  
!       hpread_process_one_debug_symbol (dn_bufp, namestring,
  				       objfile, text_offset, text_size,
  				       filename, symnum + sym_index);
      }
*************** hpread_record_lines (subfile, s_idx, e_i
*** 1765,1775 ****
  /* Internalize one native debug symbol.  */
  
  static void
! hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
  				 text_offset, text_size, filename, index)
       union dnttentry *dn_bufp;
       char *name;
-      struct section_offsets *section_offsets;
       struct objfile *objfile;
       CORE_ADDR text_offset;
       int text_size;
--- 1759,1768 ----
  /* Internalize one native debug symbol.  */
  
  static void
! hpread_process_one_debug_symbol (dn_bufp, name, objfile,
  				 text_offset, text_size, filename, index)
       union dnttentry *dn_bufp;
       char *name;
       struct objfile *objfile;
       CORE_ADDR text_offset;
       int text_size;
*************** hpread_process_one_debug_symbol (dn_bufp
*** 1779,1785 ****
    unsigned long desc;
    int type;
    CORE_ADDR valu;
!   int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
    union dnttentry *dn_temp;
    dnttpointer hp_type;
    struct symbol *sym;
--- 1772,1778 ----
    unsigned long desc;
    int type;
    CORE_ADDR valu;
!   int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
    union dnttentry *dn_temp;
    dnttpointer hp_type;
    struct symbol *sym;
Index: mdebugread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/mdebugread.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 mdebugread.c
*** mdebugread.c	1999/07/07 20:08:01	1.1.1.4
--- mdebugread.c	1999/09/07 04:15:12
*************** static int
*** 353,360 ****
  upgrade_type PARAMS ((int, struct type **, int, union aux_ext *, int, char *));
  
  static void
! parse_partial_symbols PARAMS ((struct objfile *,
! 			       struct section_offsets *));
  
  static FDR
  * get_rfd PARAMS ((int, int));
--- 353,359 ----
  upgrade_type PARAMS ((int, struct type **, int, union aux_ext *, int, char *));
  
  static void
! parse_partial_symbols PARAMS ((struct objfile *));
  
  static FDR
  * get_rfd PARAMS ((int, int));
*************** static struct blockvector *
*** 385,391 ****
    new_bvect PARAMS ((int));
  
  static int
! parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct section_offsets *));
  
  static struct type *
    parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *));
--- 384,390 ----
    new_bvect PARAMS ((int));
  
  static int
! parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct objfile *));
  
  static struct type *
    parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *));
*************** static int
*** 407,413 ****
  compare_blocks PARAMS ((const void *, const void *));
  
  static struct partial_symtab *
!   new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
  
  static void
  psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
--- 406,412 ----
  compare_blocks PARAMS ((const void *, const void *));
  
  static struct partial_symtab *
!   new_psymtab PARAMS ((char *, struct objfile *));
  
  static void
  psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
*************** fdr_name (f)
*** 516,530 ****
  }
  
  
! /* Read in and parse the symtab of the file OBJFILE.  Symbols from
!    different sections are relocated via the SECTION_OFFSETS.  */
  
  void
! mdebug_build_psymtabs (objfile, swap, info, section_offsets)
       struct objfile *objfile;
       const struct ecoff_debug_swap *swap;
       struct ecoff_debug_info *info;
-      struct section_offsets *section_offsets;
  {
    cur_bfd = objfile->obfd;
    debug_swap = swap;
--- 515,527 ----
  }
  
  
! /* Read in and parse the symtab of the file OBJFILE. */
  
  void
! mdebug_build_psymtabs (objfile, swap, info)
       struct objfile *objfile;
       const struct ecoff_debug_swap *swap;
       struct ecoff_debug_info *info;
  {
    cur_bfd = objfile->obfd;
    debug_swap = swap;
*************** mdebug_build_psymtabs (objfile, swap, in
*** 548,554 ****
  	(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
      }
  
!   parse_partial_symbols (objfile, section_offsets);
  
  #if 0
    /* Check to make sure file was compiled with -g.  If not, warn the
--- 545,551 ----
  	(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
      }
  
!   parse_partial_symbols (objfile);
  
  #if 0
    /* Check to make sure file was compiled with -g.  If not, warn the
*************** add_pending (fh, sh, t)
*** 718,729 ****
     SYMR's handled (normally one).  */
  
  static int
! parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       SYMR *sh;
       union aux_ext *ax;
       char *ext_sh;
       int bigend;
!      struct section_offsets *section_offsets;
  {
    const bfd_size_type external_sym_size = debug_swap->external_sym_size;
    void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
--- 715,726 ----
     SYMR's handled (normally one).  */
  
  static int
! parse_symbol (sh, ax, ext_sh, bigend, objfile)
       SYMR *sh;
       union aux_ext *ax;
       char *ext_sh;
       int bigend;
!      struct objfile *objfile;
  {
    const bfd_size_type external_sym_size = debug_swap->external_sym_size;
    void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
*************** parse_symbol (sh, ax, ext_sh, bigend, se
*** 755,772 ****
           The value of a stBlock symbol is the displacement from the
           procedure address.  */
        if (sh->st != stEnd && sh->st != stBlock)
! 	sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        break;
      case scData:
      case scSData:
      case scRData:
      case scPData:
      case scXData:
!       sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA);
        break;
      case scBss:
      case scSBss:
!       sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS);
        break;
      }
  
--- 752,769 ----
           The value of a stBlock symbol is the displacement from the
           procedure address.  */
        if (sh->st != stEnd && sh->st != stBlock)
! 	sh->value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        break;
      case scData:
      case scSData:
      case scRData:
      case scPData:
      case scXData:
!       sh->value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
        break;
      case scBss:
      case scSBss:
!       sh->value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
        break;
      }
  
*************** parse_procedure (pr, search_symtab, pst)
*** 2044,2050 ****
           procedure descriptor in e->pdr.adr.
           As the address in the procedure descriptor is usually relative,
           we would have to relocate e->pdr.adr with cur_fdr->adr and
!          ANOFFSET (pst->section_offsets, SECT_OFF_TEXT).
           Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
           in shared libraries on some systems, and on other systems
           e->pdr.adr is sometimes offset by a bogus value.
--- 2041,2047 ----
           procedure descriptor in e->pdr.adr.
           As the address in the procedure descriptor is usually relative,
           we would have to relocate e->pdr.adr with cur_fdr->adr and
!          ANOFFSET (pst->objfile->section_offsets, SECT_OFF_TEXT).
           Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
           in shared libraries on some systems, and on other systems
           e->pdr.adr is sometimes offset by a bogus value.
*************** ecoff_relocate_efi (sym, delta)
*** 2104,2116 ****
  
     This routine clobbers top_stack->cur_block and ->cur_st. */
  
! static void parse_external PARAMS ((EXTR *, int, struct section_offsets *));
  
  static void
! parse_external (es, bigend, section_offsets)
       EXTR *es;
       int bigend;
!      struct section_offsets *section_offsets;
  {
    union aux_ext *ax;
  
--- 2101,2113 ----
  
     This routine clobbers top_stack->cur_block and ->cur_st. */
  
! static void parse_external PARAMS ((EXTR *, int, struct objfile *));
  
  static void
! parse_external (es, bigend, objfile)
       EXTR *es;
       int bigend;
!      struct objfile *objfile;
  {
    union aux_ext *ax;
  
*************** parse_external (es, bigend, section_offs
*** 2185,2191 ****
  
        /* Note that the case of a symbol with indexNil must be handled
           anyways by parse_symbol().  */
!       parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets);
        break;
      default:
        break;
--- 2182,2188 ----
  
        /* Note that the case of a symbol with indexNil must be handled
           anyways by parse_symbol().  */
!       parse_symbol (&es->asym, ax, (char *) NULL, bigend, objfile);
        break;
      default:
        break;
*************** parse_lines (fh, pr, lt, maxlines, pst, 
*** 2274,2282 ****
     into a partial_symtab.  */
  
  static void
! parse_partial_symbols (objfile, section_offsets)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
  {
    const bfd_size_type external_sym_size = debug_swap->external_sym_size;
    const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
--- 2271,2278 ----
     into a partial_symtab.  */
  
  static void
! parse_partial_symbols (objfile)
       struct objfile *objfile;
  {
    const bfd_size_type external_sym_size = debug_swap->external_sym_size;
    const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
*************** parse_partial_symbols (objfile, section_
*** 2363,2369 ****
    old_chain = make_cleanup (free, fdr_to_pst);
    fdr_to_pst++;
    {
!     struct partial_symtab *pst = new_psymtab ("", objfile, section_offsets);
      fdr_to_pst[-1].pst = pst;
      FDR_IDX (pst) = -1;
    }
--- 2359,2365 ----
    old_chain = make_cleanup (free, fdr_to_pst);
    fdr_to_pst++;
    {
!     struct partial_symtab *pst = new_psymtab ("", objfile);
      fdr_to_pst[-1].pst = pst;
      FDR_IDX (pst) = -1;
    }
*************** parse_partial_symbols (objfile, section_
*** 2477,2488 ****
  	{
  	case stProc:
  	  /* Beginnning of Procedure */
! 	  svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	  break;
  	case stStaticProc:
  	  /* Load time only static procs */
  	  ms_type = mst_file_text;
! 	  svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	  break;
  	case stGlobal:
  	  /* External symbol */
--- 2473,2484 ----
  	{
  	case stProc:
  	  /* Beginnning of Procedure */
! 	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	  break;
  	case stStaticProc:
  	  /* Load time only static procs */
  	  ms_type = mst_file_text;
! 	  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	  break;
  	case stGlobal:
  	  /* External symbol */
*************** parse_partial_symbols (objfile, section_
*** 2495,2506 ****
  	  else if (SC_IS_DATA (ext_in->asym.sc))
  	    {
  	      ms_type = mst_data;
! 	      svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (SC_IS_BSS (ext_in->asym.sc))
  	    {
  	      ms_type = mst_bss;
! 	      svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
  	    }
  	  else
  	    ms_type = mst_abs;
--- 2491,2502 ----
  	  else if (SC_IS_DATA (ext_in->asym.sc))
  	    {
  	      ms_type = mst_data;
! 	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (SC_IS_BSS (ext_in->asym.sc))
  	    {
  	      ms_type = mst_bss;
! 	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  	    }
  	  else
  	    ms_type = mst_abs;
*************** parse_partial_symbols (objfile, section_
*** 2510,2526 ****
  	  if (SC_IS_TEXT (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_text;
! 	      svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	    }
  	  else if (SC_IS_DATA (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_data;
! 	      svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (SC_IS_BSS (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_bss;
! 	      svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
  	    }
  	  else
  	    ms_type = mst_abs;
--- 2506,2522 ----
  	  if (SC_IS_TEXT (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_text;
! 	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	    }
  	  else if (SC_IS_DATA (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_data;
! 	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (SC_IS_BSS (ext_in->asym.sc))
  	    {
  	      ms_type = mst_file_bss;
! 	      svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  	    }
  	  else
  	    ms_type = mst_abs;
*************** parse_partial_symbols (objfile, section_
*** 2564,2574 ****
  	{
  	  textlow = fh->adr;
  	  if (relocatable || textlow != 0)
! 	    textlow += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	}
        else
  	textlow = 0;
!       pst = start_psymtab_common (objfile, section_offsets,
  				  fdr_name (fh),
  				  textlow,
  				  objfile->global_psymbols.next,
--- 2560,2570 ----
  	{
  	  textlow = fh->adr;
  	  if (relocatable || textlow != 0)
! 	    textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	}
        else
  	textlow = 0;
!       pst = start_psymtab_common (objfile,
  				  fdr_name (fh),
  				  textlow,
  				  objfile->global_psymbols.next,
*************** parse_partial_symbols (objfile, section_
*** 2652,2658 ****
  		      CORE_ADDR procaddr;
  		      long isym;
  
! 		      sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  		      if (sh.st == stStaticProc)
  			{
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
--- 2648,2654 ----
  		      CORE_ADDR procaddr;
  		      long isym;
  
! 		      sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  		      if (sh.st == stStaticProc)
  			{
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
*************** parse_partial_symbols (objfile, section_
*** 2703,2709 ****
  			case scPData:
  			case scXData:
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
! 			  sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
  			  prim_record_minimal_symbol_and_info (namestring,
  							       sh.value,
  							       mst_file_data,
--- 2699,2705 ----
  			case scPData:
  			case scXData:
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
! 			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  			  prim_record_minimal_symbol_and_info (namestring,
  							       sh.value,
  							       mst_file_data,
*************** parse_partial_symbols (objfile, section_
*** 2717,2723 ****
  			  /* FIXME!  Shouldn't this use cases for bss, 
  			     then have the default be abs? */
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
! 			  sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
  			  prim_record_minimal_symbol_and_info (namestring,
  							       sh.value,
  							       mst_file_bss,
--- 2713,2719 ----
  			  /* FIXME!  Shouldn't this use cases for bss, 
  			     then have the default be abs? */
  			  namestring = debug_info->ss + fh->issBase + sh.iss;
! 			  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  			  prim_record_minimal_symbol_and_info (namestring,
  							       sh.value,
  							       mst_file_bss,
*************** parse_partial_symbols (objfile, section_
*** 2769,2775 ****
    namestring = stabstring
  #define CUR_SYMBOL_TYPE type_code
  #define CUR_SYMBOL_VALUE sh.value
! #define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
    pst = save_pst
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set) (void)0
  #define HANDLE_RBRAC(val) \
--- 2765,2771 ----
    namestring = stabstring
  #define CUR_SYMBOL_TYPE type_code
  #define CUR_SYMBOL_VALUE sh.value
! #define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms)\
    pst = save_pst
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set) (void)0
  #define HANDLE_RBRAC(val) \
*************** parse_partial_symbols (objfile, section_
*** 2821,2838 ****
  		  /* The value of a stEnd symbol is the displacement from the
  		     corresponding start symbol value, do not relocate it.  */
  		  if (sh.st != stEnd)
! 		    sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  		  break;
  		case scData:
  		case scSData:
  		case scRData:
  		case scPData:
  		case scXData:
! 		  sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
  		  break;
  		case scBss:
  		case scSBss:
! 		  sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
  		  break;
  		}
  
--- 2817,2834 ----
  		  /* The value of a stEnd symbol is the displacement from the
  		     corresponding start symbol value, do not relocate it.  */
  		  if (sh.st != stEnd)
! 		    sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  		  break;
  		case scData:
  		case scSData:
  		case scRData:
  		case scPData:
  		case scXData:
! 		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  		  break;
  		case scBss:
  		case scSBss:
! 		  sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  		  break;
  		}
  
*************** parse_partial_symbols (objfile, section_
*** 3029,3046 ****
  		{
  		case scText:
  		case scRConst:
! 		  svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  		  break;
  		case scData:
  		case scSData:
  		case scRData:
  		case scPData:
  		case scXData:
! 		  svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
  		  break;
  		case scBss:
  		case scSBss:
! 		  svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
  		  break;
  		}
  
--- 3025,3042 ----
  		{
  		case scText:
  		case scRConst:
! 		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  		  break;
  		case scData:
  		case scSData:
  		case scRData:
  		case scPData:
  		case scXData:
! 		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  		  break;
  		case scBss:
  		case scSBss:
! 		  svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  		  break;
  		}
  
*************** psymtab_to_symtab_1 (pst, filename)
*** 3399,3412 ****
  	         complaining about them.  */
  	      if (type_code & N_STAB)
  		{
! 		  process_one_symbol (type_code, 0, valu, name,
! 				      pst->section_offsets, pst->objfile);
  		}
  	      /* Similarly a hack.  */
  	      else if (name[0] == '#')
  		{
! 		  process_one_symbol (N_SLINE, 0, valu, name,
! 				      pst->section_offsets, pst->objfile);
  		}
  	      if (type_code == N_FUN)
  		{
--- 3395,3406 ----
  	         complaining about them.  */
  	      if (type_code & N_STAB)
  		{
! 		  process_one_symbol (type_code, 0, valu, name, pst->objfile);
  		}
  	      /* Similarly a hack.  */
  	      else if (name[0] == '#')
  		{
! 		  process_one_symbol (N_SLINE, 0, valu, name, pst->objfile);
  		}
  	      if (type_code == N_FUN)
  		{
*************** psymtab_to_symtab_1 (pst, filename)
*** 3438,3444 ****
  	      else
  		{
  		  /* Handle encoded stab line number. */
! 		  valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT);
  		  record_line (current_subfile, sh.index, valu);
  		}
  	    }
--- 3432,3438 ----
  	      else
  		{
  		  /* Handle encoded stab line number. */
! 		  valu += ANOFFSET (pst->objfile->section_offsets, SECT_OFF_TEXT);
  		  record_line (current_subfile, sh.index, valu);
  		}
  	    }
*************** psymtab_to_symtab_1 (pst, filename)
*** 3564,3570 ****
  	      (*swap_sym_in) (cur_bfd, sym_ptr, &sh);
  	      c = parse_symbol (&sh,
  				debug_info->external_aux + fh->iauxBase,
! 			     sym_ptr, fh->fBigendian, pst->section_offsets);
  	      sym_ptr += c * external_sym_size;
  	    }
  
--- 3558,3564 ----
  	      (*swap_sym_in) (cur_bfd, sym_ptr, &sh);
  	      c = parse_symbol (&sh,
  				debug_info->external_aux + fh->iauxBase,
! 				sym_ptr, fh->fBigendian, pst->objfile);
  	      sym_ptr += c * external_sym_size;
  	    }
  
*************** psymtab_to_symtab_1 (pst, filename)
*** 3632,3638 ****
  
        ext_ptr = PST_PRIVATE (pst)->extern_tab;
        for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
! 	parse_external (ext_ptr, fh->fBigendian, pst->section_offsets);
  
        /* If there are undefined symbols, tell the user.
           The alpha has an undefined symbol for every symbol that is
--- 3626,3632 ----
  
        ext_ptr = PST_PRIVATE (pst)->extern_tab;
        for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
! 	parse_external (ext_ptr, fh->fBigendian, pst->objfile);
  
        /* If there are undefined symbols, tell the user.
           The alpha has an undefined symbol for every symbol that is
*************** new_symtab (name, maxsyms, maxlines, obj
*** 4131,4145 ****
  /* Allocate a new partial_symtab NAME */
  
  static struct partial_symtab *
! new_psymtab (name, objfile, section_offsets)
       char *name;
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
  {
    struct partial_symtab *psymtab;
  
    psymtab = allocate_psymtab (name, objfile);
!   psymtab->section_offsets = section_offsets;
  
    /* Keep a backpointer to the file's symbols */
  
--- 4125,4140 ----
  /* Allocate a new partial_symtab NAME */
  
  static struct partial_symtab *
! new_psymtab (name, objfile)
       char *name;
       struct objfile *objfile;
  {
    struct partial_symtab *psymtab;
  
    psymtab = allocate_psymtab (name, objfile);
! #if 0
!   psymtab->psymtab_section_offsets = objfile->section_offsets;
! #endif
  
    /* Keep a backpointer to the file's symbols */
  
*************** new_type (name)
*** 4288,4298 ****
     it as normal.  */
  
  void
! elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
       struct objfile *objfile;
       const struct ecoff_debug_swap *swap;
       asection *sec;
-      struct section_offsets *section_offsets;
  {
    bfd *abfd = objfile->obfd;
    struct ecoff_debug_info *info;
--- 4283,4292 ----
     it as normal.  */
  
  void
! elfmdebug_build_psymtabs (objfile, swap, sec)
       struct objfile *objfile;
       const struct ecoff_debug_swap *swap;
       asection *sec;
  {
    bfd *abfd = objfile->obfd;
    struct ecoff_debug_info *info;
*************** elfmdebug_build_psymtabs (objfile, swap,
*** 4305,4311 ****
      error ("Error reading ECOFF debugging information: %s",
  	   bfd_errmsg (bfd_get_error ()));
  
!   mdebug_build_psymtabs (objfile, swap, info, section_offsets);
  }
  
  
--- 4299,4305 ----
      error ("Error reading ECOFF debugging information: %s",
  	   bfd_errmsg (bfd_get_error ()));
  
!   mdebug_build_psymtabs (objfile, swap, info);
  }
  
  
Index: mipsread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/mipsread.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 mipsread.c
*** mipsread.c	1999/08/09 21:33:42	1.1.1.4
--- mipsread.c	1999/09/07 04:15:16
*************** static void
*** 57,64 ****
  mipscoff_symfile_finish PARAMS ((struct objfile *));
  
  static void
! read_alphacoff_dynamic_symtab PARAMS ((struct section_offsets *,
! 				       struct objfile * objfile));
  
  /* Initialize anything that needs initializing when a completely new
     symbol file is specified (not just adding some symbols from another
--- 57,63 ----
  mipscoff_symfile_finish PARAMS ((struct objfile *));
  
  static void
! read_alphacoff_dynamic_symtab PARAMS ((struct objfile *));
  
  /* Initialize anything that needs initializing when a completely new
     symbol file is specified (not just adding some symbols from another
*************** mipscoff_symfile_read (objfile, mainline
*** 104,114 ****
      error ("Error reading symbol table: %s", bfd_errmsg (bfd_get_error ()));
  
    mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
! 			 &ecoff_data (abfd)->debug_info, objfile->section_offsets);
  
    /* Add alpha coff dynamic symbols.  */
  
!   read_alphacoff_dynamic_symtab (objfile->section_offsets, objfile);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. */
--- 103,113 ----
      error ("Error reading symbol table: %s", bfd_errmsg (bfd_get_error ()));
  
    mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
! 			 &ecoff_data (abfd)->debug_info);
  
    /* Add alpha coff dynamic symbols.  */
  
!   read_alphacoff_dynamic_symtab (objfile);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. */
*************** alphacoff_locate_sections (ignore_abfd, 
*** 234,241 ****
     add them to the minimal symbol table.  */
  
  static void
! read_alphacoff_dynamic_symtab (section_offsets, objfile)
!      struct section_offsets *section_offsets;
       struct objfile *objfile;
  {
    bfd *abfd = objfile->obfd;
--- 233,239 ----
     add them to the minimal symbol table.  */
  
  static void
! read_alphacoff_dynamic_symtab (objfile)
       struct objfile *objfile;
  {
    bfd *abfd = objfile->obfd;
*************** read_alphacoff_dynamic_symtab (section_o
*** 402,408 ****
  		ms_type = mst_text;
  	      else
  		ms_type = mst_file_text;
! 	      sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	    }
  	  else if (sym_shndx == SHN_MIPS_DATA)
  	    {
--- 400,406 ----
  		ms_type = mst_text;
  	      else
  		ms_type = mst_file_text;
! 	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	    }
  	  else if (sym_shndx == SHN_MIPS_DATA)
  	    {
*************** read_alphacoff_dynamic_symtab (section_o
*** 410,416 ****
  		ms_type = mst_data;
  	      else
  		ms_type = mst_file_data;
! 	      sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (sym_shndx == SHN_MIPS_ACOMMON)
  	    {
--- 408,414 ----
  		ms_type = mst_data;
  	      else
  		ms_type = mst_file_data;
! 	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  	    }
  	  else if (sym_shndx == SHN_MIPS_ACOMMON)
  	    {
*************** read_alphacoff_dynamic_symtab (section_o
*** 418,424 ****
  		ms_type = mst_bss;
  	      else
  		ms_type = mst_file_bss;
! 	      sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS);
  	    }
  	  else if (sym_shndx == SHN_ABS)
  	    {
--- 416,422 ----
  		ms_type = mst_bss;
  	      else
  		ms_type = mst_file_bss;
! 	      sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
  	    }
  	  else if (sym_shndx == SHN_ABS)
  	    {
Index: nlmread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/nlmread.c,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 nlmread.c
*** nlmread.c	1999/08/09 21:33:43	1.1.1.4
--- nlmread.c	1999/09/07 04:15:17
*************** static void
*** 44,50 ****
  nlm_symfile_finish PARAMS ((struct objfile *));
  
  static void
! nlm_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *));
  
  /* Initialize anything that needs initializing when a completely new symbol
     file is specified (not just adding some symbols from another file, e.g. a
--- 44,50 ----
  nlm_symfile_finish PARAMS ((struct objfile *));
  
  static void
! nlm_symtab_read PARAMS ((bfd *, struct objfile *));
  
  /* Initialize anything that needs initializing when a completely new symbol
     file is specified (not just adding some symbols from another file, e.g. a
*************** nlm_symfile_init (ignore)
*** 85,105 ****
  
     SYNOPSIS
  
!    void nlm_symtab_read (bfd *abfd, CORE_ADDR addr,
!    struct objfile *objfile)
  
     DESCRIPTION
  
!    Given an open bfd, a base address to relocate symbols to, and a
!    flag that specifies whether or not this bfd is for an executable
!    or not (may be shared library for example), add all the global
     function and data symbols to the minimal symbol table.
   */
  
  static void
! nlm_symtab_read (abfd, addr, objfile)
       bfd *abfd;
-      CORE_ADDR addr;
       struct objfile *objfile;
  {
    long storage_needed;
--- 85,101 ----
  
     SYNOPSIS
  
!    void nlm_symtab_read (bfd *abfd, struct objfile *objfile)
  
     DESCRIPTION
  
!    Given an open bfd, and an objfile pointer, add all the global
     function and data symbols to the minimal symbol table.
   */
  
  static void
! nlm_symtab_read (abfd, objfile)
       bfd *abfd;
       struct objfile *objfile;
  {
    long storage_needed;
*************** nlm_symtab_read (abfd, addr, objfile)
*** 109,116 ****
--- 105,114 ----
    long i;
    struct cleanup *back_to;
    CORE_ADDR symaddr;
+   CORE_ADDR addr;
    enum minimal_symbol_type ms_type;
  
+   addr = ANOFFSET (objfile->section_offsets, 0);
    storage_needed = bfd_get_symtab_upper_bound (abfd);
    if (storage_needed < 0)
      error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
*************** nlm_symfile_read (objfile, mainline)
*** 188,207 ****
  {
    bfd *abfd = objfile->obfd;
    struct cleanup *back_to;
-   CORE_ADDR offset;
    struct symbol *mainsym;
  
    init_minimal_symbol_collection ();
    back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
  
-   /* FIXME, should take a section_offsets param, not just an offset.  */
- 
-   offset = ANOFFSET (objfile->section_offsets, 0);
- 
    /* Process the NLM export records, which become the bfd's canonical symbol
       table. */
  
!   nlm_symtab_read (abfd, offset, objfile);
  
    stabsect_build_psymtabs (objfile, mainline, ".stab",
  			   ".stabstr", ".text");
--- 186,200 ----
  {
    bfd *abfd = objfile->obfd;
    struct cleanup *back_to;
    struct symbol *mainsym;
  
    init_minimal_symbol_collection ();
    back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
  
    /* Process the NLM export records, which become the bfd's canonical symbol
       table. */
  
!   nlm_symtab_read (abfd, objfile);
  
    stabsect_build_psymtabs (objfile, mainline, ".stab",
  			   ".stabstr", ".text");
Index: objfiles.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/objfiles.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 objfiles.c
*** objfiles.c	1999/08/16 19:53:26	1.1.1.5
--- objfiles.c	1999/09/07 04:15:23
*************** objfile_relocate (objfile, new_offsets)
*** 521,529 ****
       struct objfile *objfile;
       struct section_offsets *new_offsets;
  {
!   struct section_offsets *delta = (struct section_offsets *)
!   alloca (sizeof (struct section_offsets)
! 	  + objfile->num_sections * sizeof (delta->offsets));
  
    {
      int i;
--- 521,528 ----
       struct objfile *objfile;
       struct section_offsets *new_offsets;
  {
!   struct section_offsets *delta =
!     (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
  
    {
      int i;
Index: os9kread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/os9kread.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 os9kread.c
*** os9kread.c	1999/08/09 21:33:44	1.1.1.5
--- os9kread.c	1999/09/07 04:15:36
*************** static struct complaint lbrac_mismatch_c
*** 127,133 ****
  /* Local function prototypes */
  
  static void
! read_minimal_symbols PARAMS ((struct objfile *, struct section_offsets *));
  
  static void
  os9k_read_ofile_symtab PARAMS ((struct partial_symtab *));
--- 127,133 ----
  /* Local function prototypes */
  
  static void
! read_minimal_symbols PARAMS ((struct objfile *));
  
  static void
  os9k_read_ofile_symtab PARAMS ((struct partial_symtab *));
*************** static void
*** 139,146 ****
  os9k_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
  
  static void
! read_os9k_psymtab PARAMS ((struct section_offsets *, struct objfile *,
! 			   CORE_ADDR, int));
  
  static int
  fill_sym PARAMS ((FILE *, bfd *));
--- 139,145 ----
  os9k_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
  
  static void
! read_os9k_psymtab PARAMS ((struct objfile *, CORE_ADDR, int));
  
  static int
  fill_sym PARAMS ((FILE *, bfd *));
*************** static void
*** 158,168 ****
  os9k_symfile_finish PARAMS ((struct objfile *));
  
  static void
! os9k_process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
! 			       struct section_offsets *, struct objfile *));
  
  static struct partial_symtab *
!   os9k_start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
  			      CORE_ADDR, int, int, struct partial_symbol **,
  			      struct partial_symbol **));
  
--- 157,166 ----
  os9k_symfile_finish PARAMS ((struct objfile *));
  
  static void
! os9k_process_one_symbol PARAMS ((int, int, CORE_ADDR, char *, struct objfile *));
  
  static struct partial_symtab *
!   os9k_start_psymtab PARAMS ((struct objfile *, char *,
  			      CORE_ADDR, int, int, struct partial_symbol **,
  			      struct partial_symbol **));
  
*************** static struct partial_symtab *
*** 171,178 ****
  			    struct partial_symtab **, int));
  
  static void
! record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *,
! 			       struct section_offsets *));
  
  #define HANDLE_RBRAC(val) \
    if ((val) > pst->texthigh) pst->texthigh = (val);
--- 169,175 ----
  			    struct partial_symtab **, int));
  
  static void
! record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *));
  
  #define HANDLE_RBRAC(val) \
    if ((val) > pst->texthigh) pst->texthigh = (val);
*************** record_minimal_symbol PARAMS ((char *, C
*** 198,209 ****
  #define N_ABS 6
  
  static void
! record_minimal_symbol (name, address, type, objfile, section_offsets)
       char *name;
       CORE_ADDR address;
       int type;
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
  {
    enum minimal_symbol_type ms_type;
  
--- 195,205 ----
  #define N_ABS 6
  
  static void
! record_minimal_symbol (name, address, type, objfile)
       char *name;
       CORE_ADDR address;
       int type;
       struct objfile *objfile;
  {
    enum minimal_symbol_type ms_type;
  
*************** record_minimal_symbol (name, address, ty
*** 211,217 ****
      {
      case N_TEXT:
        ms_type = mst_text;
!       address += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        break;
      case N_DATA:
        ms_type = mst_data;
--- 207,213 ----
      {
      case N_TEXT:
        ms_type = mst_text;
!       address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        break;
      case N_DATA:
        ms_type = mst_data;
*************** struct stbsymbol
*** 257,265 ****
  #define STBSYMSIZE 10
  
  static void
! read_minimal_symbols (objfile, section_offsets)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
  {
    FILE *fp;
    bfd *abfd;
--- 253,260 ----
  #define STBSYMSIZE 10
  
  static void
! read_minimal_symbols (objfile)
       struct objfile *objfile;
  {
    FILE *fp;
    bfd *abfd;
*************** read_minimal_symbols (objfile, section_o
*** 314,320 ****
  	    break;
  	  ch = getc (fp);
  	};
!       record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile, section_offsets);
        off += STBSYMSIZE;
      };
    install_minimal_symbols (objfile);
--- 309,315 ----
  	    break;
  	  ch = getc (fp);
  	};
!       record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile);
        off += STBSYMSIZE;
      };
    install_minimal_symbols (objfile);
*************** read_minimal_symbols (objfile, section_o
*** 326,333 ****
     put all the relevant info into a "struct os9k_symfile_info",
     hung off the objfile structure.
  
-    SECTION_OFFSETS contains offsets relative to which the symbols in the
-    various sections are (depending where the sections were actually loaded).
     MAINLINE is true if we are reading the main symbol
     table (as opposed to a shared lib or dynamically loaded file).  */
  
--- 321,326 ----
*************** os9k_symfile_read (objfile, mainline)
*** 349,359 ****
    back_to = make_cleanup (really_free_pendings, 0);
  
    make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
!   read_minimal_symbols (objfile, objfile->section_offsets);
  
    /* Now that the symbol table data of the executable file are all in core,
       process them and define symbols accordingly.  */
!   read_os9k_psymtab (objfile->section_offsets, objfile,
  		     DBX_TEXT_ADDR (objfile),
  		     DBX_TEXT_SIZE (objfile));
  
--- 342,352 ----
    back_to = make_cleanup (really_free_pendings, 0);
  
    make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
!   read_minimal_symbols (objfile);
  
    /* Now that the symbol table data of the executable file are all in core,
       process them and define symbols accordingly.  */
!   read_os9k_psymtab (objfile,
  		     DBX_TEXT_ADDR (objfile),
  		     DBX_TEXT_SIZE (objfile));
  
*************** fill_sym (dbg_file, abfd)
*** 565,577 ****
  /* Given pointers to an a.out symbol table in core containing dbx
     style data, setup partial_symtab's describing each source file for
     which debugging information is available.
!    SYMFILE_NAME is the name of the file we are reading from
!    and SECTION_OFFSETS is the set of offsets for the various sections
!    of the file (a set of zeros if the mainline program).  */
  
  static void
! read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
!      struct section_offsets *section_offsets;
       struct objfile *objfile;
       CORE_ADDR text_addr;
       int text_size;
--- 558,567 ----
  /* Given pointers to an a.out symbol table in core containing dbx
     style data, setup partial_symtab's describing each source file for
     which debugging information is available.
!    SYMFILE_NAME is the name of the file we are reading from. */
  
  static void
! read_os9k_psymtab (objfile, text_addr, text_size)
       struct objfile *objfile;
       CORE_ADDR text_addr;
       int text_size;
*************** read_os9k_psymtab (section_offsets, objf
*** 617,623 ****
  #ifdef END_OF_TEXT_DEFAULT
    end_of_text_addr = END_OF_TEXT_DEFAULT;
  #else
!   end_of_text_addr = text_addr + section_offsets->offsets[SECT_OFF_TEXT]
      + text_size;		/* Relocate */
  #endif
  
--- 607,613 ----
  #ifdef END_OF_TEXT_DEFAULT
    end_of_text_addr = END_OF_TEXT_DEFAULT;
  #else
!   end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)
      + text_size;		/* Relocate */
  #endif
  
*************** read_os9k_psymtab (section_offsets, objf
*** 664,670 ****
  	  continue;
  
  	case N_SYM_SE:
! 	  CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	  if (psymfile_depth == 1 && pst)
  	    {
  	      os9k_end_psymtab (pst, psymtab_include_list, includes_used,
--- 654,660 ----
  	  continue;
  
  	case N_SYM_SE:
! 	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	  if (psymfile_depth == 1 && pst)
  	    {
  	      os9k_end_psymtab (pst, psymtab_include_list, includes_used,
*************** read_os9k_psymtab (section_offsets, objf
*** 701,707 ****
  
  		valu = CUR_SYMBOL_VALUE;
  		if (valu)
! 		  valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  		past_first_source_file = 1;
  
  		p = strchr (namestring, ':');
--- 691,697 ----
  
  		valu = CUR_SYMBOL_VALUE;
  		if (valu)
! 		  valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  		past_first_source_file = 1;
  
  		p = strchr (namestring, ':');
*************** read_os9k_psymtab (section_offsets, objf
*** 716,722 ****
  		if (psymfile_depth == 0)
  		  {
  		    if (!pst)
! 		      pst = os9k_start_psymtab (objfile, section_offsets,
  						str, valu,
  						cursymoffset,
  						symnum - 1,
--- 706,712 ----
  		if (psymfile_depth == 0)
  		  {
  		    if (!pst)
! 		      pst = os9k_start_psymtab (objfile,
  						str, valu,
  						cursymoffset,
  						symnum - 1,
*************** read_os9k_psymtab (section_offsets, objf
*** 893,899 ****
  	      continue;
  
  	    case 'f':
! 	      CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      if (pst && pst->textlow == 0)
  		pst->textlow = CUR_SYMBOL_VALUE;
  
--- 883,889 ----
  	      continue;
  
  	    case 'f':
! 	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      if (pst && pst->textlow == 0)
  		pst->textlow = CUR_SYMBOL_VALUE;
  
*************** read_os9k_psymtab (section_offsets, objf
*** 904,910 ****
  	      continue;
  
  	    case 'F':
! 	      CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      if (pst && pst->textlow == 0)
  		pst->textlow = CUR_SYMBOL_VALUE;
  
--- 894,900 ----
  	      continue;
  
  	    case 'F':
! 	      CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      if (pst && pst->textlow == 0)
  		pst->textlow = CUR_SYMBOL_VALUE;
  
*************** read_os9k_psymtab (section_offsets, objf
*** 942,948 ****
  	    }
  
  	case N_SYM_RBRAC:
! 	  CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  #ifdef HANDLE_RBRAC
  	  HANDLE_RBRAC (CUR_SYMBOL_VALUE);
  	  continue;
--- 932,938 ----
  	    }
  
  	case N_SYM_RBRAC:
! 	  CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  #ifdef HANDLE_RBRAC
  	  HANDLE_RBRAC (CUR_SYMBOL_VALUE);
  	  continue;
*************** read_os9k_psymtab (section_offsets, objf
*** 992,1001 ****
  
  
  static struct partial_symtab *
! os9k_start_psymtab (objfile, section_offsets,
  	    filename, textlow, ldsymoff, ldsymcnt, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
--- 982,990 ----
  
  
  static struct partial_symtab *
! os9k_start_psymtab (objfile,
  	    filename, textlow, ldsymoff, ldsymcnt, global_syms, static_syms)
       struct objfile *objfile;
       char *filename;
       CORE_ADDR textlow;
       int ldsymoff;
*************** os9k_start_psymtab (objfile, section_off
*** 1004,1011 ****
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, section_offsets,
! 			filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
--- 993,999 ----
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
      obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
*************** os9k_end_psymtab (pst, include_list, num
*** 1156,1162 ****
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
!       subpst->section_offsets = pst->section_offsets;
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
--- 1144,1152 ----
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
! #if 0
!       subpst->psymtab_section_offsets = pst->psymtab_section_offsets;
! #endif
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
*************** os9k_read_ofile_symtab (pst)
*** 1313,1319 ****
    int sym_offset;		/* Offset to start of symbols to read */
    CORE_ADDR text_offset;	/* Start of text segment for symbols */
    int text_size;		/* Size of text segment for symbols */
-   struct section_offsets *section_offsets;
    FILE *dbg_file;
  
    objfile = pst->objfile;
--- 1303,1308 ----
*************** os9k_read_ofile_symtab (pst)
*** 1321,1327 ****
    max_symnum = LDSYMCNT (pst);
    text_offset = pst->textlow;
    text_size = pst->texthigh - pst->textlow;
-   section_offsets = pst->section_offsets;
  
    current_objfile = objfile;
    subfile_stack = NULL;
--- 1310,1315 ----
*************** os9k_read_ofile_symtab (pst)
*** 1386,1392 ****
        type = bufp->n_type;
  
        os9k_process_one_symbol ((int) type, (int) bufp->n_desc,
! 	 (CORE_ADDR) bufp->n_value, bufp->n_strx, section_offsets, objfile);
  
        /* We skip checking for a new .o or -l file; that should never
           happen in this routine. */
--- 1374,1380 ----
        type = bufp->n_type;
  
        os9k_process_one_symbol ((int) type, (int) bufp->n_desc,
! 	 (CORE_ADDR) bufp->n_value, bufp->n_strx, objfile);
  
        /* We skip checking for a new .o or -l file; that should never
           happen in this routine. */
*************** os9k_read_ofile_symtab (pst)
*** 1455,1465 ****
     It is used in end_symtab.  */
  
  static void
! os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       int type, desc;
       CORE_ADDR valu;
       char *name;
-      struct section_offsets *section_offsets;
       struct objfile *objfile;
  {
    register struct context_stack *new;
--- 1443,1452 ----
     It is used in end_symtab.  */
  
  static void
! os9k_process_one_symbol (type, desc, valu, name, objfile)
       int type, desc;
       CORE_ADDR valu;
       char *name;
       struct objfile *objfile;
  {
    register struct context_stack *new;
*************** os9k_process_one_symbol (type, desc, val
*** 1485,1496 ****
      case N_SYM_LBRAC:
        /* On most machines, the block addresses are relative to the
           N_SO, the linker did not relocate them (sigh).  */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        new = push_context (desc, valu);
        break;
  
      case N_SYM_RBRAC:
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        new = pop_context ();
  
  #if !defined (OS9K_VARIABLES_INSIDE_BLOCK)
--- 1472,1483 ----
      case N_SYM_LBRAC:
        /* On most machines, the block addresses are relative to the
           N_SO, the linker did not relocate them (sigh).  */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        new = push_context (desc, valu);
        break;
  
      case N_SYM_RBRAC:
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        new = pop_context ();
  
  #if !defined (OS9K_VARIABLES_INSIDE_BLOCK)
*************** os9k_process_one_symbol (type, desc, val
*** 1559,1565 ****
           one line-number -- core-address correspondence.
           Enter it in the line list for this symbol table. */
        /* Relocate for dynamic loading and for ELF acc fn-relative syms.  */
!       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
        /* FIXME: loses if sizeof (char *) > sizeof (int) */
        record_line (current_subfile, (int) name, valu);
        break;
--- 1546,1552 ----
           one line-number -- core-address correspondence.
           Enter it in the line list for this symbol table. */
        /* Relocate for dynamic loading and for ELF acc fn-relative syms.  */
!       valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
        /* FIXME: loses if sizeof (char *) > sizeof (int) */
        record_line (current_subfile, (int) name, valu);
        break;
*************** os9k_process_one_symbol (type, desc, val
*** 1582,1588 ****
  	  switch (deftype)
  	    {
  	    case 'S':
! 	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      n = strrchr (name, '/');
  	      if (n != NULL)
  		{
--- 1569,1575 ----
  	  switch (deftype)
  	    {
  	    case 'S':
! 	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      n = strrchr (name, '/');
  	      if (n != NULL)
  		{
*************** os9k_process_one_symbol (type, desc, val
*** 1617,1623 ****
  
  	    case 'f':
  	    case 'F':
! 	      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
  	      function_stab_type = type;
  
  	      within_function = 1;
--- 1604,1610 ----
  
  	    case 'f':
  	    case 'F':
! 	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	      function_stab_type = type;
  
  	      within_function = 1;
*************** os9k_process_one_symbol (type, desc, val
*** 1627,1633 ****
  
  	    case 'V':
  	    case 'v':
! 	      valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
  	      define_symbol (valu, name, desc, type, objfile);
  	      break;
  
--- 1614,1620 ----
  
  	    case 'V':
  	    case 'v':
! 	      valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  	      define_symbol (valu, name, desc, type, objfile);
  	      break;
  
Index: pa64solib.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/pa64solib.h,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 pa64solib.h
*** pa64solib.h	1999/08/31 01:05:38	1.1.1.2
--- pa64solib.h	1999/09/07 04:15:36
***************
*** 21,27 ****
  /* Forward decl's for prototypes */
  struct target_ops;
  struct objfile;
- struct section_offsets;
  
  /* Called to add symbols from a shared library to gdb's symbol table.  */
  
--- 21,26 ----
Index: partial-stab.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/partial-stab.h,v
retrieving revision 1.1.1.4
diff -c -p -r1.1.1.4 partial-stab.h
*** partial-stab.h	1999/08/09 21:33:44	1.1.1.4
--- partial-stab.h	1999/09/07 04:15:46
***************
*** 24,30 ****
     CUR_SYMBOL_TYPE --Type code of current symbol.
     CUR_SYMBOL_VALUE --Value field of current symbol.  May be adjusted here.
     namestring - variable pointing to the name of the stab.
-    section_offsets - variable pointing to the section offsets.
     pst - the partial symbol table being built.
  
     psymtab_include_list, includes_used, includes_allocated - list of include
--- 24,29 ----
*************** switch (CUR_SYMBOL_TYPE)
*** 266,272 ****
           immediately follow the first.  */
  
        if (!pst)
! 	pst = START_PSYMTAB (objfile, objfile->section_offsets,
  			     namestring, valu,
  			     first_so_symnum * symbol_size,
  			     objfile->global_psymbols.next,
--- 265,271 ----
           immediately follow the first.  */
  
        if (!pst)
! 	pst = START_PSYMTAB (objfile,
  			     namestring, valu,
  			     first_so_symnum * symbol_size,
  			     objfile->global_psymbols.next,
Index: remote-os9k.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/remote-os9k.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 remote-os9k.c
*** remote-os9k.c	1999/08/09 21:33:47	1.1.1.5
--- remote-os9k.c	1999/09/07 04:16:01
*************** rombug_wait (pid, status)
*** 512,523 ****
      {
        if (obj_sec->objfile != symfile_objfile)
  	new_symfile_objfile (obj_sec->objfile, 1, 0);
!       offs = ((struct section_offsets *)
! 	      alloca (sizeof (struct section_offsets)
! 	       + (symfile_objfile->num_sections * sizeof (offs->offsets))));
!       memcpy (offs, symfile_objfile->section_offsets,
! 	      (sizeof (struct section_offsets) +
! 	         (symfile_objfile->num_sections * sizeof (offs->offsets))));
        ANOFFSET (offs, SECT_OFF_DATA) = addr;
        ANOFFSET (offs, SECT_OFF_BSS) = addr;
  
--- 512,519 ----
      {
        if (obj_sec->objfile != symfile_objfile)
  	new_symfile_objfile (obj_sec->objfile, 1, 0);
!       offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
!       memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
        ANOFFSET (offs, SECT_OFF_DATA) = addr;
        ANOFFSET (offs, SECT_OFF_BSS) = addr;
  
Index: remote-vx.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/remote-vx.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 remote-vx.c
*** remote-vx.c	1999/08/09 21:33:49	1.1.1.3
--- remote-vx.c	1999/09/07 04:16:22
*************** vx_add_symbols (name, from_tty, text_add
*** 708,719 ****
       free_objfile it.  */
    objfile_to_front (objfile);
  
!   offs = (struct section_offsets *)
!     alloca (sizeof (struct section_offsets)
! 	    + objfile->num_sections * sizeof (offs->offsets));
!   memcpy (offs, objfile->section_offsets,
! 	  sizeof (struct section_offsets)
! 	  + objfile->num_sections * sizeof (offs->offsets));
  
    ss.text_start = 0;
    ss.data_start = 0;
--- 708,715 ----
       free_objfile it.  */
    objfile_to_front (objfile);
  
!   offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
!   memcpy (offs, objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
  
    ss.text_start = 0;
    ss.data_start = 0;
Index: remote.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/remote.c,v
retrieving revision 1.1.1.17
diff -c -p -r1.1.1.17 remote.c
*** remote.c	1999/08/31 01:05:51	1.1.1.17
--- remote.c	1999/09/07 04:16:54
*************** get_offsets ()
*** 1499,1511 ****
    if (symfile_objfile == NULL)
      return;
  
!   offs = alloca (sizeof (struct section_offsets)
! 		 + symfile_objfile->num_sections
! 		 * sizeof (offs->offsets));
!   memcpy (offs, symfile_objfile->section_offsets,
! 	  sizeof (struct section_offsets)
! 	  + symfile_objfile->num_sections
! 	  * sizeof (offs->offsets));
  
    ANOFFSET (offs, SECT_OFF_TEXT) = text_addr;
  
--- 1499,1506 ----
    if (symfile_objfile == NULL)
      return;
  
!   offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
!   memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
  
    ANOFFSET (offs, SECT_OFF_TEXT) = text_addr;
  
*************** remote_cisco_objfile_relocate (text_off,
*** 1619,1633 ****
           broken for xcoff, dwarf, sdb-coff, etc.  But there is no
           simple canonical representation for this stuff.  */
  
!       offs = ((struct section_offsets *)
! 	      alloca (sizeof (struct section_offsets)
! 		      + (symfile_objfile->num_sections
! 			 * sizeof (offs->offsets))));
! 
!       memcpy (offs, symfile_objfile->section_offsets,
! 	      (sizeof (struct section_offsets)
! 	       + (symfile_objfile->num_sections
! 		  * sizeof (offs->offsets))));
  
        ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
        ANOFFSET (offs, SECT_OFF_DATA) = data_off;
--- 1614,1621 ----
           broken for xcoff, dwarf, sdb-coff, etc.  But there is no
           simple canonical representation for this stuff.  */
  
!       offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
!       memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
  
        ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
        ANOFFSET (offs, SECT_OFF_DATA) = data_off;
*************** Packet: '%s'\n",
*** 2389,2395 ****
  
  	    if (symfile_objfile == NULL)
  	      {
! 		warning ("Relocation packet recieved with no symbol file.  \
  Packet Dropped");
  		goto got_status;
  	      }
--- 2377,2383 ----
  
  	    if (symfile_objfile == NULL)
  	      {
! 		warning ("Relocation packet received with no symbol file.  \
  Packet Dropped");
  		goto got_status;
  	      }
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/rs6000-nat.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 rs6000-nat.c
*** rs6000-nat.c	1999/07/07 20:09:35	1.1.1.3
--- rs6000-nat.c	1999/09/07 04:17:02
*************** vmap_symtab (vp)
*** 343,351 ****
        objfile = symfile_objfile;
      }
  
!   new_offsets = alloca
!     (sizeof (struct section_offsets)
!      + sizeof (new_offsets->offsets) * objfile->num_sections);
  
    for (i = 0; i < objfile->num_sections; ++i)
      ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i);
--- 343,349 ----
        objfile = symfile_objfile;
      }
  
!   new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
  
    for (i = 0; i < objfile->num_sections; ++i)
      ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i);
Index: somread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/somread.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 somread.c
*** somread.c	1999/08/16 19:53:58	1.1.1.5
--- somread.c	1999/09/07 04:17:11
*************** static void
*** 49,64 ****
  som_symfile_finish PARAMS ((struct objfile *));
  
  static void
! som_symtab_read PARAMS ((bfd *, struct objfile *,
! 			 struct section_offsets *));
  
! static struct section_offsets *
  som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
  
  /* FIXME: These should really be in a common header somewhere */
  
  extern void
! hpread_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int));
  
  extern void
  hpread_symfile_finish PARAMS ((struct objfile *));
--- 49,63 ----
  som_symfile_finish PARAMS ((struct objfile *));
  
  static void
! som_symtab_read PARAMS ((bfd *, struct objfile *));
  
! static void
  som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
  
  /* FIXME: These should really be in a common header somewhere */
  
  extern void
! hpread_build_psymtabs PARAMS ((struct objfile *, int));
  
  extern void
  hpread_symfile_finish PARAMS ((struct objfile *));
*************** do_pxdb PARAMS ((bfd *));
*** 77,98 ****
  
     SYNOPSIS
  
!    void som_symtab_read (bfd *abfd, struct objfile *objfile,
!    struct section_offsets *section_offsets)
  
     DESCRIPTION
  
!    Given an open bfd, a base address to relocate symbols to, and a
!    flag that specifies whether or not this bfd is for an executable
!    or not (may be shared library for example), add all the global
     function and data symbols to the minimal symbol table.
   */
  
  static void
! som_symtab_read (abfd, objfile, section_offsets)
       bfd *abfd;
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
  {
    unsigned int number_of_symbols;
    int val, dynamic;
--- 76,93 ----
  
     SYNOPSIS
  
!    void som_symtab_read (bfd *abfd, struct objfile *objfile)
  
     DESCRIPTION
  
!    Given an open bfd and an objfile pointer, add all the global
     function and data symbols to the minimal symbol table.
   */
  
  static void
! som_symtab_read (abfd, objfile)
       bfd *abfd;
       struct objfile *objfile;
  {
    unsigned int number_of_symbols;
    int val, dynamic;
*************** som_symtab_read (abfd, objfile, section_
*** 104,111 ****
    CORE_ADDR text_offset, data_offset;
  
  
!   text_offset = ANOFFSET (section_offsets, 0);
!   data_offset = ANOFFSET (section_offsets, 1);
  
    number_of_symbols = bfd_get_symcount (abfd);
  
--- 99,106 ----
    CORE_ADDR text_offset, data_offset;
  
  
!   text_offset = ANOFFSET (objfile->section_offsets, 0);
!   data_offset = ANOFFSET (objfile->section_offsets, 1);
  
    number_of_symbols = bfd_get_symcount (abfd);
  
*************** som_symtab_read (abfd, objfile, section_
*** 330,338 ****
     We have been initialized by a call to som_symfile_init, which 
     currently does nothing.
  
-    SECTION_OFFSETS is a set of offsets to apply to relocate the symbols
-    in each section.  This is ignored, as it isn't needed for SOM.
- 
     MAINLINE is true if we are reading the main symbol
     table (as opposed to a shared lib or dynamically loaded file).
  
--- 325,330 ----
*************** som_symfile_read (objfile, mainline)
*** 385,391 ****
       actually scan the DNTT. It does scan the linker symbol
       table and thus build up a "minimal symbol table". */
  
!   som_symtab_read (abfd, objfile, objfile->section_offsets);
  
    /* Now read information from the stabs debug sections.
       This is a no-op for SOM.
--- 377,383 ----
       actually scan the DNTT. It does scan the linker symbol
       table and thus build up a "minimal symbol table". */
  
!   som_symtab_read (abfd, objfile);
  
    /* Now read information from the stabs debug sections.
       This is a no-op for SOM.
*************** som_symfile_read (objfile, mainline)
*** 398,404 ****
       This builds the psymtab. This used to be done via a scan of
       the DNTT, but is now done via the PXDB-built quick-lookup tables
       together with a scan of the GNTT. See hp-psymtab-read.c. */
!   hpread_build_psymtabs (objfile, objfile->section_offsets, mainline);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. 
--- 390,396 ----
       This builds the psymtab. This used to be done via a scan of
       the DNTT, but is now done via the PXDB-built quick-lookup tables
       together with a scan of the GNTT. See hp-psymtab-read.c. */
!   hpread_build_psymtabs (objfile, mainline);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. 
*************** som_symfile_init (objfile)
*** 459,485 ****
  
     Plain and simple for now.  */
  
! static struct section_offsets *
  som_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);
  
    /* First see if we're a shared library.  If so, get the section
       offsets from the library, else get them from addr.  */
!   if (!som_solib_section_offsets (objfile, section_offsets))
      {
        for (i = 0; i < SECT_OFF_MAX; i++)
! 	ANOFFSET (section_offsets, i) = addr;
      }
- 
-   return section_offsets;
  }
  
  /* Read in and initialize the SOM import list which is present
--- 451,474 ----
  
     Plain and simple for now.  */
  
! static void
  som_symfile_offsets (objfile, addr)
       struct objfile *objfile;
       CORE_ADDR addr;
  {
    int i;
  
    objfile->num_sections = SECT_OFF_MAX;
!   objfile->section_offsets = (struct section_offsets *)
      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.  */
!   if (!som_solib_section_offsets (objfile))
      {
        for (i = 0; i < SECT_OFF_MAX; i++)
! 	ANOFFSET (objfile->section_offsets, i) = addr;
      }
  }
  
  /* Read in and initialize the SOM import list which is present
Index: somsolib.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/somsolib.c,v
retrieving revision 1.1.1.2
diff -c -p -r1.1.1.2 somsolib.c
*** somsolib.c	1999/07/07 20:10:03	1.1.1.2
--- somsolib.c	1999/09/07 04:17:21
*************** som_solib_get_solib_by_pc (addr)
*** 1426,1434 ****
  
  
  int
! som_solib_section_offsets (objfile, offsets)
       struct objfile *objfile;
-      struct section_offsets *offsets;
  {
    struct so_list *so_list = so_list_head;
  
--- 1426,1433 ----
  
  
  int
! som_solib_section_offsets (objfile)
       struct objfile *objfile;
  {
    struct so_list *so_list = so_list_head;
  
*************** som_solib_section_offsets (objfile, offs
*** 1441,1451 ****
  	  asection *private_section;
  
  	  /* The text offset is easy.  */
! 	  ANOFFSET (offsets, SECT_OFF_TEXT)
  	    = (so_list->som_solib.text_addr
  	       - so_list->som_solib.text_link_addr);
! 	  ANOFFSET (offsets, SECT_OFF_RODATA)
! 	    = ANOFFSET (offsets, SECT_OFF_TEXT);
  
  	  /* We should look at presumed_dp in the SOM header, but
  	     that's not easily available.  This should be OK though.  */
--- 1440,1450 ----
  	  asection *private_section;
  
  	  /* The text offset is easy.  */
! 	  ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)
  	    = (so_list->som_solib.text_addr
  	       - so_list->som_solib.text_link_addr);
! 	  ANOFFSET (objfile->section_offsets, SECT_OFF_RODATA)
! 	    = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  
  	  /* We should look at presumed_dp in the SOM header, but
  	     that's not easily available.  This should be OK though.  */
*************** som_solib_section_offsets (objfile, offs
*** 1454,1467 ****
  	  if (!private_section)
  	    {
  	      warning ("Unable to find $PRIVATE$ in shared library!");
! 	      ANOFFSET (offsets, SECT_OFF_DATA) = 0;
! 	      ANOFFSET (offsets, SECT_OFF_BSS) = 0;
  	      return 1;
  	    }
! 	  ANOFFSET (offsets, SECT_OFF_DATA)
  	    = (so_list->som_solib.data_start - private_section->vma);
! 	  ANOFFSET (offsets, SECT_OFF_BSS)
! 	    = ANOFFSET (offsets, SECT_OFF_DATA);
  	  return 1;
  	}
        so_list = so_list->next;
--- 1453,1466 ----
  	  if (!private_section)
  	    {
  	      warning ("Unable to find $PRIVATE$ in shared library!");
! 	      ANOFFSET (objfile->section_offsets, SECT_OFF_DATA) = 0;
! 	      ANOFFSET (objfile->section_offsets, SECT_OFF_BSS) = 0;
  	      return 1;
  	    }
! 	  ANOFFSET (objfile->section_offsets, SECT_OFF_DATA)
  	    = (so_list->som_solib.data_start - private_section->vma);
! 	  ANOFFSET (objfile->section_offsets, SECT_OFF_BSS)
! 	    = ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
  	  return 1;
  	}
        so_list = so_list->next;
Index: somsolib.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/somsolib.h,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 somsolib.h
*** somsolib.h	1999/08/31 01:06:02	1.1.1.3
--- somsolib.h	1999/09/07 04:17:23
***************
*** 24,30 ****
  /* Forward decl's for prototypes */
  struct target_ops;
  struct objfile;
- struct section_offsets;
  
  /* Called to add symbols from a shared library to gdb's symbol table. */
  
--- 24,29 ----
*************** extern CORE_ADDR
*** 38,44 ****
    som_solib_get_got_by_pc PARAMS ((CORE_ADDR));
  
  extern int
! som_solib_section_offsets PARAMS ((struct objfile *, struct section_offsets *));
  
  /* Function to be called when the inferior starts up, to discover the names
     of shared libraries that are dynamically linked, the base addresses to
--- 37,43 ----
    som_solib_get_got_by_pc PARAMS ((CORE_ADDR));
  
  extern int
! som_solib_section_offsets PARAMS ((struct objfile *));
  
  /* Function to be called when the inferior starts up, to discover the names
     of shared libraries that are dynamically linked, the base addresses to
Index: stabsread.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/stabsread.h,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 stabsread.h
*** stabsread.h	1999/08/09 21:33:56	1.1.1.3
--- stabsread.h	1999/09/07 04:17:24
*************** struct stab_section_list
*** 188,198 ****
     they are only used by some stabs readers.  */
  
  extern struct partial_symtab *
-   start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
- 			 CORE_ADDR, int, struct partial_symbol **,
- 			 struct partial_symbol **));
- 
- extern struct partial_symtab *
    end_psymtab PARAMS ((struct partial_symtab * pst,
  		       char **include_list,
  		       int num_includes,
--- 188,193 ----
*************** extern struct partial_symtab *
*** 203,210 ****
  		       int textlow_not_set));
  
  extern void
! process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
! 			    struct section_offsets *, struct objfile *));
  
  extern void elfstab_build_psymtabs
    PARAMS ((struct objfile * objfile,
--- 198,204 ----
  		       int textlow_not_set));
  
  extern void
! process_one_symbol PARAMS ((int, int, CORE_ADDR, char *, struct objfile *));
  
  extern void elfstab_build_psymtabs
    PARAMS ((struct objfile * objfile,
Index: symfile.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/symfile.c,v
retrieving revision 1.1.1.9
diff -c -p -r1.1.1.9 symfile.c
*** symfile.c	1999/08/31 01:06:08	1.1.1.9
--- symfile.c	1999/09/07 04:17:47
*************** find_lowest_section (abfd, sect, obj)
*** 457,479 ****
     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);
!   memset (section_offsets, 0, SIZEOF_SECTION_OFFSETS);
  
    for (i = 0; i < SECT_OFF_MAX; i++)
!     ANOFFSET (section_offsets, i) = addr;
! 
!   return section_offsets;
  }
  
  
--- 457,476 ----
     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.  */
  
! void
  default_symfile_offsets (objfile, addr)
       struct objfile *objfile;
       CORE_ADDR addr;
  {
    int i;
  
    objfile->num_sections = SECT_OFF_MAX;
!   objfile->section_offsets = (struct section_offsets *)
      obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
!   memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS);
  
    for (i = 0; i < SECT_OFF_MAX; i++)
!     ANOFFSET (objfile->section_offsets, i) = addr;
  }
  
  
*************** syms_from_objfile (objfile, addr, mainli
*** 498,504 ****
       int mainline;
       int verbo;
  {
-   struct section_offsets *section_offsets;
    asection *lowest_sect;
    struct cleanup *old_chain;
  
--- 495,500 ----
*************** syms_from_objfile (objfile, addr, mainli
*** 563,570 ****
    (*objfile->sf->sym_init) (objfile);
    clear_complaints (1, verbo);
  
!   section_offsets = (*objfile->sf->sym_offsets) (objfile, addr);
!   objfile->section_offsets = section_offsets;
  
  #ifndef IBM6000_TARGET
    /* This is a SVR4/SunOS specific hack, I think.  In any event, it
--- 559,565 ----
    (*objfile->sf->sym_init) (objfile);
    clear_complaints (1, verbo);
  
!   (*objfile->sf->sym_offsets) (objfile, addr);
  
  #ifndef IBM6000_TARGET
    /* This is a SVR4/SunOS specific hack, I think.  In any event, it
*************** reread_symbols ()
*** 1379,1385 ****
  	      struct cleanup *old_cleanups;
  	      struct section_offsets *offsets;
  	      int num_offsets;
- 	      int section_offsets_size;
  	      char *obfd_filename;
  
  	      printf_filtered ("`%s' has changed; re-reading symbols.\n",
--- 1374,1379 ----
*************** reread_symbols ()
*** 1418,1428 ****
  	      /* Save the offsets, we will nuke them with the rest of the
  	         psymbol_obstack.  */
  	      num_offsets = objfile->num_sections;
! 	      section_offsets_size =
! 		sizeof (struct section_offsets)
! 	      + sizeof (objfile->section_offsets->offsets) * num_offsets;
! 	      offsets = (struct section_offsets *) alloca (section_offsets_size);
! 	      memcpy (offsets, objfile->section_offsets, section_offsets_size);
  
  	      /* Nuke all the state that we will re-read.  Much of the following
  	         code which sets things to NULL really is necessary to tell
--- 1412,1419 ----
  	      /* Save the offsets, we will nuke them with the rest of the
  	         psymbol_obstack.  */
  	      num_offsets = objfile->num_sections;
! 	      offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
! 	      memcpy (offsets, objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
  
  	      /* Nuke all the state that we will re-read.  Much of the following
  	         code which sets things to NULL really is necessary to tell
*************** reread_symbols ()
*** 1479,1486 ****
  	      /* We use the same section offsets as from last time.  I'm not
  	         sure whether that is always correct for shared libraries.  */
  	      objfile->section_offsets = (struct section_offsets *)
! 		obstack_alloc (&objfile->psymbol_obstack, section_offsets_size);
! 	      memcpy (objfile->section_offsets, offsets, section_offsets_size);
  	      objfile->num_sections = num_offsets;
  
  	      /* What the hell is sym_new_init for, anyway?  The concept of
--- 1470,1477 ----
  	      /* We use the same section offsets as from last time.  I'm not
  	         sure whether that is always correct for shared libraries.  */
  	      objfile->section_offsets = (struct section_offsets *)
! 		obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
! 	      memcpy (objfile->section_offsets, offsets, SIZEOF_SECTION_OFFSETS);
  	      objfile->num_sections = num_offsets;
  
  	      /* What the hell is sym_new_init for, anyway?  The concept of
*************** again2:
*** 2036,2052 ****
  
  /* Allocate and partially fill a partial symtab.  It will be
     completely filled at the end of the symbol list.
- 
-    SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR
-    is the address relative to which its symbols are (incremental) or 0
-    (normal). */
  
  
  struct partial_symtab *
! start_psymtab_common (objfile, section_offsets,
! 		      filename, textlow, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       CORE_ADDR textlow;
       struct partial_symbol **global_syms;
--- 2027,2038 ----
  
  /* Allocate and partially fill a partial symtab.  It will be
     completely filled at the end of the symbol list.
  
+    FILENAME is the name of the symbol-file we are reading from. */
  
  struct partial_symtab *
! start_psymtab_common (objfile, filename, textlow, global_syms, static_syms)
       struct objfile *objfile;
       char *filename;
       CORE_ADDR textlow;
       struct partial_symbol **global_syms;
*************** start_psymtab_common (objfile, section_o
*** 2055,2061 ****
    struct partial_symtab *psymtab;
  
    psymtab = allocate_psymtab (filename, objfile);
!   psymtab->section_offsets = section_offsets;
    psymtab->textlow = textlow;
    psymtab->texthigh = psymtab->textlow;		/* default */
    psymtab->globals_offset = global_syms - objfile->global_psymbols.list;
--- 2041,2049 ----
    struct partial_symtab *psymtab;
  
    psymtab = allocate_psymtab (filename, objfile);
! #if 0
!   psymtab->psymtab_section_offsets = objfile->section_offsets;
! #endif
    psymtab->textlow = textlow;
    psymtab->texthigh = psymtab->textlow;		/* default */
    psymtab->globals_offset = global_syms - objfile->global_psymbols.list;
Index: symfile.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/symfile.h,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 symfile.h
*** symfile.h	1999/08/09 21:33:56	1.1.1.3
--- symfile.h	1999/09/07 04:17:48
*************** struct sym_fns
*** 77,88 ****
  
      void (*sym_init) PARAMS ((struct objfile *));
  
!     /* sym_read (objfile, addr, mainline)
         Reads a symbol file into a psymtab (or possibly a symtab).
         OBJFILE is the objfile struct for the file we are reading.
-        SECTION_OFFSETS
-        are the offset between the file's specified section addresses and
-        their true addresses in memory.
         MAINLINE is 1 if this is the
         main symbol table being read, and 0 if a secondary
         symbol file (e.g. shared library or dynamically loaded file)
--- 77,85 ----
  
      void (*sym_init) PARAMS ((struct objfile *));
  
!     /* sym_read (objfile, mainline)
         Reads a symbol file into a psymtab (or possibly a symtab).
         OBJFILE is the objfile struct for the file we are reading.
         MAINLINE is 1 if this is the
         main symbol table being read, and 0 if a secondary
         symbol file (e.g. shared library or dynamically loaded file)
*************** struct sym_fns
*** 100,108 ****
         The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility
         with the higher levels of GDB.  It should probably be changed to
         a string, where NULL means the default, and others are parsed in a file
!        dependent way.  The result of this function is handed in to sym_read.  */
  
!     struct section_offsets *(*sym_offsets) PARAMS ((struct objfile *, CORE_ADDR));
  
      /* Finds the next struct sym_fns.  They are allocated and initialized
         in whatever module implements the functions pointed to; an 
--- 97,105 ----
         The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility
         with the higher levels of GDB.  It should probably be changed to
         a string, where NULL means the default, and others are parsed in a file
!        dependent way. */
  
!     void (*sym_offsets) PARAMS ((struct objfile *, CORE_ADDR));
  
      /* Finds the next struct sym_fns.  They are allocated and initialized
         in whatever module implements the functions pointed to; an 
*************** struct sym_fns
*** 115,121 ****
  /* The default version of sym_fns.sym_offsets for readers that don't
     do anything special.  */
  
! extern struct section_offsets *
  default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
  
  
--- 112,118 ----
  /* The default version of sym_fns.sym_offsets for readers that don't
     do anything special.  */
  
! extern void
  default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
  
  
*************** extern void
*** 167,173 ****
  new_symfile_objfile PARAMS ((struct objfile *, int, int));
  
  extern struct partial_symtab *
!   start_psymtab_common PARAMS ((struct objfile *, struct section_offsets *,
  				char *, CORE_ADDR,
  				struct partial_symbol **,
  				struct partial_symbol **));
--- 164,170 ----
  new_symfile_objfile PARAMS ((struct objfile *, int, int));
  
  extern struct partial_symtab *
!   start_psymtab_common PARAMS ((struct objfile *,
  				char *, CORE_ADDR,
  				struct partial_symbol **,
  				struct partial_symbol **));
*************** extern CORE_ADDR
*** 270,285 ****
  /* From dwarfread.c */
  
  extern void
! dwarf_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int,
! 			   file_ptr, unsigned int, file_ptr, unsigned int));
  
  /* From dwarf2read.c */
  
  extern int dwarf2_has_info PARAMS ((bfd * abfd));
  
- extern void dwarf2_build_psymtabs PARAMS ((struct objfile *,
- 					   struct section_offsets *,
- 					   int));
  /* From mdebugread.c */
  
  /* Hack to force structures to exist before use in parameter list.  */
--- 267,281 ----
  /* From dwarfread.c */
  
  extern void
! dwarf_build_psymtabs PARAMS ((struct objfile *, int, file_ptr, unsigned int,
! 			      file_ptr, unsigned int));
  
  /* From dwarf2read.c */
  
  extern int dwarf2_has_info PARAMS ((bfd * abfd));
+ 
+ extern void dwarf2_build_psymtabs PARAMS ((struct objfile *, int));
  
  /* From mdebugread.c */
  
  /* Hack to force structures to exist before use in parameter list.  */
*************** struct ecoff_debug_hack
*** 291,303 ****
  extern void
  mdebug_build_psymtabs PARAMS ((struct objfile *,
  			       const struct ecoff_debug_swap *,
! 			       struct ecoff_debug_info *,
! 			       struct section_offsets *));
  
  extern void
  elfmdebug_build_psymtabs PARAMS ((struct objfile *,
  				  const struct ecoff_debug_swap *,
! 				  asection *,
! 				  struct section_offsets *));
  
  #endif /* !defined(SYMFILE_H) */
--- 287,297 ----
  extern void
  mdebug_build_psymtabs PARAMS ((struct objfile *,
  			       const struct ecoff_debug_swap *,
! 			       struct ecoff_debug_info *));
  
  extern void
  elfmdebug_build_psymtabs PARAMS ((struct objfile *,
  				  const struct ecoff_debug_swap *,
! 				  asection *));
  
  #endif /* !defined(SYMFILE_H) */
Index: symmisc.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/symmisc.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 symmisc.c
*** symmisc.c	1999/07/07 20:10:31	1.1.1.3
--- symmisc.c	1999/09/07 04:18:06
*************** dump_psymtab (objfile, psymtab, outfile)
*** 370,386 ****
        fprintf_filtered (outfile, ")\n");
      }
  
    fprintf_filtered (outfile, "  Relocate symbols by ");
    for (i = 0; i < psymtab->objfile->num_sections; ++i)
      {
        if (i != 0)
  	fprintf_filtered (outfile, ", ");
        wrap_here ("    ");
!       print_address_numeric (ANOFFSET (psymtab->section_offsets, i),
  			     1,
  			     outfile);
      }
    fprintf_filtered (outfile, "\n");
  
    fprintf_filtered (outfile, "  Symbols cover text addresses ");
    print_address_numeric (psymtab->textlow, 1, outfile);
--- 370,388 ----
        fprintf_filtered (outfile, ")\n");
      }
  
+ #if 0
    fprintf_filtered (outfile, "  Relocate symbols by ");
    for (i = 0; i < psymtab->objfile->num_sections; ++i)
      {
        if (i != 0)
  	fprintf_filtered (outfile, ", ");
        wrap_here ("    ");
!       print_address_numeric (ANOFFSET (psymtab->psymtab_section_offsets, i),
  			     1,
  			     outfile);
      }
    fprintf_filtered (outfile, "\n");
+ #endif
  
    fprintf_filtered (outfile, "  Symbols cover text addresses ");
    print_address_numeric (psymtab->textlow, 1, outfile);
Index: symtab.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/symtab.h,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 symtab.h
*** symtab.h	1999/07/07 20:10:34	1.1.1.3
--- symtab.h	1999/09/07 04:18:29
*************** struct symtab
*** 854,860 ****
      int block_line_section;
  
      /* If several symtabs share a blockvector, exactly one of them
!        should be designed the primary, so that the blockvector
         is relocated exactly once by objfile_relocate.  */
  
      int primary;
--- 854,860 ----
      int block_line_section;
  
      /* If several symtabs share a blockvector, exactly one of them
!        should be designated the primary, so that the blockvector
         is relocated exactly once by objfile_relocate.  */
  
      int primary;
*************** struct partial_symtab
*** 953,959 ****
  
      /* Set of relocation offsets to apply to each section.  */
  
!     struct section_offsets *section_offsets;
  
      /* Range of text addresses covered by this file; texthigh is the
         beginning of the next section. */
--- 953,961 ----
  
      /* Set of relocation offsets to apply to each section.  */
  
! #if 0
!     struct section_offsets *psymtab_section_offsets;
! #endif
  
      /* Range of text addresses covered by this file; texthigh is the
         beginning of the next section. */
Index: xcoffread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/xcoffread.c,v
retrieving revision 1.1.1.5
diff -c -p -r1.1.1.5 xcoffread.c
*** xcoffread.c	1999/08/09 21:34:01	1.1.1.5
--- xcoffread.c	1999/09/07 04:18:58
*************** static void
*** 199,205 ****
  xcoff_initial_scan PARAMS ((struct objfile *, int));
  
  static void
! scan_xcoff_symtab PARAMS ((struct section_offsets *, struct objfile *));
  
  static char *
    xcoff_next_symbol_text PARAMS ((struct objfile *));
--- 199,205 ----
  xcoff_initial_scan PARAMS ((struct objfile *, int));
  
  static void
! scan_xcoff_symtab PARAMS ((struct objfile *));
  
  static char *
    xcoff_next_symbol_text PARAMS ((struct objfile *));
*************** xcoff_new_init PARAMS ((struct objfile *
*** 223,229 ****
  static void
  xcoff_symfile_finish PARAMS ((struct objfile *));
  
! static struct section_offsets *
    xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
  
  static void
--- 223,229 ----
  static void
  xcoff_symfile_finish PARAMS ((struct objfile *));
  
! static void
    xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
  
  static void
*************** init_stringtab (abfd, offset, objfile)
*** 1997,2003 ****
  static unsigned int first_fun_line_offset;
  
  static struct partial_symtab *xcoff_start_psymtab
!   PARAMS ((struct objfile *, struct section_offsets *, char *, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  /* Allocate and partially fill a partial symtab.  It will be
--- 1997,2003 ----
  static unsigned int first_fun_line_offset;
  
  static struct partial_symtab *xcoff_start_psymtab
!   PARAMS ((struct objfile *, char *, int,
  	   struct partial_symbol **, struct partial_symbol **));
  
  /* Allocate and partially fill a partial symtab.  It will be
*************** static struct partial_symtab *xcoff_star
*** 2008,2026 ****
     (normal). */
  
  static struct partial_symtab *
! xcoff_start_psymtab (objfile, section_offsets,
! 		     filename, first_symnum, global_syms, static_syms)
       struct objfile *objfile;
-      struct section_offsets *section_offsets;
       char *filename;
       int first_symnum;
       struct partial_symbol **global_syms;
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, section_offsets,
  			filename,
!   /* We fill in textlow later.  */
  			0,
  			global_syms, static_syms);
  
--- 2008,2025 ----
     (normal). */
  
  static struct partial_symtab *
! xcoff_start_psymtab (objfile, filename, first_symnum, global_syms,
! 		     static_syms)
       struct objfile *objfile;
       char *filename;
       int first_symnum;
       struct partial_symbol **global_syms;
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile,
  			filename,
! 			/* We fill in textlow later.  */
  			0,
  			global_syms, static_syms);
  
*************** xcoff_end_psymtab (pst, include_list, nu
*** 2090,2096 ****
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
!       subpst->section_offsets = pst->section_offsets;
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
--- 2089,2097 ----
        struct partial_symtab *subpst =
        allocate_psymtab (include_list[i], objfile);
  
! #if 0
!       subpst->psymtab_section_offsets = pst->psymtab_section_offsets;
! #endif
        subpst->read_symtab_private =
  	(char *) obstack_alloc (&objfile->psymbol_obstack,
  				sizeof (struct symloc));
*************** swap_sym (symbol, aux, name, raw, symnum
*** 2203,2210 ****
  }
  
  static void
! scan_xcoff_symtab (section_offsets, objfile)
!      struct section_offsets *section_offsets;
       struct objfile *objfile;
  {
    CORE_ADDR toc_offset = 0;	/* toc offset value in data section. */
--- 2204,2210 ----
  }
  
  static void
! scan_xcoff_symtab (objfile)
       struct objfile *objfile;
  {
    CORE_ADDR toc_offset = 0;	/* toc offset value in data section. */
*************** scan_xcoff_symtab (section_offsets, objf
*** 2335,2341 ****
  			    /* Give all psymtabs for this source file the same
  			       name.  */
  			    pst = xcoff_start_psymtab
! 			      (objfile, section_offsets,
  			       filestring,
  			       symnum_before,
  			       objfile->global_psymbols.next,
--- 2335,2341 ----
  			    /* Give all psymtabs for this source file the same
  			       name.  */
  			    pst = xcoff_start_psymtab
! 			      (objfile,
  			       filestring,
  			       symnum_before,
  			       objfile->global_psymbols.next,
*************** scan_xcoff_symtab (section_offsets, objf
*** 2515,2521 ****
  	    else
  	      filestring = namestring;
  
! 	    pst = xcoff_start_psymtab (objfile, section_offsets,
  				       filestring,
  				       symnum_before,
  				       objfile->global_psymbols.next,
--- 2515,2521 ----
  	    else
  	      filestring = namestring;
  
! 	    pst = xcoff_start_psymtab (objfile,
  				       filestring,
  				       symnum_before,
  				       objfile->global_psymbols.next,
*************** scan_xcoff_symtab (section_offsets, objf
*** 2608,2614 ****
  /* START_PSYMTAB and END_PSYMTAB are never used, because they are only
     called from DBXREAD_ONLY or N_SO code.  Likewise for the symnum
     variable.  */
! #define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms) 0
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
    do {} while (0)
  /* We have already set the namestring.  */
--- 2608,2614 ----
  /* START_PSYMTAB and END_PSYMTAB are never used, because they are only
     called from DBXREAD_ONLY or N_SO code.  Likewise for the symnum
     variable.  */
! #define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms) 0
  #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
    do {} while (0)
  /* We have already set the namestring.  */
*************** xcoff_initial_scan (objfile, mainline)
*** 2750,2756 ****
    /* Now that the symbol table data of the executable file are all in core,
       process them and define symbols accordingly.  */
  
!   scan_xcoff_symtab (objfile->section_offsets, objfile);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. */
--- 2750,2756 ----
    /* Now that the symbol table data of the executable file are all in core,
       process them and define symbols accordingly.  */
  
!   scan_xcoff_symtab (objfile);
  
    /* Install any minimal symbols that have been collected as the current
       minimal symbols for this objfile. */
*************** xcoff_initial_scan (objfile, mainline)
*** 2760,2775 ****
    do_cleanups (back_to);
  }
  
! static struct section_offsets *
  xcoff_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);
  
    /* syms_from_objfile kindly subtracts from addr the bfd_section_vma
--- 2760,2774 ----
    do_cleanups (back_to);
  }
  
! static void
  xcoff_symfile_offsets (objfile, addr)
       struct objfile *objfile;
       CORE_ADDR addr;
  {
    int i;
  
    objfile->num_sections = SECT_OFF_MAX;
!   objfile->section_offsets = (struct section_offsets *)
      obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
  
    /* syms_from_objfile kindly subtracts from addr the bfd_section_vma
*************** xcoff_symfile_offsets (objfile, addr)
*** 2781,2789 ****
       parameter and use 0.  rs6000-nat.c will set the correct section
       offsets via objfile_relocate.  */
    for (i = 0; i < objfile->num_sections; ++i)
!     ANOFFSET (section_offsets, i) = 0;
! 
!   return section_offsets;
  }
  
  /* Register our ability to parse symbols for xcoff BFD files.  */
--- 2780,2786 ----
       parameter and use 0.  rs6000-nat.c will set the correct section
       offsets via objfile_relocate.  */
    for (i = 0; i < objfile->num_sections; ++i)
!     ANOFFSET (objfile->section_offsets, i) = 0;
  }
  
  /* Register our ability to parse symbols for xcoff BFD files.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]