]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PowerPC64 synthetic symbols
authorAlan Modra <amodra@gmail.com>
Wed, 20 Jan 2021 05:30:58 +0000 (16:00 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 20 Jan 2021 12:17:48 +0000 (22:47 +1030)
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)

bfd/ChangeLog
bfd/elf64-ppc.c

index eeb5fb4632f3a50959133891e106aa24692dfed9..75ad21752ae0e0525ac5b81645256bce78f8a3dd 100644 (file)
@@ -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
index a118c32c7978464e6369880fef3ce6433a4f991e..3119aaca84ccc16a73bd516bdbbf86e24ef45b9b 100644 (file)
@@ -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;