diff options
author | Tom Tromey <tromey@redhat.com> | 2012-10-19 16:59:55 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-10-19 16:59:55 +0000 |
commit | 6697ad6645107efda8cc0cab52a1e7cb1f5a968d (patch) | |
tree | 45a7cb6a966fda3fb862b92feb1e7a0fa01a416e | |
parent | 3ba55606cb40baca5fda4c0704303ad038480512 (diff) | |
download | binutils-redhat-6697ad6645107efda8cc0cab52a1e7cb1f5a968d.tar.gz |
* compress.c: Revert previous patch.
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/compress.c | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ab216bd420..76d91c2d15 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ 2012-10-19 Tom Tromey <tromey@redhat.com> + * compress.c: Revert previous patch. + +2012-10-19 Tom Tromey <tromey@redhat.com> + * compress.c (bfd_get_full_section_contents): Don't cache decompressed contents. diff --git a/bfd/compress.c b/bfd/compress.c index 34faa088fd..17b5928a02 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -165,6 +165,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) bfd_size_type uncompressed_size; bfd_size_type rawsize; bfd_byte *compressed_buffer; + bfd_byte *uncompressed_buffer; #endif if (abfd->direction != write_direction && sec->rawsize != 0) @@ -219,24 +220,24 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) if (!ret) goto fail_compressed; - if (p == NULL) - p = (bfd_byte *) bfd_malloc (uncompressed_size); - if (p == NULL) + uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size); + if (uncompressed_buffer == NULL) goto fail_compressed; if (!decompress_contents (compressed_buffer, compressed_size, - p, uncompressed_size)) + uncompressed_buffer, uncompressed_size)) { bfd_set_error (bfd_error_bad_value); - free (p); + free (uncompressed_buffer); fail_compressed: free (compressed_buffer); return FALSE; } free (compressed_buffer); - *ptr = p; - return TRUE; + sec->contents = uncompressed_buffer; + sec->compress_status = COMPRESS_SECTION_DONE; + /* Fall thru */ #endif case COMPRESS_SECTION_DONE: |