Blame SOURCES/binutils-ppc-annobin-disassembly.patch

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