From 68f5ff89edd041719c0d45e1f716a5251d7be768 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 4 Apr 2015 08:01:54 -0700 Subject: 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. --- bfd/elf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bfd/elf.c') 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; -- cgit v1.1