* config/obj-aout.h: Fix comment typos.
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index dd6541a1529d218e30af96643805a1942722c46f..6183785db6906236d4ffa6f6f92fd32392b47fcc 100644 (file)
@@ -193,8 +193,6 @@ static void xcoff_symfile_finish (struct objfile *);
 static void xcoff_symfile_offsets (struct objfile *,
                                   struct section_addr_info *addrs);
 
-static void find_linenos (bfd *, sec_ptr, void *);
-
 static char *coff_getfilename (union internal_auxent *, struct objfile *);
 
 static void read_symbol (struct internal_syment *, int);
@@ -1438,10 +1436,10 @@ static struct type *var_symbol_type;
 /* process one xcoff symbol. */
 
 static struct symbol *
-process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile)
+process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
 {
   struct symbol onesymbol;
-  register struct symbol *sym = &onesymbol;
+  struct symbol *sym = &onesymbol;
   struct symbol *sym2 = NULL;
   char *name, *pp;
 
@@ -1469,7 +1467,7 @@ process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile)
 
   /* default assumptions */
   SYMBOL_VALUE_ADDRESS (sym) = cs->c_value + off;
-  SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+  SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
   SYMBOL_SECTION (sym) = secnum_to_section (cs->c_secnum, objfile);
 
   if (ISFCN (cs->c_type))
@@ -1699,7 +1697,7 @@ gotit:
  * mainline code can read the whole thing for efficiency.
  */
 static void
-find_linenos (bfd *abfd, sec_ptr asect, void *vpinfo)
+find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
 {
   struct coff_symfile_info *info;
   int size, count;
@@ -1767,7 +1765,6 @@ xcoff_psymtab_to_symtab_1 (struct partial_symtab *pst)
       old_chain = make_cleanup (really_free_pendings, 0);
 
       read_xcoff_symtab (pst);
-      sort_symtab_syms (pst->symtab);
 
       do_cleanups (old_chain);
     }
@@ -2536,7 +2533,7 @@ scan_xcoff_symtab (struct objfile *objfile)
            if (pst && STREQ (namestring, pst->filename))
              continue;
            {
-             register int i;
+             int i;
              for (i = 0; i < includes_used; i++)
                if (STREQ (namestring, psymtab_include_list[i]))
                  {
@@ -2593,7 +2590,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                namestring = STATIC_TRANSFORM_NAME (namestring);
 #endif
                add_psymbol_to_list (namestring, p - namestring,
-                                    VAR_NAMESPACE, LOC_STATIC,
+                                    VAR_DOMAIN, LOC_STATIC,
                                     &objfile->static_psymbols,
                                     0, symbol.n_value,
                                     psymtab_language, objfile);
@@ -2604,7 +2601,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                /* The addresses in these entries are reported to be
                   wrong.  See the code that reads 'G's for symtabs. */
                add_psymbol_to_list (namestring, p - namestring,
-                                    VAR_NAMESPACE, LOC_STATIC,
+                                    VAR_DOMAIN, LOC_STATIC,
                                     &objfile->global_psymbols,
                                     0, symbol.n_value,
                                     psymtab_language, objfile);
@@ -2622,7 +2619,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                        && namestring[0] != ' '))
                  {
                    add_psymbol_to_list (namestring, p - namestring,
-                                        STRUCT_NAMESPACE, LOC_TYPEDEF,
+                                        STRUCT_DOMAIN, LOC_TYPEDEF,
                                         &objfile->static_psymbols,
                                         symbol.n_value, 0,
                                         psymtab_language, objfile);
@@ -2630,28 +2627,12 @@ scan_xcoff_symtab (struct objfile *objfile)
                      {
                        /* Also a typedef with the same name.  */
                        add_psymbol_to_list (namestring, p - namestring,
-                                            VAR_NAMESPACE, LOC_TYPEDEF,
+                                            VAR_DOMAIN, LOC_TYPEDEF,
                                             &objfile->static_psymbols,
                                             symbol.n_value, 0,
                                             psymtab_language, objfile);
                        p += 1;
                      }
-#if 0 /* OBSOLETE CFront */
-// OBSOLETE                /* The semantics of C++ state that "struct foo { ... }"
-// OBSOLETE                   also defines a typedef for "foo".  Unfortuantely, cfront
-// OBSOLETE                   never makes the typedef when translating from C++ to C.
-// OBSOLETE                   We make the typedef here so that "ptype foo" works as
-// OBSOLETE                   expected for cfront translated code.  */
-// OBSOLETE                else if (psymtab_language == language_cplus)
-// OBSOLETE                  {
-// OBSOLETE                    /* Also a typedef with the same name.  */
-// OBSOLETE                    add_psymbol_to_list (namestring, p - namestring,
-// OBSOLETE                                         VAR_NAMESPACE, LOC_TYPEDEF,
-// OBSOLETE                                         &objfile->static_psymbols,
-// OBSOLETE                                         symbol.n_value, 0,
-// OBSOLETE                                         psymtab_language, objfile);
-// OBSOLETE                  }
-#endif /* OBSOLETE CFront */
                  }
                goto check_enum;
 
@@ -2659,7 +2640,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                if (p != namestring)    /* a name is there, not just :T... */
                  {
                    add_psymbol_to_list (namestring, p - namestring,
-                                        VAR_NAMESPACE, LOC_TYPEDEF,
+                                        VAR_DOMAIN, LOC_TYPEDEF,
                                         &objfile->static_psymbols,
                                         symbol.n_value, 0,
                                         psymtab_language, objfile);
@@ -2721,7 +2702,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                        /* Note that the value doesn't matter for
                           enum constants in psymtabs, just in symtabs.  */
                        add_psymbol_to_list (p, q - p,
-                                            VAR_NAMESPACE, LOC_CONST,
+                                            VAR_DOMAIN, LOC_CONST,
                                             &objfile->static_psymbols, 0,
                                             0, psymtab_language, objfile);
                        /* Point past the name.  */
@@ -2739,7 +2720,7 @@ scan_xcoff_symtab (struct objfile *objfile)
              case 'c':
                /* Constant, e.g. from "const" in Pascal.  */
                add_psymbol_to_list (namestring, p - namestring,
-                                    VAR_NAMESPACE, LOC_CONST,
+                                    VAR_DOMAIN, LOC_CONST,
                                     &objfile->static_psymbols, symbol.n_value,
                                     0, psymtab_language, objfile);
                continue;
@@ -2756,7 +2737,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                  }
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
                add_psymbol_to_list (namestring, p - namestring,
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->static_psymbols,
                                     0, symbol.n_value,
                                     psymtab_language, objfile);
@@ -2777,7 +2758,7 @@ scan_xcoff_symtab (struct objfile *objfile)
                  }
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
                add_psymbol_to_list (namestring, p - namestring,
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->global_psymbols,
                                     0, symbol.n_value,
                                     psymtab_language, objfile);
@@ -2800,11 +2781,6 @@ scan_xcoff_symtab (struct objfile *objfile)
              case '9':
              case '-':
              case '#':         /* for symbol identification (used in live ranges) */
-#if 0 /* OBSOLETE CFront */
-// OBSOLETE            /* added to support cfront stabs strings */
-// OBSOLETE          case 'Z':         /* for definition continuations */
-// OBSOLETE          case 'P':         /* for prototypes */
-#endif /* OBSOLETE CFront */
                continue;
 
              case ':':
@@ -2903,7 +2879,7 @@ xcoff_initial_scan (struct objfile *objfile, int mainline)
 
       /* Read the .debug section, if present.  */
       {
-       sec_ptr secp;
+       struct bfd_section *secp;
        bfd_size_type length;
        char *debugsec = NULL;
 
@@ -2981,9 +2957,10 @@ xcoff_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
   asection *sect = NULL;
   int i;
 
-  objfile->num_sections = SECT_OFF_MAX;
+  objfile->num_sections = bfd_count_sections (objfile->obfd);
   objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
+    obstack_alloc (&objfile->psymbol_obstack, 
+                  SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
 
   /* Initialize the section indexes for future use. */
   sect = bfd_get_section_by_name (objfile->obfd, ".text");
This page took 0.026349 seconds and 4 git commands to generate.