* elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
return.
* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
+2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
+ return.
+ * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
+
2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
s = *ret = (asymbol *) bfd_zmalloc (size);
if (s == NULL)
- {
-bad_return:
- for (j = 0; plts[j].name != NULL; j++)
- if (plts[j].contents != NULL)
- free (plts[j].contents);
- free (dynrelbuf);
- return -1;
- }
+ goto bad_return;
if (got_addr)
{
/* PLT entries with R_386_TLS_DESC relocations are skipped. */
if (n == 0)
- goto bad_return;
-
- count = n;
+ {
+bad_return:
+ count = -1;
+ }
+ else
+ count = n;
for (j = 0; plts[j].name != NULL; j++)
if (plts[j].contents != NULL)
s = *ret = (asymbol *) bfd_zmalloc (size);
if (s == NULL)
- {
-bad_return:
- for (j = 0; plts[j].name != NULL; j++)
- if (plts[j].contents != NULL)
- free (plts[j].contents);
- free (dynrelbuf);
- return -1;
- }
+ goto bad_return;
/* Check for each PLT section. */
names = (char *) (s + count);
/* PLT entries with R_X86_64_TLSDESC relocations are skipped. */
if (n == 0)
- goto bad_return;
-
- count = n;
+ {
+bad_return:
+ count = -1;
+ }
+ else
+ count = n;
for (j = 0; plts[j].name != NULL; j++)
if (plts[j].contents != NULL)