summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-04 08:01:54 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-04 08:01:54 -0700
commit68f5ff89edd041719c0d45e1f716a5251d7be768 (patch)
treefeeda29346acf4388f9c1716be2b9ddd42908b4a /bfd/elf.c
parent906bacc0eaac3681a7d6da1bde73dcef7fd3ade7 (diff)
downloadbinutils-gdb-68f5ff89edd041719c0d45e1f716a5251d7be768.tar.gz
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.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index f3c90506591..cbc0c918f88 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;