Change section_offsets to a std::vector
[deliverable/binutils-gdb.git] / gdb / machoread.c
index f7dc280617532fb8af081f1bc281a87953a4ed6b..2bb3ab32cb30d21048479b6cd570b849180f16c8 100644 (file)
@@ -907,12 +907,7 @@ macho_symfile_offsets (struct objfile *objfile,
   struct obj_section *osect;
 
   /* Allocate section_offsets.  */
-  objfile->num_sections = bfd_count_sections (objfile->obfd);
-  objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->objfile_obstack,
-                   SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
-  memset (objfile->section_offsets, 0,
-          SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
+  objfile->section_offsets.assign (bfd_count_sections (objfile->obfd), 0);
 
   /* This code is run when we first add the objfile with
      symfile_add_with_addrs_or_offsets, when "addrs" not "offsets" are
This page took 0.024906 seconds and 4 git commands to generate.