Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ff2655cf2e4faf9dba1f51d3f72f775a389264d1

commit ff2655cf2e4faf9dba1f51d3f72f775a389264d1
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date:   Sat Aug 16 05:54:37 2008 +0200

binutils-2.18.50.0.8-4-ppc
- backport patch from cvs to fix ld --relax segfault on ppc

diff --git a/source/devel/binutils/FrugalBuild 
b/source/devel/binutils/FrugalBuild
index d285d9e..855863f 100644
--- a/source/devel/binutils/FrugalBuild
+++ b/source/devel/binutils/FrugalBuild
@@ -13,14 +13,17 @@ archs=('i686' 'x86_64' 'ppc')
# for now, we need a devel version to utilize glibc >= 2.7
up2date="Flasttar http://ftp.gnu.org/gnu/$pkgname/ | sed 's/2.18/2.18.50.0.8/'"
#Fup2gnubz2
-source=(http://www2.kernel.org/pub/linux/devel/$pkgname/$pkgname-$pkgver.tar.bz2)
+source=(http://www2.kernel.org/pub/linux/devel/$pkgname/$pkgname-$pkgver.tar.bz2
 \
+       ppc-relax.patch)
#source=(http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2)
#signatures=($source.sig)
-sha1sums=('0f85fedd189ee8a4e6e76355a2cabbb0bf547ed0')
+sha1sums=('0f85fedd189ee8a4e6e76355a2cabbb0bf547ed0' \
+          'cf29c642a5373647bd54b78b5870eac1559eb990')

build()
{
Fcd
+       Fpatchall
Fmake \
--enable-shared \
--disable-werror \
diff --git a/source/devel/binutils/ppc-relax.patch 
b/source/devel/binutils/ppc-relax.patch
new file mode 100644
index 0000000..1106605
--- /dev/null
+++ b/source/devel/binutils/ppc-relax.patch
@@ -0,0 +1,45 @@
+From 
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?r1=1.241&r2=1.242&cvsroot=src
+
+Comment from http://sourceware.org/ml/binutils/2008-08/msg00040.html:
+
+Fixes a bug in ppc ld --relax.  If relaxing code which has PLTREL24
+relocs with the magic got2 offset addends (as in -fPIC) and the
+PLTREL24 symbol resolves locally rather than going via the plt, then
+the addend made its way into the trampoline.  Typically this meant
+that the trampoline bounced 32k away from where it should have landed.
+
+In practice: makes ld --relax not segfault. :)
+
+===================================================================
+RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
+retrieving revision 1.241
+retrieving revision 1.242
+diff -u -r1.241 -r1.242
+--- src/bfd/elf32-ppc.c        2008/07/26 13:10:47     1.241
++++ src/bfd/elf32-ppc.c        2008/08/06 07:29:31     1.242
+@@ -5797,6 +5797,8 @@
+         irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+                                      stub_rtype);
+         irel->r_offset = trampoff + insn_offset;
++        if (r_type == R_PPC_PLTREL24)
++          irel->r_addend = 0;
+
+         /* Record the fixup so we don't do it again this section.  */
+         f = bfd_malloc (sizeof (*f));
+@@ -5879,7 +5881,7 @@
+
+       isec->size = (isec->size + 3) & (bfd_vma) -4;
+       /* Branch around the trampolines.  */
+-      val = trampoff - isec->size + 0x48000000;
++      val = B + trampoff - isec->size;
+       dest = contents + isec->size;
+       isec->size = trampoff;
+       bfd_put_32 (abfd, val, dest);
+@@ -6911,7 +6913,6 @@
+             relocation = (htab->plt->output_section->vma
+                           + htab->plt->output_offset
+                           + ent->plt.offset);
+-          addend = 0;
+         }
+         if (r_type == R_PPC_RELAX32_PLT)
+           goto relax32;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to