PowerPC64 ELFv2 symbols not needed in get_synthetic_symtab

* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
	classify symbols for ELFv2.
This commit is contained in:
Alan Modra 2017-10-04 09:54:52 +10:30
parent 9ba5f27cdd
commit a5259595e7
2 changed files with 82 additions and 68 deletions

View File

@ -1,3 +1,8 @@
2017-10-04 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
classify symbols for ELFv2.
2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
PR 22245

View File

@ -3270,6 +3270,14 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
return 0;
}
syms = NULL;
codesecsym = 0;
codesecsymend = 0;
secsymend = 0;
opdsymend = 0;
symcount = 0;
if (opd != NULL)
{
symcount = static_count;
if (!relocatable)
symcount += dyn_count;
@ -3284,7 +3292,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
{
/* Use both symbol tables. */
memcpy (syms, static_syms, static_count * sizeof (*syms));
memcpy (syms + static_count, dyn_syms, (dyn_count + 1) * sizeof (*syms));
memcpy (syms + static_count, dyn_syms,
(dyn_count + 1) * sizeof (*syms));
}
else if (!relocatable && static_count == 0)
memcpy (syms, dyn_syms, (symcount + 1) * sizeof (*syms));
@ -3318,7 +3327,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
codesecsym = i;
for (; i < symcount; ++i)
if (((syms[i]->section->flags & (SEC_CODE | SEC_ALLOC | SEC_THREAD_LOCAL))
if (((syms[i]->section->flags & (SEC_CODE | SEC_ALLOC
| SEC_THREAD_LOCAL))
!= (SEC_CODE | SEC_ALLOC))
|| (syms[i]->flags & BSF_SECTION_SYM) == 0)
break;
@ -3329,7 +3339,6 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
break;
secsymend = i;
if (opd != NULL)
for (; i < symcount; ++i)
if (strcmp (syms[i]->section->name, ".opd") != 0)
break;
@ -3340,7 +3349,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
!= (SEC_CODE | SEC_ALLOC))
break;
symcount = i;
}
count = 0;
if (relocatable)