* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index 5a0b2862fef90c5542a0f6358e7638aafd01df20..de23d5d054ab86df3a1eecb2174a7af79f20fc27 100644 (file)
@@ -2981,9 +2981,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.027272 seconds and 4 git commands to generate.