diff options
author | Alan Modra <amodra@gmail.com> | 2018-08-24 00:20:05 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-08-24 00:26:40 +0930 |
commit | 2cd65cb935bcf1511c7e7bb77ce7bd46234300db (patch) | |
tree | de748f0b3dd1c0b987a180a192066afae24d6dc3 /ld | |
parent | f53ad3cf2b2dc34114a9b74439da5a418ac40e3d (diff) | |
download | gdb-2cd65cb935bcf1511c7e7bb77ce7bd46234300db.zip gdb-2cd65cb935bcf1511c7e7bb77ce7bd46234300db.tar.gz gdb-2cd65cb935bcf1511c7e7bb77ce7bd46234300db.tar.bz2 |
PR23566, false uninitialized warning
PR 23566
* emultempl/elf32.em (before_allocation): Warning fix.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 13 |
2 files changed, 8 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 66f890c..4b33f72 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2018-08-23 Alan Modra <amodra@gmail.com> + + PR 23566 + * emultempl/elf32.em (before_allocation): Warning fix. + 2018-08-23 H.J. Lu <hongjiu.lu@intel.com> PR ld/23536 diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 5160e24..eac4ba7 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1680,11 +1680,6 @@ gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg) } } -#if defined(__GNUC__) && GCC_VERSION < 4006 - /* Work around a GCC uninitialized warning bug fixed in GCC 4.6. */ -static struct bfd_link_hash_entry ehdr_start_empty; -#endif - /* This is called after the sections have been attached to output sections, but before any sizes or addresses have been set. */ @@ -1695,13 +1690,11 @@ 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_empty; -#else struct bfd_link_hash_entry ehdr_start_save; -#endif + /* The memset is here only to silence brain-dead compiler warnings + that the variable may be used uninitialized. */ + memset (&ehdr_start_save, 0, sizeof ehdr_start_save); if (is_elf_hash_table (link_info.hash)) { _bfd_elf_tls_setup (link_info.output_bfd, &link_info); |