From: Nick Clifton Date: Thu, 5 Jul 2001 16:56:12 +0000 (+0000) Subject: For sections containing uninitialised data, only set their size to s_paddr if X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8fbcf5be7ad8cf21592c788b0ca70a1545a9a24;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 258371274e8..4f0d7053d38 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2001-07-05 Nick Clifton + + * 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 * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of diff --git a/bfd/peicode.h b/bfd/peicode.h index a0f74497df2..20fe01cba65 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,