ba80920
--- binutils.orig/opcodes/ppc-dis.c	2020-09-11 10:55:56.243724026 +0100
ba80920
+++ binutils-2.35/opcodes/ppc-dis.c	2020-09-11 10:57:51.363934217 +0100
ba80920
@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[V
ba80920
 #define SPE2_OPCD_SEGS (1 + SPE2_XOP_TO_SEG (SPE2_XOP (-1)))
ba80920
 static unsigned short spe2_opcd_indices[SPE2_OPCD_SEGS + 1];
ba80920
 
ba80920
+static bfd_boolean
ba80920
+ppc_symbol_is_valid (asymbol *sym,
ba80920
+		     struct disassemble_info *info ATTRIBUTE_UNUSED)
ba80920
+{
ba80920
+  elf_symbol_type * est;
ba80920
+
ba80920
+  if (sym == NULL)
ba80920
+    return FALSE;
ba80920
+
ba80920
+  est = elf_symbol_from (NULL, sym);
ba80920
+  
ba80920
+  /* Ignore ELF hidden, local, no-type symbols.
ba80920
+     These are generated by annobin.  */
ba80920
+  if (est != NULL
ba80920
+      && ELF_ST_VISIBILITY (est->internal_elf_sym.st_other) == STV_HIDDEN
ba80920
+      && ELF_ST_BIND (est->internal_elf_sym.st_info) == STB_LOCAL
ba80920
+      && ELF_ST_TYPE (est->internal_elf_sym.st_info) == STT_NOTYPE)
ba80920
+    return FALSE;
ba80920
+
ba80920
+  return TRUE;
ba80920
+}
ba80920
+
ba80920
 /* Calculate opcode table indices to speed up disassembly,
ba80920
    and init dialect.  */
ba80920
 
ba80920
 void
ba80920
 disassemble_init_powerpc (struct disassemble_info *info)
ba80920
 {
ba80920
+  info->symbol_is_valid = ppc_symbol_is_valid;
ba80920
+
ba80920
   if (powerpc_opcd_indices[PPC_OPCD_SEGS] == 0)
ba80920
     {
ba80920
       unsigned seg, idx, op;