summaryrefslogtreecommitdiff
path: root/bfd/peicode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-07-05 10:52:25 +0000
committerNick Clifton <nickc@redhat.com>2001-07-05 10:52:25 +0000
commit32c71d7c9bf1bcb77b81ef3d4d4b99f732147006 (patch)
tree9a407552069ae07f19d371c6d5ae59382f6d11c3 /bfd/peicode.h
parent2b335b60e1fca291ad11d6fe59b22e5ebb1d7167 (diff)
downloadbinutils-redhat-32c71d7c9bf1bcb77b81ef3d4d4b99f732147006.tar.gz
For sections containing uninitialised data, only set their size to s_paddr
if this does not reset their size to zero. MS's latest compilers will set s_paddr to zero.
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r--bfd/peicode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h
index a0f74497df..20fe01cba6 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -275,7 +275,8 @@ coff_swap_scnhdr_in (abfd, ext, in)
#ifndef COFF_NO_HACK_SCNHDR_SIZE
/* If this section holds uninitialized data, use the virtual size
(stored in s_paddr) instead of the physical size. */
- if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0)
+ if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0
+ && (scnhdr_int->s_paddr > 0))
{
scnhdr_int->s_size = scnhdr_int->s_paddr;
/* This code used to set scnhdr_int->s_paddr to 0. However,