diff --git a/binutils-2.23.51.0.1-ppc64-stub-lookup.patch b/binutils-2.23.51.0.1-ppc64-stub-lookup.patch new file mode 100644 index 0000000..3ec5875 --- /dev/null +++ b/binutils-2.23.51.0.1-ppc64-stub-lookup.patch @@ -0,0 +1,109 @@ +*** ../binutils-2.23.51.0.1.orig/bfd/elf64-ppc.c 2013-05-14 10:52:10.963140237 +0100 +--- bfd/elf64-ppc.c 2013-05-14 10:54:48.477144603 +0100 +*************** ppc64_elf_relocate_section (bfd *output_ +*** 12250,12256 **** + for (; rel < relend; rel++) + { + enum elf_ppc64_reloc_type r_type; +! bfd_vma addend, orig_addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; +--- 12250,12256 ---- + for (; rel < relend; rel++) + { + enum elf_ppc64_reloc_type r_type; +! bfd_vma addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; +*************** ppc64_elf_relocate_section (bfd *output_ +*** 12270,12275 **** +--- 12270,12276 ---- + struct ppc_stub_hash_entry *stub_entry; + bfd_vma max_br_offset; + bfd_vma from; ++ const Elf_Internal_Rela orig_rel = *rel; + + r_type = ELF64_R_TYPE (rel->r_info); + r_symndx = ELF64_R_SYM (rel->r_info); +*************** ppc64_elf_relocate_section (bfd *output_ +*** 12289,12295 **** + sym_name = NULL; + unresolved_reloc = FALSE; + warned = FALSE; +- orig_addend = rel->r_addend; + + if (r_symndx < symtab_hdr->sh_info) + { +--- 12290,12295 ---- +*************** ppc64_elf_relocate_section (bfd *output_ +*** 12853,12859 **** + && h->oh != NULL + && h->oh->is_func_descriptor) + fdh = ppc_follow_link (h->oh); +! stub_entry = ppc_get_stub_entry (input_section, sec, fdh, rel, htab); + if (stub_entry != NULL + && (stub_entry->stub_type == ppc_stub_plt_call + || stub_entry->stub_type == ppc_stub_plt_call_r2save +--- 12853,12860 ---- + && h->oh != NULL + && h->oh->is_func_descriptor) + fdh = ppc_follow_link (h->oh); +! stub_entry = ppc_get_stub_entry (input_section, sec, fdh, &orig_rel, +! htab); + if (stub_entry != NULL + && (stub_entry->stub_type == ppc_stub_plt_call + || stub_entry->stub_type == ppc_stub_plt_call_r2save +*************** ppc64_elf_relocate_section (bfd *output_ +*** 13134,13140 **** + } + + for (; ent != NULL; ent = ent->next) +! if (ent->addend == orig_addend + && ent->owner == input_bfd + && ent->tls_type == tls_type) + break; +--- 13135,13141 ---- + } + + for (; ent != NULL; ent = ent->next) +! if (ent->addend == orig_rel.r_addend + && ent->owner == input_bfd + && ent->tls_type == tls_type) + break; +*************** ppc64_elf_relocate_section (bfd *output_ +*** 13287,13293 **** + { + struct plt_entry *ent; + for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next) +! if (ent->addend == orig_addend + && ent->plt.offset != (bfd_vma) -1) + { + relocation = (htab->plt->output_section->vma +--- 13288,13294 ---- + { + struct plt_entry *ent; + for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next) +! if (ent->addend == orig_rel.r_addend + && ent->plt.offset != (bfd_vma) -1) + { + relocation = (htab->plt->output_section->vma +*************** ppc64_elf_relocate_section (bfd *output_ +*** 13861,13867 **** + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->elf.root : NULL), sym_name, + ppc64_elf_howto_table[r_type]->name, +! orig_addend, input_bfd, input_section, rel->r_offset))) + return FALSE; + } + else +--- 13862,13869 ---- + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->elf.root : NULL), sym_name, + ppc64_elf_howto_table[r_type]->name, +! orig_rel.r_addend, input_bfd, input_section, +! rel->r_offset))) + return FALSE; + } + else diff --git a/binutils.spec b/binutils.spec index 4f2bf87..4a52bfc 100644 --- a/binutils.spec +++ b/binutils.spec @@ -17,7 +17,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.23.51.0.1 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -49,6 +49,8 @@ Patch14: binutils-2.23.51.0.1-arm-whitespace.patch Patch15: binutils-2.23.51.0.1-ppc64-dyn-rel-count.patch # Prevent seg-fault in readelf when reading a corrupt archive file. Patch16: binutils-2.23.51.0.1-readelf-corrupt-ar.patch +# Fix lookup of stub names. BZ #962469 +Patch17: binutils-2.23.51.0.1-ppc64-stub-lookup.patch %define gold_arches %ix86 x86_64 @@ -158,6 +160,7 @@ using libelf instead of BFD. %patch14 -p0 -b .arm-whitespace~ %patch15 -p0 -b .dyn-rel-count~ %patch16 -p0 -b .corrupt-ar~ +%patch17 -p0 -b .stub-lookup~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -456,26 +459,29 @@ exit 0 %endif # %{isnative} %changelog -* Thu Feb 7 2013 Nick Clifton 2.23.51.0.1-8 +* Tue May 14 2013 Nick Clifton 2.23.51.0.1-9 +- Fix stub lookups for PPC64. (#962469) + +* Thu Feb 7 2013 Nick Clifton 2.23.51.0.1-8 - Prevent a seg-fault in readelf when examining a corrupt archive. (#908567) -* Mon Feb 4 2013 Nick Clifton 2.23.51.0.1-7 +* Mon Feb 4 2013 Nick Clifton 2.23.51.0.1-7 - Don't error when elf_gc_sweep_symbol clears def_regular. (#906273) -* Fri Jan 24 2013 Nick Clifton 2.23.51.0.1-6 +* Fri Jan 24 2013 Nick Clifton 2.23.51.0.1-6 - Allow more whitespace in ARM instructions. (#892261) * Wed Nov 7 2012 Jeff Law 2.23.51.0.1-5 -- Fix segfault with local ifunc symbols on s390[x] (#805107). +- Fix segfault with local ifunc symbols on s390[x]. (#805107). * Tue Sep 4 2012 Jeff Law 2.23.51.0.1-4 - Correctly handle PLTOFF relocs for s390 IFUNCs. * Tue Aug 14 2012 Karsten Hopp 2.23.51.0.1-3 -- apply F17 commit cd2fda5 to honour {powerpc64} macro (#834651) +- Apply F17 commit cd2fda5 to honour {powerpc64} macro. (#834651) * Tue Aug 14 2012 Nick Clifton - 2.23.51.0.1-2 -- Make GOLD honour KEEP directives in linker scripts (#8333355) +- Make GOLD honour KEEP directives in linker scripts. (#8333355) * Wed Aug 08 2012 Nick Clifton - 2.23.51.0.1-1 - Rebase on 2.23.51.0.1 release. (#846433)