Change section_offsets to a std::vector
[deliverable/binutils-gdb.git] / gdb / solib-svr4.c
index daf803fb65f2d6778d0db3256f92edaf937b199f..2d275f2b9c077d9b4b5242e359e6909e3347af49 100644 (file)
@@ -2273,8 +2273,7 @@ enable_break (struct svr4_info *info, int from_tty)
          CORE_ADDR load_addr;
 
          tmp_bfd = os->objfile->obfd;
-         load_addr = ANOFFSET (os->objfile->section_offsets,
-                               SECT_OFF_TEXT (os->objfile));
+         load_addr = os->objfile->section_offsets[SECT_OFF_TEXT (os->objfile)];
 
          interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
          if (interp_sect)
@@ -2975,15 +2974,8 @@ svr4_relocate_main_executable (void)
 
   if (symfile_objfile)
     {
-      struct section_offsets *new_offsets;
-      int i;
-
-      new_offsets = XALLOCAVEC (struct section_offsets,
-                               symfile_objfile->num_sections);
-
-      for (i = 0; i < symfile_objfile->num_sections; i++)
-       new_offsets->offsets[i] = displacement;
-
+      section_offsets new_offsets (symfile_objfile->section_offsets.size (),
+                                  displacement);
       objfile_relocate (symfile_objfile, new_offsets);
     }
   else if (exec_bfd)
This page took 0.024151 seconds and 4 git commands to generate.