summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-07-03 16:06:31 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-07-03 16:06:31 +0000
commitea38cf9e4ddde21ac724cf764d66427a2cb510d4 (patch)
tree33b59d84887455519e5ed49801105816cf425a14
parentdc50ade7b669d2de6fa4a2344c17dd81818cd4d2 (diff)
downloadgdb-ea38cf9e4ddde21ac724cf764d66427a2cb510d4.tar.gz
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.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2b1e9e316cf..5ab85252b51 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
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 ld/3351
* elflink.c (_bfd_elf_update_dynamic_flags): New.
(_bfd_elf_merge_symbol): Update both real and indirect symbol
diff --git a/bfd/elf.c b/bfd/elf.c
index 588e73f641f..532c7f99f3e 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;
}