diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-07 13:45:46 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-07 13:52:28 +1030 |
commit | 16fce1bddb03d493fdc17b2d33461f77f3b58499 (patch) | |
tree | 4c9d1753a1a6ed4cf5b6e3b55fb31c15cc6e593c /bfd/compress.c | |
parent | c3620d6d5639ab7a0b483030350e8f2929212ea7 (diff) | |
download | binutils-16fce1bddb03d493fdc17b2d33461f77f3b58499.zip binutils-16fce1bddb03d493fdc17b2d33461f77f3b58499.tar.gz binutils-16fce1bddb03d493fdc17b2d33461f77f3b58499.tar.bz2 |
bfd_compress_section_contents access to elf_section_data
* compress.c (bfd_compress_section_contents): Don't access
elf_section_data for non-ELF.
Diffstat (limited to 'bfd/compress.c')
-rw-r--r-- | bfd/compress.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/compress.c b/bfd/compress.c index 2943492..6a30af5 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 |