]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
authorAlan Modra <amodra@gmail.com>
Tue, 15 Jun 2004 01:04:20 +0000 (01:04 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 15 Jun 2004 01:04:20 +0000 (01:04 +0000)
bfd_get_section_size_before_reloc or _raw_size.
* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
* dwarf2read.c (dwarf2_locate_sections): Likewise.
(dwarf2_read_section): Likewise.
* elfread.c (elf_locate_sections): Likewise.
* gcore.c (derive_heap_segment): Likewise.
* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
* remote-e7000.c (e7000_load): Likewise.
* remote-m32r-sdi.c (m32r_load): Likewise.
* remote-mips.c (mips_load_srec): Likewise.
(pmon_load_fast): Likewise.
* remote.c (compare_sections_command): Likewise.
* symfile.c (add_section_size_callback): Likewise.
(load_section_callback): Likewise.
(pc_in_unmapped_range): Likewise.
(pc_in_mapped_range): Likewise.
(sections_overlap): Likewise.
(list_overlays_command): Likewise.
(simple_overlay_update_1): Likewise.
(simple_overlay_update): Likewise.
* tracepoint.c (remote_set_transparent_ranges): Likewise.
* win32-nat.c (core_section_load_dll_symbols): Likewise.

15 files changed:
gdb/ChangeLog
gdb/dsrec.c
gdb/dwarf2-frame.c
gdb/dwarf2read.c
gdb/elfread.c
gdb/gcore.c
gdb/mipsread.c
gdb/remote-e7000.c
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/remote.c
gdb/symfile.c
gdb/tracepoint.c
gdb/win32-nat.c
gdb/windows-nat.c

index c5d96f644da6db009e3f065b49812db576d1b991..6bfdd49af642d2b568ba99f68ea9a14d1fb21a1f 100644 (file)
@@ -1,3 +1,29 @@
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+       * dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
+       bfd_get_section_size_before_reloc or _raw_size.
+       * dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
+       * dwarf2read.c (dwarf2_locate_sections): Likewise.
+       (dwarf2_read_section): Likewise.
+       * elfread.c (elf_locate_sections): Likewise.
+       * gcore.c (derive_heap_segment): Likewise.
+       * mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
+       * remote-e7000.c (e7000_load): Likewise.
+       * remote-m32r-sdi.c (m32r_load): Likewise.
+       * remote-mips.c (mips_load_srec): Likewise.
+       (pmon_load_fast): Likewise.
+       * remote.c (compare_sections_command): Likewise.
+       * symfile.c (add_section_size_callback): Likewise.
+       (load_section_callback): Likewise.
+       (pc_in_unmapped_range): Likewise.
+       (pc_in_mapped_range): Likewise.
+       (sections_overlap): Likewise.
+       (list_overlays_command): Likewise.
+       (simple_overlay_update_1): Likewise.
+       (simple_overlay_update): Likewise.
+       * tracepoint.c (remote_set_transparent_ranges): Likewise.
+       * win32-nat.c (core_section_load_dll_symbols): Likewise.
+
 2004-06-14  Randolph Chung  <tausq@debian.org>
 
        * Makefile.in (hppa-hpux-tdep.o): Update dependency.
index 3021052203d9071f8c4450f2d9bc1bc54a0a259a..2ca91fe5e2119fa902fbf4392b82ec39ebf09a20 100644 (file)
@@ -1,5 +1,5 @@
 /* S-record download support for GDB, the GNU debugger.
-   Copyright 1995, 1996, 1997, 1999, 2000, 2001
+   Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -93,7 +93,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
       {
        int numbytes;
        bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset;
-       bfd_size_type size = bfd_get_section_size_before_reloc (s);
+       bfd_size_type size = bfd_get_section_size (s);
        char *section_name = (char *) bfd_get_section_name (abfd, s);
        /* Both GDB and BFD have mechanisms for printing addresses.
            In the below, GDB's is used so that the address is
@@ -263,7 +263,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
   if (sect && abfd)
     {
       payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2;
-      payload_size = min (payload_size, sect->_raw_size - sectoff);
+      payload_size = min (payload_size, bfd_get_section_size (sect) - sectoff);
 
       bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size);
     }
index 52ca337cc8b8545b4809b90c7e9bc2266a997eaf..7ee18db892a6daf212aa0d1112b3b13bd659bace 100644 (file)
@@ -1571,8 +1571,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
                                                     dwarf_eh_frame_section);
 
-      unit.dwarf_frame_size
-       = bfd_get_section_size_before_reloc (dwarf_eh_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_eh_frame_section);
       unit.dwarf_frame_section = dwarf_eh_frame_section;
 
       /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
@@ -1599,8 +1598,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
       unit.cie = NULL;
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
                                                     dwarf_frame_section);
-      unit.dwarf_frame_size
-       = bfd_get_section_size_before_reloc (dwarf_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_frame_section);
       unit.dwarf_frame_section = dwarf_frame_section;
 
       frame_ptr = unit.dwarf_frame_buffer;
index b2efc178baf0167231950a217d27d61d4b9f6cac..632ae4a2bceb9fad20c207b94fe08545e0ac1961 100644 (file)
@@ -996,47 +996,47 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr)
 {
   if (strcmp (sectp->name, INFO_SECTION) == 0)
     {
-      dwarf2_per_objfile->info_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
       dwarf_info_section = sectp;
     }
   else if (strcmp (sectp->name, ABBREV_SECTION) == 0)
     {
-      dwarf2_per_objfile->abbrev_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
       dwarf_abbrev_section = sectp;
     }
   else if (strcmp (sectp->name, LINE_SECTION) == 0)
     {
-      dwarf2_per_objfile->line_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
       dwarf_line_section = sectp;
     }
   else if (strcmp (sectp->name, PUBNAMES_SECTION) == 0)
     {
-      dwarf2_per_objfile->pubnames_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
       dwarf_pubnames_section = sectp;
     }
   else if (strcmp (sectp->name, ARANGES_SECTION) == 0)
     {
-      dwarf2_per_objfile->aranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
       dwarf_aranges_section = sectp;
     }
   else if (strcmp (sectp->name, LOC_SECTION) == 0)
     {
-      dwarf2_per_objfile->loc_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
       dwarf_loc_section = sectp;
     }
   else if (strcmp (sectp->name, MACINFO_SECTION) == 0)
     {
-      dwarf2_per_objfile->macinfo_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
       dwarf_macinfo_section = sectp;
     }
   else if (strcmp (sectp->name, STR_SECTION) == 0)
     {
-      dwarf2_per_objfile->str_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
       dwarf_str_section = sectp;
     }
   else if (strcmp (sectp->name, FRAME_SECTION) == 0)
     {
-      dwarf2_per_objfile->frame_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
       dwarf_frame_section = sectp;
     }
   else if (strcmp (sectp->name, EH_FRAME_SECTION) == 0)
@@ -1044,13 +1044,13 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr)
       flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
       if (aflag & SEC_HAS_CONTENTS)
         {
-          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size_before_reloc (sectp);
+          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
           dwarf_eh_frame_section = sectp;
         }
     }
   else if (strcmp (sectp->name, RANGES_SECTION) == 0)
     {
-      dwarf2_per_objfile->ranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
       dwarf_ranges_section = sectp;
     }
 }
@@ -4464,7 +4464,7 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp)
 {
   bfd *abfd = objfile->obfd;
   char *buf, *retbuf;
-  bfd_size_type size = bfd_get_section_size_before_reloc (sectp);
+  bfd_size_type size = bfd_get_section_size (sectp);
 
   if (size == 0)
     return NULL;
index 7b13cb98e14ba3a9884b78196c19f78a8f433e83..b6abe083a6ece3cef4de9097834d831e381ae033 100644 (file)
@@ -83,12 +83,12 @@ elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *eip)
   if (strcmp (sectp->name, ".debug") == 0)
     {
       ei->dboffset = sectp->filepos;
-      ei->dbsize = bfd_get_section_size_before_reloc (sectp);
+      ei->dbsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".line") == 0)
     {
       ei->lnoffset = sectp->filepos;
-      ei->lnsize = bfd_get_section_size_before_reloc (sectp);
+      ei->lnsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".stab") == 0)
     {
index b5513728ef5108ff0d0f410424129e31ebc55b4c..3b3a259574f8252b2f0c0914223fd7ed9655e9fa 100644 (file)
@@ -244,7 +244,7 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
          || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
        {
          sec_vaddr = bfd_get_section_vma (abfd, sec);
-         sec_size = bfd_get_section_size_before_reloc (sec);
+         sec_size = bfd_get_section_size (sec);
          if (sec_vaddr + sec_size > top_of_data_memory)
            top_of_data_memory = sec_vaddr + sec_size;
        }
index 80d9375f55aabd53c12264c0ae134ef028cbb969..d34755e9d68b4527863cbb2b2dc30570c97f8e58 100644 (file)
@@ -234,10 +234,10 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
       || si.got_sect == NULL)
     return;
 
-  sym_secsize = bfd_get_section_size_before_reloc (si.sym_sect);
-  str_secsize = bfd_get_section_size_before_reloc (si.str_sect);
-  dyninfo_secsize = bfd_get_section_size_before_reloc (si.dyninfo_sect);
-  got_secsize = bfd_get_section_size_before_reloc (si.got_sect);
+  sym_secsize = bfd_get_section_size (si.sym_sect);
+  str_secsize = bfd_get_section_size (si.str_sect);
+  dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect);
+  got_secsize = bfd_get_section_size (si.got_sect);
   sym_secptr = xmalloc (sym_secsize);
   cleanups = make_cleanup (free, sym_secptr);
   str_secptr = xmalloc (str_secsize);
index 4fa481b719f99b07085aff728b76524394dcd902..16a6690e92cfb399a4855822273560977b5d0306 100644 (file)
@@ -1,7 +1,7 @@
 /* Remote debugging interface for Renesas E7000 ICE, for GDB
 
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support. 
 
@@ -1569,7 +1569,7 @@ e7000_load (char *args, int from_tty)
          file_ptr fptr;
 
          section_address = bfd_get_section_vma (pbfd, section);
-         section_size = bfd_get_section_size_before_reloc (section);
+         section_size = bfd_get_section_size (section);
 
          if (!quiet)
            printf_filtered ("[Loading section %s at 0x%s (%s bytes)]\n",
index 43a902a46edd23626c8e55256509fae9e4a789f4..e42a34bf0f5d890bbe0958a77932f63a0d654884 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote debugging interface for M32R/SDI.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Renesas Technology Co.
    Written by Kei Sakamoto <sakamoto.kei@renesas.com>.
@@ -1320,7 +1320,7 @@ m32r_load (char *args, int from_tty)
          int n;
 
          section_address = bfd_section_lma (pbfd, section);
-         section_size = bfd_get_section_size_before_reloc (section);
+         section_size = bfd_get_section_size (section);
 
          if (!mmu_on)
            {
index 24f9378e0fac4a2303f7b059c4cffb9093aa0dbc..a011467f106d1f1c2056addad80c89c6330f7bfa 100644 (file)
@@ -1,7 +1,7 @@
 /* Remote debugging interface for MIPS remote debugging protocol.
 
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by Ian Lance Taylor
    <ian@cygnus.com>.
@@ -2648,12 +2648,12 @@ mips_load_srec (char *args)
          /* FIXME!  vma too small????? */
          printf_filtered ("%s\t: 0x%4lx .. 0x%4lx  ", s->name,
                           (long) s->vma,
-                          (long) (s->vma + s->_raw_size));
+                          (long) (s->vma + bfd_get_section_size (s)));
          gdb_flush (gdb_stdout);
 
-         for (i = 0; i < s->_raw_size; i += numbytes)
+         for (i = 0; i < bfd_get_section_size (s); i += numbytes)
            {
-             numbytes = min (srec_frame, s->_raw_size - i);
+             numbytes = min (srec_frame, bfd_get_section_size (s) - i);
 
              bfd_get_section_contents (abfd, s, buffer, i, numbytes);
 
@@ -3135,11 +3135,11 @@ pmon_load_fast (char *file)
   for (s = abfd->sections; s && !finished; s = s->next)
     if (s->flags & SEC_LOAD)   /* only deal with loadable sections */
       {
-       bintotal += s->_raw_size;
-       final = (s->vma + s->_raw_size);
+       bintotal += bfd_get_section_size (s);
+       final = (s->vma + bfd_get_section_size (s));
 
        printf_filtered ("%s\t: 0x%4x .. 0x%4x  ", s->name, (unsigned int) s->vma,
-                        (unsigned int) (s->vma + s->_raw_size));
+                        (unsigned int) (s->vma + bfd_get_section_size (s)));
        gdb_flush (gdb_stdout);
 
        /* Output the starting address */
@@ -3160,11 +3160,13 @@ pmon_load_fast (char *file)
 
            reclen = 0;
 
-           for (i = 0; ((i < s->_raw_size) && !finished); i += binamount)
+           for (i = 0;
+                i < bfd_get_section_size (s) && !finished;
+                i += binamount)
              {
                int binptr = 0;
 
-               binamount = min (BINCHUNK, s->_raw_size - i);
+               binamount = min (BINCHUNK, bfd_get_section_size (s) - i);
 
                bfd_get_section_contents (abfd, s, binbuf, i, binamount);
 
index 752b2334525500d60533f8b27a12f2485369b2c2..962a58db49bff27d90f95e2bebdb679b38c178c1 100644 (file)
@@ -4729,7 +4729,7 @@ compare_sections_command (char *args, int from_tty)
       if (!(s->flags & SEC_LOAD))
        continue;               /* skip non-loadable section */
 
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       if (size == 0)
        continue;               /* skip zero-length section */
 
index 95d62492283fd9ea7d4507267b9a4a6aed169131..a98c188ff8447ecd46d3363593aaee7a69257cb0 100644 (file)
@@ -1350,7 +1350,7 @@ add_section_size_callback (bfd *abfd, asection *asec, void *data)
 {
   bfd_size_type *sum = data;
 
-  *sum += bfd_get_section_size_before_reloc (asec);
+  *sum += bfd_get_section_size (asec);
 }
 
 /* Opaque data for load_section_callback.  */
@@ -1370,7 +1370,7 @@ load_section_callback (bfd *abfd, asection *asec, void *data)
 
   if (bfd_get_section_flags (abfd, asec) & SEC_LOAD)
     {
-      bfd_size_type size = bfd_get_section_size_before_reloc (asec);
+      bfd_size_type size = bfd_get_section_size (asec);
       if (size > 0)
        {
          char *buffer;
@@ -2874,7 +2874,7 @@ pc_in_unmapped_range (CORE_ADDR pc, asection *section)
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-       size = bfd_get_section_size_before_reloc (section);
+       size = bfd_get_section_size (section);
        if (section->lma <= pc && pc < section->lma + size)
          return 1;
       }
@@ -2894,7 +2894,7 @@ pc_in_mapped_range (CORE_ADDR pc, asection *section)
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-       size = bfd_get_section_size_before_reloc (section);
+       size = bfd_get_section_size (section);
        if (section->vma <= pc && pc < section->vma + size)
          return 1;
       }
@@ -2910,9 +2910,9 @@ sections_overlap (asection *a, asection *b)
   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
 
   CORE_ADDR a_start = a->vma;
-  CORE_ADDR a_end = a->vma + bfd_get_section_size_before_reloc (a);
+  CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
   CORE_ADDR b_start = b->vma;
-  CORE_ADDR b_end = b->vma + bfd_get_section_size_before_reloc (b);
+  CORE_ADDR b_end = b->vma + bfd_get_section_size (b);
 
   return (a_start < b_end && b_start < a_end);
 }
@@ -3047,7 +3047,7 @@ list_overlays_command (char *args, int from_tty)
 
        vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
        lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
-       size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+       size = bfd_get_section_size (osect->the_bfd_section);
        name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
 
        printf_filtered ("Section %s, loaded at ", name);
@@ -3387,7 +3387,7 @@ simple_overlay_update_1 (struct obj_section *osect)
   bfd *obfd = osect->objfile->obfd;
   asection *bsect = osect->the_bfd_section;
 
-  size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+  size = bfd_get_section_size (osect->the_bfd_section);
   for (i = 0; i < cache_novlys; i++)
     if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
        && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
@@ -3448,7 +3448,7 @@ simple_overlay_update (struct obj_section *osect)
       bfd *obfd = osect->objfile->obfd;
       asection *bsect = osect->the_bfd_section;
 
-      size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+      size = bfd_get_section_size (bsect);
       for (i = 0; i < cache_novlys; i++)
        if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
            && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
index aceeed4503863c7dac8c407bac586f1f1f1c2b3d..a6d700df045f89d6f112ce1fbd6e01c92249d323 100644 (file)
@@ -1,7 +1,7 @@
 /* Tracing functionality for remote targets in custom GDB protocol
 
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
-   Foundation, Inc.
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1693,7 +1693,7 @@ remote_set_transparent_ranges (void)
 
       anysecs = 1;
       lma = s->lma;
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       sprintf_vma (tmp1, lma);
       sprintf_vma (tmp2, lma + size);
       sprintf (target_buf + strlen (target_buf), 
index fb785354e460b2fa04c6f041b1ff90b2000e07c2..27691f06729dd1e98c64851ac943000b4ee7d55d 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-vector operations for controlling win32 child processes, for GDB.
 
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
-   Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions, A Red Hat Company.
 
@@ -2340,20 +2340,20 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, void *obj)
   if (strncmp (sect->name, ".module", 7))
     return;
 
-  buf = (char *) xmalloc (sect->_raw_size + 1);
+  buf = (char *) xmalloc (bfd_get_section_size (sect) + 1);
   if (!buf)
     {
       printf_unfiltered ("memory allocation failed for %s\n", sect->name);
       goto out;
     }
-  if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size))
+  if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect)))
     goto out;
 
   pstatus = (struct win32_pstatus *) buf;
 
   memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr));
   dll_name_size = pstatus->data.module_info.module_name_size;
-  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size)
+  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect))
       goto out;
 
   dll_name = (char *) xmalloc (dll_name_size + 1);
index fb785354e460b2fa04c6f041b1ff90b2000e07c2..27691f06729dd1e98c64851ac943000b4ee7d55d 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-vector operations for controlling win32 child processes, for GDB.
 
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
-   Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions, A Red Hat Company.
 
@@ -2340,20 +2340,20 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, void *obj)
   if (strncmp (sect->name, ".module", 7))
     return;
 
-  buf = (char *) xmalloc (sect->_raw_size + 1);
+  buf = (char *) xmalloc (bfd_get_section_size (sect) + 1);
   if (!buf)
     {
       printf_unfiltered ("memory allocation failed for %s\n", sect->name);
       goto out;
     }
-  if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size))
+  if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect)))
     goto out;
 
   pstatus = (struct win32_pstatus *) buf;
 
   memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr));
   dll_name_size = pstatus->data.module_info.module_name_size;
-  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size)
+  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect))
       goto out;
 
   dll_name = (char *) xmalloc (dll_name_size + 1);