x86: Simplify bad return in get_synthetic_symtab

* elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
	return.
	* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
This commit is contained in:
H.J. Lu 2017-08-29 11:28:10 -07:00
parent 37c0b6ee65
commit 823cb06774
3 changed files with 20 additions and 22 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -6504,14 +6504,7 @@ elf_i386_get_synthetic_symtab (bfd *abfd,
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)
{
@ -6639,9 +6632,12 @@ bad_return:
/* 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)

View File

@ -6896,14 +6896,7 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd,
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);
@ -7014,9 +7007,12 @@ bad_return:
/* 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)