This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Also preserve the SHF_COMPRESSED bit
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 4 Apr 2015 15:03:57 -0000
- Subject: [binutils-gdb] Also preserve the SHF_COMPRESSED bit
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=68f5ff89edd041719c0d45e1f716a5251d7be768
commit 68f5ff89edd041719c0d45e1f716a5251d7be768
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Apr 4 08:01:54 2015 -0700
Also preserve the SHF_COMPRESSED bit
For objcopy and relocatable link, we should also preserve the
SHF_COMPRESSED bit if not decompress.
* elf.c (_bfd_elf_init_private_section_data): Also preserve the
SHF_COMPRESSED bit if not decompress.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 654408e..4400a36 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
+ * elf.c (_bfd_elf_init_private_section_data): Also preserve the
+ SHF_COMPRESSED bit if not decompress.
+
+2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
+
* compress.c (get_uncompressed_size): New. Extracted from ...
(bfd_init_section_decompress_status): This. Use it.
diff --git a/bfd/elf.c b/bfd/elf.c
index f3c9050..cbc0c91 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6680,6 +6680,11 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
elf_next_in_group (osec) = elf_next_in_group (isec);
elf_section_data (osec)->group = elf_section_data (isec)->group;
}
+
+ /* If not decompress, preserve SHF_COMPRESSED. */
+ if ((ibfd->flags & BFD_DECOMPRESS) == 0)
+ elf_section_flags (osec) |= (elf_section_flags (isec)
+ & SHF_COMPRESSED);
}
ihdr = &elf_section_data (isec)->this_hdr;