Silence uninitialized warning on ehdr_start_save
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 15 Jan 2014 15:43:19 +0000 (07:43 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 15 Jan 2014 15:43:19 +0000 (07:43 -0800)
Older GCC, like 4.1/4.2, will issue an uninitialized warning on
ehdr_start_save.  This patch silences by using

struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;

* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Silence uninitialized warning on ehdr_start_save with older
GCC.

ld/ChangeLog
ld/emultempl/elf32.em

index eaa6b935752aa1fb67610d69a0a09d942a71a2ab..91055ded7af33935371be82cb70e37314cbd8d57 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
+       Silence uninitialized warning on ehdr_start_save with older
+       GCC.
+
 2014-01-15  Alan Modra  <amodra@gmail.com>
 
        * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Define
index 13f86f084e58713abe39f6809a0fb3a54618a055..569c7f7a816394fb9e9779bfb8113c5c961e00a6 100644 (file)
@@ -1481,7 +1481,7 @@ gld${EMULATION_NAME}_before_allocation (void)
   asection *sinterp;
   bfd *abfd;
   struct elf_link_hash_entry *ehdr_start = NULL;
-  struct bfd_link_hash_entry ehdr_start_save;
+  struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;
 
   if (is_elf_hash_table (link_info.hash))
     {