aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-20 16:00:58 +1030
committerAlan Modra <amodra@gmail.com>2021-01-20 22:47:48 +1030
commit088572dad9b2e7dbdeb67d44c00cc954f153aff4 (patch)
treec0f82ea96de44ed38ab57a334da55358fd894049
parentb6f526fb865d566b6928a1d6a5410ea4ec8e0137 (diff)
downloadgdb-088572dad9b2e7dbdeb67d44c00cc954f153aff4.zip
gdb-088572dad9b2e7dbdeb67d44c00cc954f153aff4.tar.gz
gdb-088572dad9b2e7dbdeb67d44c00cc954f153aff4.tar.bz2
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 8bd10d6b16de92570336e6026d466ef90e077e6e)
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eeb5fb4..75ad217 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-20 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume
+ section symbols are present.
+
2021-01-18 H.J. Lu <hongjiu.lu@intel.com>
PR ld/27193
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index a118c32..3119aac 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2299,7 +2299,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
sym->section directly. With separate debug info files, the
symbols will be extracted from the debug file while abfd passed
to this function is the real binary. */
- if (strcmp (syms[i]->section->name, ".opd") == 0)
+ if ((syms[i]->flags & BSF_SECTION_SYM) != 0
+ && strcmp (syms[i]->section->name, ".opd") == 0)
++i;
codesecsym = i;