*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / somread.c
index 654ae067f753c5c36f0b1267ab309ef3e100d2aa..e3df6e167a1dfa5c95ab7cb9201264492242ca12 100644 (file)
@@ -430,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
@@ -452,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;
     }
 }
This page took 0.023523 seconds and 4 git commands to generate.