* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
[deliverable/binutils-gdb.git] / gdb / remote.c
index e55e141ab0bdf71d33663c80e57f5fc1cdf151b5..2adbc1379dd34d9a1e6cf34323126d325b4dd98e 100644 (file)
@@ -1989,8 +1989,10 @@ get_offsets (void)
   if (symfile_objfile == NULL)
     return;
 
-  offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
-  memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
+  offs = ((struct section_offsets *) 
+         alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)));
+  memcpy (offs, symfile_objfile->section_offsets, 
+         SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
 
   offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
 
@@ -2101,8 +2103,10 @@ remote_cisco_objfile_relocate (bfd_signed_vma text_off, bfd_signed_vma data_off,
          broken for xcoff, dwarf, sdb-coff, etc.  But there is no
          simple canonical representation for this stuff.  */
 
-      offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
-      memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
+      offs = (struct section_offsets *) 
+       alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
+      memcpy (offs, symfile_objfile->section_offsets, 
+             SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
 
       offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_off;
       offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_off;
This page took 0.023805 seconds and 4 git commands to generate.