From: H.J. Lu Date: Wed, 1 Apr 2015 15:14:32 +0000 (-0700) Subject: Work around a GCC uninitialized warning bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0bde39842936bb13f88f13a688b181432aa2593;p=binutils-gdb.git 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 --git a/ld/ChangeLog b/ld/ChangeLog index ac1abaed547..1348f46c730 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 H.J. Lu + + * 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 * emultempl/aarch64elf.em diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index ece2fb054d1..4dd71abfc38 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)) {