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]

simplification of section offsets handling


This patch continues the work started in an early change, which
simplifies section offset handling by avoiding passing both a
pointer to the section offsets and the objfile pointer, which
also points to the same section offsets.

-Fred

Index: ChangeLog
===================================================================
RCS file: /cvs/gdb/gdb/gdb/ChangeLog,v
retrieving revision 1.1.1.21
diff -c -p -r1.1.1.21 ChangeLog
*** ChangeLog	1999/08/23 22:34:40	1.1.1.21
--- ChangeLog	1999/08/29 20:15:02
***************
*** 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);
+ 
  Mon Aug 23 10:16:32 1999  Jeffrey A Law  (law@cygnus.com)
  
  	* pa64solib.c: Fix some minor whitespace problems.
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/08/29 20:15:17
*************** 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/08/29 20:15:54
*************** 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,1424 ****
       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 *)
--- 1412,1418 ----
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, objfile->section_offsets,
  			filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
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/08/29 20:16:02
*************** 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/08/29 20:16:41
*************** 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, objfile->section_offsets,
  				  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;
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/08/29 20:17:09
*************** 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)
  
--- 704,709 ----
*************** 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;
--- 727,735 ----
   */
  
  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
--- 763,770 ----
  
    /* Save the relocation factor where everybody can see it.  */
  
!   base_section_offsets = objfile->section_offsets;
!   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
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/08/29 20:17:15
*************** 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);
      }
Index: hp-psymtab-read.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/hp-psymtab-read.c,v
retrieving revision 1.1.1.3
diff -c -p -r1.1.1.3 hp-psymtab-read.c
*** hp-psymtab-read.c	1999/08/02 23:45:33	1.1.1.3
--- hp-psymtab-read.c	1999/08/29 20:17:36
*************** 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_
*** 517,523 ****
     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 */
--- 517,523 ----
     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
*** 526,532 ****
       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 */
--- 526,531 ----
*************** scan_procs (curr_pd_p, qPD, max_procs, s
*** 603,609 ****
  					   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);
--- 602,608 ----
  					   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
*** 616,622 ****
  					   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);
--- 615,621 ----
  					   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
*** 648,656 ****
     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 */
--- 647,654 ----
     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_
*** 863,869 ****
  	     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)),
--- 861,866 ----
*************** hpread_quick_traverse (objfile, section_
*** 965,971 ****
  	         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)),
--- 962,967 ----
*************** hpread_quick_traverse (objfile, section_
*** 981,988 ****
  	         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 */
  
--- 977,983 ----
  	         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_
*** 1195,1201 ****
  	         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)),
--- 1190,1195 ----
*************** hpread_quick_traverse (objfile, section_
*** 1211,1218 ****
  	         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 */
  
--- 1205,1211 ----
  	         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_
*** 1309,1315 ****
  	}
  #endif
        pst = hpread_start_psymtab (objfile,
- 				  section_offsets,	/* ?? */
  				  "orphans",
  				  start_adr,	/* Low text address */
  			 (CURR_PROC_ISYM * sizeof (struct dntt_type_block)),
--- 1302,1307 ----
*************** hpread_quick_traverse (objfile, section_
*** 1318,1325 ****
  				  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 */
--- 1310,1316 ----
  				  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_
*** 1341,1347 ****
       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
--- 1332,1337 ----
*************** hpread_symfile_init (objfile)
*** 1579,1592 ****
     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;
  {
  
--- 1569,1580 ----
     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_
*** 1680,1686 ****
  	   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);
--- 1668,1673 ----
*************** hpread_build_psymtabs (objfile, section_
*** 1830,1837 ****
  		  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)),
--- 1817,1824 ----
  		  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_
*** 1864,1873 ****
  	      /* 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)),
--- 1851,1860 ----
  	      /* 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_
*** 1882,1893 ****
  	    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),
--- 1869,1880 ----
  	    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_
*** 1903,1914 ****
  	      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),
--- 1890,1901 ----
  	      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_
*** 1986,1992 ****
  		SET_NAMESTRING (dn_bufp, &namestring, objfile);
  		if (!pst)
  		  {
! 		    pst = hpread_start_psymtab (objfile, section_offsets,
  						"globals", 0,
  						(hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 1973,1979 ----
  		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_
*** 1998,2004 ****
  		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
--- 1985,1991 ----
  		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_
*** 2070,2076 ****
  	      SET_NAMESTRING (dn_bufp, &namestring, objfile);
  	      if (!pst)
  		{
! 		  pst = hpread_start_psymtab (objfile, section_offsets,
  					      "globals", 0,
  					      (hp_symnum
  					 * sizeof (struct dntt_type_block)),
--- 2057,2063 ----
  	      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
*** 2213,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;
--- 2200,2218 ----
     (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, objfile->section_offsets,
  			filename, textlow, global_syms, static_syms);
  
    result->textlow += offset;
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/08/29 20:17:49
*************** 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
*************** 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;
--- 305,316 ----
     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)),
--- 466,473 ----
  		  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)),
--- 484,493 ----
  	         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,
--- 501,512 ----
  	    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)),
--- 568,574 ----
  		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)),
--- 599,605 ----
  	      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;
--- 823,831 ----
     (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;
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/08/29 20:18:51
*************** 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 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)
*** 520,530 ****
     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;
--- 519,528 ----
     different sections are relocated via the SECTION_OFFSETS.  */
  
  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
--- 546,552 ----
  	(*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
*************** 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;
--- 2272,2279 ----
     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;
    }
--- 2360,2366 ----
    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 */
--- 2474,2485 ----
  	{
  	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;
--- 2492,2503 ----
  	  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;
--- 2507,2523 ----
  	  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,
--- 2561,2571 ----
  	{
  	  textlow = fh->adr;
  	  if (relocatable || textlow != 0)
! 	    textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
  	}
        else
  	textlow = 0;
!       pst = start_psymtab_common (objfile, objfile->section_offsets,
  				  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;
--- 2649,2655 ----
  		      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,
--- 2700,2706 ----
  			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,
--- 2714,2720 ----
  			  /* 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) \
--- 2766,2772 ----
    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;
  		}
  
--- 2818,2835 ----
  		  /* 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;
  		}
  
--- 3026,3043 ----
  		{
  		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)
*** 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;
  	    }
  
--- 3561,3567 ----
  	      (*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;
  	    }
  
*************** 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 */
  
--- 4128,4141 ----
  /* 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);
!   psymtab->section_offsets = objfile->section_offsets;
  
    /* 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;
--- 4284,4293 ----
     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);
  }
  
  
--- 4300,4306 ----
      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/08/29 20:18:53
*************** mipscoff_symfile_read (objfile, mainline
*** 104,110 ****
      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.  */
  
--- 104,110 ----
      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.  */
  
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/08/29 20:19:12
*************** 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/08/29 20:19:20
*************** 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 *));
*************** os9k_process_one_symbol PARAMS ((int, in
*** 162,168 ****
  			       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 **));
  
--- 161,167 ----
  			       struct section_offsets *, 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);
--- 170,176 ----
  			    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;
  
--- 196,206 ----
  #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;
--- 208,214 ----
      {
      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;
--- 254,261 ----
  #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);
--- 310,316 ----
  	    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).  */
  
--- 322,327 ----
*************** 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));
  
--- 343,353 ----
    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;
--- 559,568 ----
  /* 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
  
--- 608,614 ----
  #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,
--- 655,661 ----
  	  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, ':');
--- 692,698 ----
  
  		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,
--- 707,713 ----
  		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;
  
--- 884,890 ----
  	      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;
  
--- 895,901 ----
  	      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;
--- 933,939 ----
  	    }
  
  	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;
--- 983,991 ----
  
  
  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,1010 ****
       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 *)
--- 994,1000 ----
       struct partial_symbol **static_syms;
  {
    struct partial_symtab *result =
!   start_psymtab_common (objfile, objfile->section_offsets,
  			filename, textlow, global_syms, static_syms);
  
    result->read_symtab_private = (char *)
*************** 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, pst->section_offsets, objfile);
  
        /* We skip checking for a new .o or -l file; that should never
           happen in this routine. */
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/08/29 20:19:25
***************
*** 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/08/29 20:19:32
*************** 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/08/29 20:19:39
*************** 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.16
diff -c -p -r1.1.1.16 remote.c
*** remote.c	1999/08/23 22:35:56	1.1.1.16
--- remote.c	1999/08/29 20:20:22
*************** get_offsets ()
*** 1501,1513 ****
    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;
  
--- 1501,1508 ----
    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,
*** 1621,1635 ****
           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;
--- 1616,1623 ----
           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",
*** 2391,2397 ****
  
  	    if (symfile_objfile == NULL)
  	      {
! 		warning ("Relocation packet recieved with no symbol file.  \
  Packet Dropped");
  		goto got_status;
  	      }
--- 2379,2385 ----
  
  	    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/08/29 20:20:28
*************** 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/08/29 20:20:34
*************** static void
*** 52,64 ****
  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 *));
--- 52,64 ----
  som_symtab_read PARAMS ((bfd *, struct objfile *,
  			 struct section_offsets *));
  
! 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 *));
*************** 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. 
--- 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, 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
--- 459,482 ----
  
     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, objfile->section_offsets))
      {
        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: 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/08/29 20:20:36
*************** 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 ----
Index: symfile.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/symfile.c,v
retrieving revision 1.1.1.8
diff -c -p -r1.1.1.8 symfile.c
*** symfile.c	1999/08/23 22:36:15	1.1.1.8
--- symfile.c	1999/08/29 20:21:00
*************** find_lowest_section (abfd, sect, obj)
*** 460,482 ****
     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;
  }
  
  
--- 460,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.  */
  
! 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
*** 566,573 ****
    (*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
--- 563,569 ----
    (*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 ()
*** 1382,1388 ****
  	      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",
--- 1378,1383 ----
*************** reread_symbols ()
*** 1421,1431 ****
  	      /* 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
--- 1416,1423 ----
  	      /* 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 ()
*** 1482,1489 ****
  	      /* 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
--- 1474,1481 ----
  	      /* 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:
*** 2039,2049 ****
  
  /* 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,
--- 2031,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, section_offsets,
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/08/29 20:21:01
*************** 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 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: 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/08/29 20:21:19
*************** 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;
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/08/29 20:21:53
*************** 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, objfile->section_offsets,
  			filename,
! 			/* We fill in textlow later.  */
  			0,
  			global_syms, static_syms);
  
*************** 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. */
--- 2202,2208 ----
  }
  
  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,
--- 2333,2339 ----
  			    /* 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,
--- 2513,2519 ----
  	    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.  */
--- 2606,2612 ----
  /* 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. */
--- 2748,2754 ----
    /* 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
--- 2758,2772 ----
    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.  */
--- 2778,2784 ----
       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]