aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-08 09:25:08 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-08 09:27:27 -0700
commit5150992626e67d2f6d1573737e06126bfb712c30 (patch)
tree0fe0e977acd3a5bab770b56967186710f3357c44 /bfd
parent85558555ec343f6e8ec32da409c838954e68132f (diff)
downloadgdb-5150992626e67d2f6d1573737e06126bfb712c30.zip
gdb-5150992626e67d2f6d1573737e06126bfb712c30.tar.gz
gdb-5150992626e67d2f6d1573737e06126bfb712c30.tar.bz2
Work around a GCC uninitialized warning bug
* compress.c (bfd_compress_section_contents): Work around a GCC uninitialized warning bug fixed in GCC 4.7.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/compress.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 68e13c5..c7050af 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
+ * compress.c (bfd_compress_section_contents): Work around a GCC
+ uninitialized warning bug fixed in GCC 4.7.
+
+2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
bit.
* bfd.c (bfd::flags): Increase size to 18 bits.
diff --git a/bfd/compress.c b/bfd/compress.c
index ba9fc96..17b24e8 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -79,7 +79,12 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec,
bfd_byte *buffer;
bfd_size_type buffer_size;
bfd_boolean decompress;
+#if defined(__GNUC__) && GCC_VERSION < 4007
+ /* Work around a GCC uninitialized warning bug fixed in GCC 4.7. */
+ int zlib_size = 0;
+#else
int zlib_size;
+#endif
int orig_compression_header_size;
int compression_header_size
= bfd_get_compression_header_size (abfd, NULL);