* scripttempl/elfppc.sc: Remove.
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index cb040bbf9c7cab5b6ff952c8ab02421ce3ebe44f..944128293fa493896f616d1653aaa3e177cda5f4 100644 (file)
@@ -196,10 +196,10 @@ static struct complaint eb_complaint =
 {"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
 
 static void
-xcoff_initial_scan PARAMS ((struct objfile *, struct section_offsets *, int));
+xcoff_initial_scan PARAMS ((struct objfile *, int));
 
 static void
-scan_xcoff_symtab PARAMS ((struct section_offsets *, struct objfile *));
+scan_xcoff_symtab PARAMS ((struct objfile *));
 
 static char *
   xcoff_next_symbol_text PARAMS ((struct objfile *));
@@ -223,8 +223,8 @@ xcoff_new_init PARAMS ((struct objfile *));
 static void
 xcoff_symfile_finish PARAMS ((struct objfile *));
 
-static struct section_offsets *
-  xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
+static void
+  xcoff_symfile_offsets PARAMS ((struct objfile *, struct section_addr_info *addrs));
 
 static void
 find_linenos PARAMS ((bfd *, sec_ptr, PTR));
@@ -753,7 +753,7 @@ process_linenos (start, end)
            start_subfile (fakename, (char *) 0);
            free (current_subfile->name);
          }
-         current_subfile->name = strdup (inclTable[ii].name);
+         current_subfile->name = xstrdup (inclTable[ii].name);
 #endif
 
          if (lv == lineTb)
@@ -1827,7 +1827,7 @@ xcoff_psymtab_to_symtab_1 (pst)
       /* Init stuff necessary for reading in symbols.  */
       stabsread_init ();
       buildsym_init ();
-      old_chain = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+      old_chain = make_cleanup (really_free_pendings, 0);
 
       read_xcoff_symtab (pst);
       sort_symtab_syms (pst->symtab);
@@ -1997,7 +1997,7 @@ init_stringtab (abfd, offset, objfile)
 static unsigned int first_fun_line_offset;
 
 static struct partial_symtab *xcoff_start_psymtab
-  PARAMS ((struct objfile *, struct section_offsets *, char *, int,
+  PARAMS ((struct objfile *, char *, int,
           struct partial_symbol **, struct partial_symbol **));
 
 /* Allocate and partially fill a partial symtab.  It will be
@@ -2008,19 +2008,18 @@ static struct partial_symtab *xcoff_start_psymtab
    (normal). */
 
 static struct partial_symtab *
-xcoff_start_psymtab (objfile, section_offsets,
-                    filename, first_symnum, global_syms, static_syms)
+xcoff_start_psymtab (objfile, 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,
+  start_psymtab_common (objfile, objfile->section_offsets,
                        filename,
-  /* We fill in textlow later.  */
+                       /* We fill in textlow later.  */
                        0,
                        global_syms, static_syms);
 
@@ -2203,8 +2202,7 @@ swap_sym (symbol, aux, name, raw, symnump, objfile)
 }
 
 static void
-scan_xcoff_symtab (section_offsets, objfile)
-     struct section_offsets *section_offsets;
+scan_xcoff_symtab (objfile)
      struct objfile *objfile;
 {
   CORE_ADDR toc_offset = 0;    /* toc offset value in data section. */
@@ -2230,7 +2228,7 @@ scan_xcoff_symtab (section_offsets, objfile)
 
   char *sraw_symbol;
   struct internal_syment symbol;
-  union internal_auxent main_aux;
+  union internal_auxent main_aux[5];
   unsigned int ssymnum;
 
   char *last_csect_name = NULL;        /* last seen csect's name and value */
@@ -2279,7 +2277,7 @@ scan_xcoff_symtab (section_offsets, objfile)
            union internal_auxent csect_aux;
            unsigned int symnum_before = ssymnum;
 
-           swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
+           swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
                      &ssymnum, objfile);
            if (symbol.n_numaux > 1)
              {
@@ -2293,7 +2291,7 @@ scan_xcoff_symtab (section_offsets, objfile)
                   &csect_aux);
              }
            else
-             csect_aux = main_aux;
+             csect_aux = main_aux[0];
 
            /* If symbol name starts with ".$" or "$", ignore it.  */
            if (namestring[0] == '$'
@@ -2335,7 +2333,7 @@ scan_xcoff_symtab (section_offsets, objfile)
                            /* Give all psymtabs for this source file the same
                               name.  */
                            pst = xcoff_start_psymtab
-                             (objfile, section_offsets,
+                             (objfile,
                               filestring,
                               symnum_before,
                               objfile->global_psymbols.next,
@@ -2401,7 +2399,7 @@ scan_xcoff_symtab (section_offsets, objfile)
 
                    if (first_fun_line_offset == 0 && symbol.n_numaux > 1)
                      first_fun_line_offset =
-                       main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
+                       main_aux[0].x_sym.x_fcnary.x_fcn.x_lnnoptr;
                    RECORD_MINIMAL_SYMBOL
                      (namestring, symbol.n_value,
                       sclass == C_HIDEXT ? mst_file_text : mst_text,
@@ -2476,7 +2474,7 @@ scan_xcoff_symtab (section_offsets, objfile)
            unsigned int symnum_before;
 
            symnum_before = ssymnum;
-           swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
+           swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
                      &ssymnum, objfile);
 
            /* See if the last csect needs to be recorded.  */
@@ -2510,12 +2508,12 @@ scan_xcoff_symtab (section_offsets, objfile)
               exists, otherwise use the symbol itself.  */
            if (!strcmp (namestring, ".file") && symbol.n_numaux > 0)
              {
-               filestring = coff_getfilename (&main_aux, objfile);
+               filestring = coff_getfilename (&main_aux[0], objfile);
              }
            else
              filestring = namestring;
 
-           pst = xcoff_start_psymtab (objfile, section_offsets,
+           pst = xcoff_start_psymtab (objfile,
                                       filestring,
                                       symnum_before,
                                       objfile->global_psymbols.next,
@@ -2600,7 +2598,7 @@ scan_xcoff_symtab (section_offsets, objfile)
        case C_STSYM:
          stype = N_LSYM;
        pstab:;
-         swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
+         swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
                    &ssymnum, objfile);
 #define CUR_SYMBOL_TYPE stype
 #define CUR_SYMBOL_VALUE symbol.n_value
@@ -2608,7 +2606,7 @@ scan_xcoff_symtab (section_offsets, objfile)
 /* 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 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.  */
@@ -2654,9 +2652,8 @@ get_toc_offset (objfile)
    table (as opposed to a shared lib or dynamically loaded file).  */
 
 static void
-xcoff_initial_scan (objfile, section_offsets, mainline)
+xcoff_initial_scan (objfile, mainline)
      struct objfile *objfile;
-     struct section_offsets *section_offsets;
      int mainline;             /* FIXME comments above */
 {
   bfd *abfd;
@@ -2743,7 +2740,7 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
     init_psymbol_list (objfile, num_symbols);
 
   free_pending_blocks ();
-  back_to = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+  back_to = make_cleanup (really_free_pendings, 0);
 
   init_minimal_symbol_collection ();
   make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
@@ -2751,7 +2748,7 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
   /* Now that the symbol table data of the executable file are all in core,
      process them and define symbols accordingly.  */
 
-  scan_xcoff_symtab (section_offsets, objfile);
+  scan_xcoff_symtab (objfile);
 
   /* Install any minimal symbols that have been collected as the current
      minimal symbols for this objfile. */
@@ -2761,20 +2758,16 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
   do_cleanups (back_to);
 }
 \f
-static struct section_offsets *
-xcoff_symfile_offsets (objfile, addr)
+static void
+xcoff_symfile_offsets (objfile, addrs)
      struct objfile *objfile;
-     CORE_ADDR addr;
+     struct section_addr_info *addrs;
 {
-  struct section_offsets *section_offsets;
   int i;
 
   objfile->num_sections = SECT_OFF_MAX;
-  section_offsets = (struct section_offsets *)
-    obstack_alloc
-    (&objfile->psymbol_obstack,
-     sizeof (struct section_offsets)
-     + sizeof (section_offsets->offsets) * objfile->num_sections);
+  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
      of the .text section.  This strikes me as wrong--whether the
@@ -2785,9 +2778,7 @@ xcoff_symfile_offsets (objfile, addr)
      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;
+    ANOFFSET (objfile->section_offsets, i) = 0;
 }
 
 /* Register our ability to parse symbols for xcoff BFD files.  */
This page took 0.02691 seconds and 4 git commands to generate.