summaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 43f3a83743c..d59a97f0d11 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -3041,7 +3041,8 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
return false;
}
- if (bfd_malloc_and_get_section (obfd, section, &data))
+ if ((section->flags & SEC_HAS_CONTENTS) != 0
+ && bfd_malloc_and_get_section (obfd, section, &data))
{
unsigned int i;
struct external_IMAGE_DEBUG_DIRECTORY *dd =