This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Avoid warning from -Wjump-misses-init
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sources dot redhat dot com
- Date: Sat, 20 Jun 2009 06:14:55 -0700
- Subject: PATCH: Avoid warning from -Wjump-misses-init
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
I checked in this patch to avoid warning from -Wjump-misses-init in
gcc 4.5.0.
H.J.
----
2009-06-19 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_link_add_object_symbols): Avoid warning
from -Wjump-misses-init in gcc 4.5.0.
Index: bfd/elflink.c
===================================================================
--- bfd/elflink.c (revision 6199)
+++ bfd/elflink.c (working copy)
@@ -3549,7 +3549,11 @@ elf_link_add_object_symbols (bfd *abfd,
unsigned long shlink;
if (!bfd_malloc_and_get_section (abfd, s, &dynbuf))
- goto error_free_dyn;
+ {
+error_free_dyn:
+ free (dynbuf);
+ goto error_return;
+ }
elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
if (elfsec == SHN_BAD)
@@ -3633,11 +3637,7 @@ elf_link_add_object_symbols (bfd *abfd,
amt = strlen (fnm) + 1;
anm = bfd_alloc (abfd, amt);
if (anm == NULL)
- {
- error_free_dyn:
- free (dynbuf);
- goto error_return;
- }
+ goto error_free_dyn;
memcpy (anm, fnm, amt);
n->name = anm;
n->by = abfd;