I'd skipped this one before, thinking "obfd, that's the linker output
bfd so no need to test".  Wrong, this is objcopy output.
	* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Test
	SEC_HAS_CONTENTS before reading section.
              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 =