* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
[deliverable/binutils-gdb.git] / gdb / somread.c
index 654ae067f753c5c36f0b1267ab309ef3e100d2aa..cb7b048eafdac9c94b7bf4ede365ce9d5ee60147 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
@@ -457,7 +458,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
          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.025329 seconds and 4 git commands to generate.