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.
This commit is contained in:
H.J. Lu 2015-04-04 08:01:54 -07:00
parent 906bacc0ea
commit 68f5ff89ed
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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 ...

View File

@ -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;