diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/write.c | 25 |
2 files changed, 17 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 683a30e..2b1d99c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2015-05-14 H.J. Lu <hongjiu.lu@intel.com> + + * write.c (compress_debug): Don't write the zlib header, which + is handled by bfd_update_compression_header. + 2015-05-13 Max Filippov <jcmvbkbc@gmail.com> * config/tc-xtensa.c (xtensa_relax_frag): Allow trampoline to be diff --git a/gas/write.c b/gas/write.c index bc76962..894b271 100644 --- a/gas/write.c +++ b/gas/write.c @@ -1414,8 +1414,6 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) int x; flagword flags = bfd_get_section_flags (abfd, sec); unsigned int header_size, compression_header_size; - /* Maximimum compression header is 24 bytes. */ - bfd_byte compression_header[24]; if (seginfo == NULL || sec->size < 32 @@ -1431,14 +1429,20 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) return; if (flag_compress_debug == COMPRESS_DEBUG_GABI_ZLIB) - stdoutput->flags |= BFD_COMPRESS | BFD_COMPRESS_GABI; + { + stdoutput->flags |= BFD_COMPRESS | BFD_COMPRESS_GABI; + compression_header_size + = bfd_get_compression_header_size (stdoutput, NULL); + header_size = compression_header_size; + } else - stdoutput->flags |= BFD_COMPRESS; - compression_header_size - = bfd_get_compression_header_size (stdoutput, NULL); + { + stdoutput->flags |= BFD_COMPRESS; + compression_header_size = 0; + header_size = 12; + } - /* Create a new frag to contain the "ZLIB" header. */ - header_size = 12 + compression_header_size; + /* Create a new frag to contain the compression header. */ first_newf = frag_alloc (ob); if (obstack_room (ob) < header_size) first_newf = frag_alloc (ob); @@ -1533,11 +1537,6 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) if (compressed_size >= uncompressed_size) return; - if (compression_header_size) - memcpy (header, compression_header, compression_header_size); - memcpy (header + compression_header_size, "ZLIB", 4); - bfd_putb64 (uncompressed_size, header + compression_header_size + 4); - /* Replace the uncompressed frag list with the compressed frag list. */ seginfo->frchainP->frch_root = first_newf; seginfo->frchainP->frch_last = last_newf; |