mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
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:
parent
37c0b6ee65
commit
823cb06774
@ -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
|
||||
|
@ -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,8 +6632,11 @@ bad_return:
|
||||
|
||||
/* PLT entries with R_386_TLS_DESC relocations are skipped. */
|
||||
if (n == 0)
|
||||
goto bad_return;
|
||||
|
||||
{
|
||||
bad_return:
|
||||
count = -1;
|
||||
}
|
||||
else
|
||||
count = n;
|
||||
|
||||
for (j = 0; plts[j].name != NULL; j++)
|
||||
|
@ -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,8 +7007,11 @@ bad_return:
|
||||
|
||||
/* PLT entries with R_X86_64_TLSDESC relocations are skipped. */
|
||||
if (n == 0)
|
||||
goto bad_return;
|
||||
|
||||
{
|
||||
bad_return:
|
||||
count = -1;
|
||||
}
|
||||
else
|
||||
count = n;
|
||||
|
||||
for (j = 0; plts[j].name != NULL; j++)
|
||||
|
Loading…
Reference in New Issue
Block a user