daily update
[deliverable/binutils-gdb.git] / gdb / somread.c
index 85d4f0a537c42af3b6acd97a1774bc26f77f887f..971fea25f7387ea7de26f656e63b53013b7064e6 100644 (file)
@@ -37,6 +37,8 @@
 
 /* Various things we might complain about... */
 
+static int init_import_symbols (struct objfile *objfile);
+
 static void som_symfile_init (struct objfile *);
 
 static void som_new_init (struct objfile *);
@@ -428,9 +430,10 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
   int i;
   CORE_ADDR text_addr;
 
-  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));
 
   /* FIXME: ezannoni 2000-04-20 The section names in SOM are not
      .text, .data, etc, but $TEXT$, $DATA$,... We should initialize
@@ -450,12 +453,12 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
       /* Note: Here is OK to compare with ".text" because this is the
          name that gdb itself gives to that section, not the SOM
          name. */
-      for (i = 0; i < SECT_OFF_MAX && addrs->other[i].name; i++)
+      for (i = 0; i < objfile->num_sections && addrs->other[i].name; i++)
        if (strcmp (addrs->other[i].name, ".text") == 0)
          break;
       text_addr = addrs->other[i].addr;
 
-      for (i = 0; i < SECT_OFF_MAX; i++)
+      for (i = 0; i < objfile->num_sections; i++)
        (objfile->section_offsets)->offsets[i] = text_addr;
     }
 }
@@ -466,7 +469,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
    not defined there.  (Variables that are imported are dealt
    with as "loc_indirect" vars.)
    Return value = number of import symbols read in. */
-int
+static int
 init_import_symbols (struct objfile *objfile)
 {
   unsigned int import_list;
@@ -474,9 +477,9 @@ init_import_symbols (struct objfile *objfile)
   unsigned int string_table;
   unsigned int string_table_size;
   char *string_buffer;
-  register int i;
-  register int j;
-  register int k;
+  int i;
+  int j;
+  int k;
   asection *text_section;      /* section handle */
   unsigned int dl_header[12];  /* SOM executable header */
 
@@ -594,9 +597,9 @@ init_export_symbols (struct objfile *objfile)
   unsigned int string_table;
   unsigned int string_table_size;
   char *string_buffer;
-  register int i;
-  register int j;
-  register int k;
+  int i;
+  int j;
+  int k;
   asection *text_section;      /* section handle */
   unsigned int dl_header[12];  /* SOM executable header */
 
This page took 0.028758 seconds and 4 git commands to generate.