]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
For sections containing uninitialised data, only set their size to s_paddr if
authorNick Clifton <nickc@redhat.com>
Thu, 5 Jul 2001 16:56:12 +0000 (16:56 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 5 Jul 2001 16:56:12 +0000 (16:56 +0000)
this does not reset their size to zero.  MS's latest compilers will set
s_paddr to zero.

bfd/ChangeLog
bfd/peicode.h

index 258371274e8206496ef3ca0d6e19ff31b2513043..4f0d7053d38772721bf958991e955f365b47db20 100644 (file)
@@ -1,3 +1,10 @@
+2001-07-05  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * peicode.h (coff_swap_scnhdr_in): 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.
+
 2001-06-20  Bo Thorsen  <bo@suse.co.uk>
 
         * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
index a0f74497df21f340ffd9e465710c4a83076178d9..20fe01cba65ac916296efae6d95c5e2a30819ec4 100644 (file)
@@ -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,