From ba80920a4cb7699296e36d77a819c34ba42d7ea3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Sep 11 2020 10:37:10 +0000 Subject: Fix the PowerPC disassembler so that it ignores annobin symbols. --- diff --git a/.gitignore b/.gitignore index 1183cc7..23f38dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.diff -*.patch *.orig *.rej diff --git a/binutils-ppc-annobin-disassembly.patch b/binutils-ppc-annobin-disassembly.patch new file mode 100644 index 0000000..dd054a6 --- /dev/null +++ b/binutils-ppc-annobin-disassembly.patch @@ -0,0 +1,39 @@ +--- binutils.orig/opcodes/ppc-dis.c 2020-09-11 10:55:56.243724026 +0100 ++++ binutils-2.35/opcodes/ppc-dis.c 2020-09-11 10:57:51.363934217 +0100 +@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[V + #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 (NULL, 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; diff --git a/binutils.spec b/binutils.spec index 81e8389..2d22955 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.35 -Release: 12%{?dist} +Release: 14%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -245,6 +245,14 @@ Patch27: binutils-ppc-rename-xvcvbf16sp-to-xvcvbf16spn.patch # Lifetime: Fixed in 2.36 Patch28: binutils-dwarf-5-fixes.patch +# Purpose: Fix handling of relocations for AArch64 conditional branches. +# Lifetime: Fixed in 2.36 +Patch29: binutils-aarch64-condbranch-relocs.patch + +# Purpose: Fix the PowerPC disassembler so that it ignores annobin symbols. +# Lifetime: Fixed in 2.36 +Patch30: binutils-ppc-annobin-disassembly.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -818,6 +826,12 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Fri Sep 11 2020 Nick Clifton - 2.35-14 +- Fix the PowerPC disassembler so that it ignores annobin symbols. + +* Thu Sep 10 2020 Nick Clifton - 2.35-13 +- Fix the handling of relocations for AArch64 conditional branches. + * Tue Aug 25 2020 Nick Clifton - 2.35-12 - Import fixes from GNU binutils mainline for handling DWARF-5 debug information.