This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Work around a GCC uninitialized warning bug


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a0bde39842936bb13f88f13a688b181432aa2593

commit a0bde39842936bb13f88f13a688b181432aa2593
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Apr 1 08:14:32 2015 -0700

    Work around a GCC uninitialized warning bug
    
    	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Work
    	around a GCC uninitialized warning bug fixed in GCC 4.6.

Diff:
---
 ld/ChangeLog          | 5 +++++
 ld/emultempl/elf32.em | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index ac1abae..1348f46 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Work
+	around a GCC uninitialized warning bug fixed in GCC 4.6.
+
 2015-04-01  Tejas Belagod  <tejas.belagod@arm.com>
 
 	* emultempl/aarch64elf.em
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index ece2fb0..4dd71ab 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1412,7 +1412,12 @@ gld${EMULATION_NAME}_before_allocation (void)
   asection *sinterp;
   bfd *abfd;
   struct elf_link_hash_entry *ehdr_start = NULL;
+#if defined(__GNUC__) && GCC_VERSION < 4006
+  /* Work around a GCC uninitialized warning bug fixed in GCC 4.6.  */
+  struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;
+#else
   struct bfd_link_hash_entry ehdr_start_save;
+#endif
 
   if (is_elf_hash_table (link_info.hash))
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]