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 16:11:01 +1030
commit8bd10d6b16de92570336e6026d466ef90e077e6e (patch)
tree4800dbdb9aa200c607428e453c52193a962b2510
parent11321a0505a447eba2c13c306aa38c224c00b19a (diff)
downloadfsf-binutils-gdb-8bd10d6b16de92570336e6026d466ef90e077e6e.zip
fsf-binutils-gdb-8bd10d6b16de92570336e6026d466ef90e077e6e.tar.gz
fsf-binutils-gdb-8bd10d6b16de92570336e6026d466ef90e077e6e.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.
-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 c97976d..f546328 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-19 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (elf_hash_entry): New inline function. Use
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index ed59507..f76830b 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;