Skip to content

Commit 088572d

Browse files
committed
PowerPC64 synthetic symbols
If an assembler trims off unused section symbols there may be no section symbols. This means that testing for the .opd section symbol needs to test both the section name and symbol flags. * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume section symbols are present. (cherry picked from commit 8bd10d6)
1 parent b6f526f commit 088572d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bfd/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2021-01-20 Alan Modra <amodra@gmail.com>
2+
3+
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume
4+
section symbols are present.
5+
16
2021-01-18 H.J. Lu <hongjiu.lu@intel.com>
27

38
PR ld/27193

bfd/elf64-ppc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
22992299
sym->section directly. With separate debug info files, the
23002300
symbols will be extracted from the debug file while abfd passed
23012301
to this function is the real binary. */
2302-
if (strcmp (syms[i]->section->name, ".opd") == 0)
2302+
if ((syms[i]->flags & BSF_SECTION_SYM) != 0
2303+
&& strcmp (syms[i]->section->name, ".opd") == 0)
23032304
++i;
23042305
codesecsym = i;
23052306

0 commit comments

Comments
 (0)