From 0515494aac726cd5112c6136a3126de9f1535e6a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 5 Jul 2001 10:52:25 +0000 Subject: [PATCH] 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. --- bfd/ChangeLog | 7 +++++++ bfd/peicode.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index eb9d5d273f..ab720b10c0 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-07-04 H.J. Lu * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): 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,