]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - opcodes/ppc-dis.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / opcodes / ppc-dis.c
index eca1f36710814cc991f13a2cdbb0d5062ef53355..841ba092b85ac49d5da1d6ebf283a7c6282d799a 100644 (file)
@@ -1,5 +1,5 @@
 /* ppc-dis.c -- Disassemble PowerPC instructions
-   Copyright (C) 1994-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994-2021 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support
 
    This file is part of the GNU opcodes library.
@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[VLE_OPCD_SEGS + 1];
 #define SPE2_OPCD_SEGS (1 + SPE2_XOP_TO_SEG (SPE2_XOP (-1)))
 static unsigned short spe2_opcd_indices[SPE2_OPCD_SEGS + 1];
 
+static bfd_boolean
+ppc_symbol_is_valid (asymbol *sym,
+                    struct disassemble_info *info ATTRIBUTE_UNUSED)
+{
+  elf_symbol_type * est;
+
+  if (sym == NULL)
+    return FALSE;
+
+  est = elf_symbol_from (sym);
+  
+  /* Ignore ELF hidden, local, no-type symbols.
+     These are generated by annobin.  */
+  if (est != NULL
+      && ELF_ST_VISIBILITY (est->internal_elf_sym.st_other) == STV_HIDDEN
+      && ELF_ST_BIND (est->internal_elf_sym.st_info) == STB_LOCAL
+      && ELF_ST_TYPE (est->internal_elf_sym.st_info) == STT_NOTYPE)
+    return FALSE;
+
+  return TRUE;
+}
+
 /* Calculate opcode table indices to speed up disassembly,
    and init dialect.  */
 
 void
 disassemble_init_powerpc (struct disassemble_info *info)
 {
+  info->symbol_is_valid = ppc_symbol_is_valid;
+
   if (powerpc_opcd_indices[PPC_OPCD_SEGS] == 0)
     {
       unsigned seg, idx, op;