From: Alan Modra Date: Wed, 7 Dec 2022 03:15:46 +0000 (+1030) Subject: bfd_compress_section_contents access to elf_section_data X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16fce1bddb03d493fdc17b2d33461f77f3b58499;p=binutils-gdb.git bfd_compress_section_contents access to elf_section_data * compress.c (bfd_compress_section_contents): Don't access elf_section_data for non-ELF. --- diff --git a/bfd/compress.c b/bfd/compress.c index 29434923543..6a30af5f8e6 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -682,7 +682,8 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec) if (compressed_size >= uncompressed_size) { memcpy (buffer, input_buffer, uncompressed_size); - elf_section_flags (sec) &= ~SHF_COMPRESSED; + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + elf_section_flags (sec) &= ~SHF_COMPRESSED; sec->compress_status = COMPRESS_SECTION_NONE; } else