* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size for
authorChristopher Faylor <me+cygwin@cgf.cx>
Fri, 17 Oct 2003 03:30:27 +0000 (03:30 +0000)
committerChristopher Faylor <me+cygwin@cgf.cx>
Fri, 17 Oct 2003 03:30:27 +0000 (03:30 +0000)
sections which lack size info.

bfd/ChangeLog
bfd/peXXigen.c

index be335464668914b21362c454a18d6c5010fc5c09..751d2a7529e2883e7c51272d970d64dc63bf26dd 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-16  Pavel Roskin  <proski@gnu.org>
+
+       * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size
+       for sections which lack size info.
+
 2003-10-17  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for
index ea98befa1ad0ee9b1768f3a1677235ded2d6c3ee..cd0a91c5aac1f777e6f06b339a44452c7ac2be72 100644 (file)
@@ -674,7 +674,9 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out)
           5.0 link.exe) where the file size of the .data segment is
           quite small compared to the virtual size.  Without this
           fix, strip munges the file.  */
-       isize += SA (FA (pei_section_data (abfd, sec)->virt_size));
+       if (coff_section_data (abfd, sec) != NULL
+           && pei_section_data (abfd, sec) != NULL)
+         isize += SA (FA (pei_section_data (abfd, sec)->virt_size));
       }
 
     aouthdr_in->dsize = dsize;