diff options
author | Alan Modra <amodra@gmail.com> | 2022-10-04 13:09:36 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-10-04 18:36:45 +1030 |
commit | 034235cebd790d4f9a1728043a175d7d7d9338b1 (patch) | |
tree | 1899d8ea958ae0a684f09f48e4255dee6cfd3f59 /bfd/elf.c | |
parent | 7afbac7ddd7299491a88341149bc72b38173447a (diff) | |
download | gdb-034235cebd790d4f9a1728043a175d7d7d9338b1.zip gdb-034235cebd790d4f9a1728043a175d7d7d9338b1.tar.gz gdb-034235cebd790d4f9a1728043a175d7d7d9338b1.tar.bz2 |
Re: compress .gnu.debuglto_.debug_* sections if requested
Enable zlib-gnu compression for .gnu.debuglto_.debug_*. This differs
from zlib-gnu for .debug_* where the name is changed to .zdebug_*.
The name change isn't really needed.
bfd/
* elf.c (elf_fake_sections): Replace "." with ".z" in debug
section names only when name was ".d*", ie. ".debug_*".
(_bfd_elf_assign_file_positions_for_non_load): Likewise.
gas/
* write.c (compress_debug): Compress .gnu.debuglto_.debug_*
for zlib-gnu too. Compress .gnu.linkonce.wi.*.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3234,7 +3234,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) name = new_name; } } - else if (asect->compress_status == COMPRESS_SECTION_DONE) + else if (asect->compress_status == COMPRESS_SECTION_DONE + && name[1] == 'd') { /* PR binutils/18087: Compression does not always make a section smaller. So only rename the section when @@ -3246,7 +3247,6 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) arg->failed = true; return; } - BFD_ASSERT (name[1] != 'z'); name = new_name; } } @@ -6689,7 +6689,8 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd) return false; if (sec->compress_status == COMPRESS_SECTION_DONE - && (abfd->flags & BFD_COMPRESS_GABI) == 0) + && (abfd->flags & BFD_COMPRESS_GABI) == 0 + && name[1] == 'd') { /* If section is compressed with zlib-gnu, convert section name from .debug_* to .zdebug_*. */ |