aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-07-03 16:06:34 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-07-03 16:06:34 +0000
commit5a5ed5b0e4fa9e4671b542532dc620c79803e039 (patch)
tree5d92ce01bfae0b1d03e8b2573bfac404d815df13 /bfd/elf.c
parent1e55e04f56d3f1524afd83aa65d5bffdb3795dc7 (diff)
downloadgdb-5a5ed5b0e4fa9e4671b542532dc620c79803e039.zip
gdb-5a5ed5b0e4fa9e4671b542532dc620c79803e039.tar.gz
gdb-5a5ed5b0e4fa9e4671b542532dc620c79803e039.tar.bz2
Don't compress empty debug section
2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty debug section. 2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * binutils-all/compress.exp: Test compress empty debug sections. * binutils-all/dw2-empty.S: New file.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 588e73f..532c7f9 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1025,7 +1025,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
else
{
/* Normal section. Check if we should compress. */
- if ((abfd->flags & BFD_COMPRESS))
+ if ((abfd->flags & BFD_COMPRESS) && newsect->size != 0)
action = compress;
}