mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
Don't attempt to compress bss sections
It doesn't make sense to try to compress a section without contents since those sections take no space on disk. Compression can only increase the disk image size. * coffgen.c (make_a_section_from_file): Exclude !SEC_HAS_CONTENTS sections from compression and decompression. * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
This commit is contained in:
@ -146,7 +146,8 @@ make_a_section_from_file (bfd *abfd,
|
|||||||
|
|
||||||
/* Compress/decompress DWARF debug sections with names: .debug_* and
|
/* Compress/decompress DWARF debug sections with names: .debug_* and
|
||||||
.zdebug_*, after the section flags is set. */
|
.zdebug_*, after the section flags is set. */
|
||||||
if ((flags & SEC_DEBUGGING)
|
if ((flags & SEC_DEBUGGING) != 0
|
||||||
|
&& (flags & SEC_HAS_CONTENTS) != 0
|
||||||
&& strlen (name) > 7
|
&& strlen (name) > 7
|
||||||
&& ((name[1] == 'd' && name[6] == '_')
|
&& ((name[1] == 'd' && name[6] == '_')
|
||||||
|| (strlen (name) > 8 && name[1] == 'z' && name[7] == '_')))
|
|| (strlen (name) > 8 && name[1] == 'z' && name[7] == '_')))
|
||||||
|
@ -1201,7 +1201,8 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
|
|||||||
|
|
||||||
/* Compress/decompress DWARF debug sections with names: .debug_* and
|
/* Compress/decompress DWARF debug sections with names: .debug_* and
|
||||||
.zdebug_*, after the section flags is set. */
|
.zdebug_*, after the section flags is set. */
|
||||||
if ((newsect->flags & SEC_DEBUGGING)
|
if ((newsect->flags & SEC_DEBUGGING) != 0
|
||||||
|
&& (newsect->flags & SEC_HAS_CONTENTS) != 0
|
||||||
&& ((name[1] == 'd' && name[6] == '_')
|
&& ((name[1] == 'd' && name[6] == '_')
|
||||||
|| (name[1] == 'z' && name[7] == '_')))
|
|| (name[1] == 'z' && name[7] == '_')))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user