aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2003-10-17 03:30:27 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2003-10-17 03:30:27 +0000
commit98a96df7f5938a32fadf599ce5430be00c8d7282 (patch)
tree9a82486c4a8630ff17cf970d0a1d1b4c012e405f /bfd/peXXigen.c
parent2cefff799c3205b0910cce1942e6e2a570f75201 (diff)
downloadgdb-98a96df7f5938a32fadf599ce5430be00c8d7282.zip
gdb-98a96df7f5938a32fadf599ce5430be00c8d7282.tar.gz
gdb-98a96df7f5938a32fadf599ce5430be00c8d7282.tar.bz2
* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size for
sections which lack size info.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index ea98bef..cd0a91c 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -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;