aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index dbdc474..619a640 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1067,9 +1067,11 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
{
enum { nothing, compress, decompress } action = nothing;
int compression_header_size;
+ bfd_size_type uncompressed_size;
bfd_boolean compressed
= bfd_is_section_compressed_with_header (abfd, newsect,
- &compression_header_size);
+ &compression_header_size,
+ &uncompressed_size);
if (compressed)
{
@@ -1085,6 +1087,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
if (newsect->size != 0
&& (abfd->flags & BFD_COMPRESS)
&& compression_header_size >= 0
+ && uncompressed_size > 0
&& (!compressed
|| ((compression_header_size > 0)
!= ((abfd->flags & BFD_COMPRESS_GABI) != 0))))