]> 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 05:41:01 +0000 (16:11 +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.

bfd/ChangeLog
bfd/elf64-ppc.c

index c97976dd8b2b9416c701915b5f4bb0b0d871cd22..f546328ac64907ca7eebb820ec989278050227eb 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-19  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (elf_hash_entry): New inline function.  Use
index ed595074b94404de6ba9decba13b722be0451fd0..f76830b6c42d5073134b116fcbd7685ca78af5af 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;